ake a network of lines (i.e. a graph) and make a Plankton Mesh, from which you can use Cytoskeleton to make a solid mesh (and then smooth it with Weaverbird).
Works with ngons (polygons with 3 or more sides). Other examples I found only worked with tris and quads.
Works on open or closed surfaces
While these examples start with a surface, you could start with a network of lines and make a patch surface
This is meant for 2D networks/surfaces. I haven't attempted filling a 3D volume. My guess is this wouldn't work as it would require a non-manifold mesh that Plankton wouldn't handle.
Note similar results could be achieved with the following:
TSplines
MeshDual (dual of a tri mesh, not as much freedom/control)
Working backwards, here is the GhPython script from Will Pearson that builds a Plankton Mesh from vertices and faces. The vertices are a list of 3D coordinates, the faces are a tree a lists, with each list containing the indices of vertices that form a closed loop. From Will, "Plankton only handles manifold meshes, i.e. meshes which have a front and a back. This orientation is determined by the "right-hand rule" i.e. if the vertices of a face are ordered counter-clockwise then the face normal will be out of the page/screen."
# V: list of Point3d # F: tree of int
import Grasshopper appdata = Grasshopper.Folders.DefaultAssemblyFolder
import clr clr.AddReferenceToFileAndPath(appdata + "Plankton.dll")
import Plankton
pmesh = Plankton.PlanktonMesh()
for pt in V: pmesh.Vertices.Add(pt.X, pt.Y, pt.Z)
for face in F.Branches: face = list(face)[:-1] pmesh.Faces.AddFace(face)
These vertices and faces are precisely the output from Starling. Starling takes in a list of Polylines which form the (properly oriented) face loops.
The polyline face loops can be generated...
Directly from Panels on a surface using LunchBox
Using any network of lines/curves on a surface (curves will need to be converted to polylines before Starling)
The latter was achieved using the Surface Split command, then converting the face edges (converted to curves) into polyline loops to represent faces.
…
hope this number will grow in future. Currently available features are:
1) Creation of 2d or 3d context for any kind of building related analysis: automatically generate the 2d/3d surrounding buildings for the location where you would like to perform visibility, solar radiation, cfd or any other type of analysis. You need some other plugin for the last three, like Ladybug. It only creates the context=surroundings! The "automatic generation" process also includes creation of the local topography (terrain) along with buildings.
2) Identification of certain 2d or 3d elements in the created context. For example: selection of all hotels, parks, hospitals, restaurants, residential buildings etc.
3) Performing direct terrain analysis (hillshading, slope, ruggedness, roughness, water flow...)
4) Creation of terrain shading masks and horizon files for further solar and photovoltaics analysis.
Gismo will be very grateful if he could get any suggestions, improvements, bug reports and testing in the following period. In case you are willing to provide any of these, the requirements, installation steps and .gh example files can be found here, here and here.
Thank you in advance !!…
Added by djordje to Gismo at 9:10am on January 29, 2017
de modelación en 3D y aprovechen las ventajas que plantean, como mejorar su proceso de diseño y explorar múltiples alternativas para un proyecto en lapsos de tiempo muy reducidos en comparación de los métodos tradicionales.
En consecuencia, los alumnos tendrán la posibilidad de disminuir sus tiempos de trabajo, con resultados iguales o incluso mejores a los que obtenían con anterioridad; mejorar la calidad de sus presentaciones y, lo que es más importante, ampliar la fundamentación de sus proyectos en el aspecto funcional y formal, dependiendo de las características del proyecto.
Para lograr estos objetivos, se contemplan dos temarios y un ejercicio práctico.
Al finalizar el curso, los asistentes serán capaces de manejar Rhinoceros y Grasshopper en un nivel medio, con el objetivo que el alumno pueda continuar aprendiendo con alguno de nuestros siguientes workshops o de manera autodidacta.
Además del contenido teórico se incluye un ejercicio práctico, la magnitud del ejercicio y el material que se le destine se definirán con base en el número de asistentes.
El workshop tiene una duración de cinco sesiones:
Sesión 1 – Temario de Rhinoceros
Sesión 2 y 3 – Temario de Grasshopper
Sesión 4 y 5 – Ejercicio práctico
El horario es de 9 am a 4 pm, con una hora de receso para tomar un refrigerio.
No es necesario traer el equipo necesario para trabajar, se cuenta con un equipo para cada persona asi como el material de trabajo para el ejercicio práctico, por lo cual se les recomienda que no traigan portátiles u otro material, únicamente dispositivos de almacenamiento si desean guardar sus trabajos.
El costo del evento es de $3,500 estudiantes y $4,000 profesionales.
(Para poder tener el descuento de estudiante es necesaria una constancia de la universidad de la que proviene, acreditando que el interesado está cursando algún semestre de la carrera. Personas graduadas que estén cursando una maestría o algún grado superior no reciben el descuento).
Para apartar su lugar pueden realizar un depósito de $1,500 y terminar de efectuar el pago antes del 15 de abril si es mediante un depósito bancario o el primer día del evento en efectivo.
El evento se realizará en las oficinas de Vegasot, ubicadas en Circuito Cirujanos No. 23-A
Cd. Satélite, Naucalpan, Edo. de México 53100
http://www.vegasoft.com.mx
Para cualquier duda por favor escriban un correo a luzytextura@gmail.com, por teléfono al 044 55 4381 3302, o en facebook.com/archbernardorivera…
onstrates the following:
1. The definition's functionality employing HumanUI for the custom user interface.
2. Color based segmentation in manual and auto modes.
3. The evaluation of the definition's ability to handle different point cloud data sets.
This definition performs color based segmentation in two modes.
A manual mode, that implements the Delta-E CIE 2000 color difference formula, for targeted feature detection. An auto mode, that employs a simple RGB Color Range algorithm for quicker preliminary results.
RGB to XYZ to CIELab conversion and Delta-E scripts were based on Colormine's project code from github. Results have been compared and verified with the results of http://colormine.org/color-converter and http://colormine.org/delta-e-calculator/Cie2000.
Each stored class is charted and can be accessed through the UI, as shown at 2:30, where Delta-E CIE 2000, in CieLab color space, output results were found to be in perceptive conformity with human eyes, far superior to the preliminary RGB implementation.
Initial definition versions could process highly subsampled clouds in acceptable timings. Further research showed that employing the multithread processing of Volvox components, bundling the Delta E formula with the RGB to CIE lab color conversion script, per color segmentation calculations for a one million points point cloud would go down from 23 (c# script component) and 8 (vb script component) seconds to approx. 1 second (volvox script cloud component), thus allowing the segmentation of less subsampled point clouds.
I would like to thank Heumann A. and Zwierzycki M. who provided direct support with HumanUI and Volvox. Also Grasshopper3d forum users Maher S. and Segeren P., who contributed with Rhino viewport manipulation scripts.
More on Volvox:
http://papers.cumincad.org/cgi-bin/works/Show?_id=ecaade2016_171&sort=DEFAULT&search=ecaade%20volvox&hits=2629
http://www.food4rhino.com/app/volvox
http://duraark.eu/
HumanUI:
http://www.food4rhino.com/app/human-ui?page=1&ufh=&etx=
ColorMine:
https://github.com/THEjoezack/ColorMine…
h tubes are redundant so surfaces overlap instead of interpenetrate, so it is not a good system.
Cocoon is the best answer these days unless you can get Exowire/Exoskelton to work. If you want more control over shape, feed your uncapped tubes into Cocoon as meta-surfaces and delete any and all of the inner meshes to just keep the outer single closed one, but this is just duplicate-culled lines used as meta-lines:
Turn down the CS input to 0.005 for this result, from 0.02 used for faster preview. In fact bake the lines and only test Cocoon on a few of them in order to get the result you want before doing the whole thing.
Whole thing at 0.005 cell size takes 5 minutes for Cocoon and 2 minutes for refinement to a smooth and even mesh.
Actually, seems like 0.005 is way too fine, giving a 600MB STL file.
So, 0.01 cell size at less than a minute total:
159MB STL which is still a bit too big for places like Shapeways. Wow. OK then 0.02 cell size, but I have to increase diameter or my two smoothing steps in refine collapse things too much, an in fact I set it to no smoothing, getting more volume and a reasonable 46MB STL file:
Alas, now it's more frail and overly organic rather than mechanical. Increasing diameter just merges it into perforated plates too much. File size is simply an issue with this complexity level, so different 3D printing services will have different file size limits.
Exowire/Exoskeleton would work but your original mesh hasn't been MeshMachine remeshed to be regular, so short segments ruin it. Here is just a corner:
I think that's why more wires fails, at least. Pretty temperamental component.
Switching to MeshMachine is needed, I guess, instead of Cocoon refine, to remesh away so many small triangles along the boring tubes. Crucial for good remeshing was to set Flip to 0 or I failed to get a rough enough mesh.
It's an adaptive mesh so I can retain good detail while roughing out the tubes.
MeshMachine is terribly slow for this whole thing, like 6 minutes, and blows up for this overly rough setting, 20 steps, so less rough, ugh, I'm out of time. I think free Autocad Meshmixer is the way to make a better smaller mesh, after a refined output from Cocoon. MeshMachine is just too slow to tweak and when it blows up, creating massive triangles jutting out, it hangs too when you change settings.
Starting with a Cocoon refined mesh certainly helped Meshmixer. Using triangle budget lets me have full control. Here is 150K triangles instead of 200K:
STL file size down to 40MB. I think Shapeways is 70 or 100MB limit? So it can be even finer. Here is the Cocoon output versus the Meshmixer reduction:
To use Meshmixer, turn on View > Show Wireframe, Command-S to select all and use Edit > Reduce from the palette that appears.
Cocoon can end up making a few inner meshes where things get weird in your uneven original mesh with small holes so fish out the main mesh by adding a List Item node.
The best strategy for Cocoon is indeed to make an overly fine STL so you avoid any need to tweak forever in Grasshopper, but then you can achieve a smaller mesh file size while preserving shape instead of things turning all smearly organic in Grasshopper.…
I live on my computer and I even sleep with it, so learning all this is probably within my reach but I'm a complete beginner as of now.
I'm downloading the 32 bit version of rhino 5 since the 64 bit doesn't seem to work with your downloads Jon.
I haven't grasped everything you have made yet Jon I can't even begin to understand what your IFC stuff is actually capable of, but just to be clear I'm not interested in solely being able to tell that something is colliding as there are already software that can do that beautifully. What I want to do is bypass that step altogether by never having collision-checking back and forth go on, even collisions which aren't physical collisions, but rather just violations by code. The simplest way to do this would be to simply make the geometry of the beams 2 feet wider than they are in real life, so that way you could put a light right next to the 'over-sized' beam and it would still be within the rules. But that would be extremely primitive and I'm sure there's a way to do it mathematically.
Just to clarify, I'm the fire sprinkler designer in the architectural circus. The sprinkler designer (me) doesn't really get the luxury of telling the other trades that they're colliding with my stuff and they should move. Rather, I get their drawings, find out I'm colliding with them, and move around them. So it would be of great use to me to have this be automatic - that is, to automatically space my sprinklers the neccesary distance away from all obstructions. There are different spacing rules for different obstructions - walls, beams, open web steel, unit heaters, hvac ducts depending on how wide the ducts are, lights, fans, high rack storage, basically anything that would obstruct the water spray from a sprinkler needs to be taken into account and spaced away from.
It's therefore a very attractive idea to be able to just draw a rectangle (representing the walls of a simple room) for instance, have the sprinklers automatically spaced as far apart as possible within the rectangle according to the rulebooks (to minimize the amount of sprinklers needed which minimizes the material cost of the job).
Then add obstructions inside the rectangle, such as a beam, and have the sprinklers relocate themselves or add new sprinklers to accommodate for the new obstruction.. Keep adding obstructions until you have the realistic 3d model of the room, with the sprinklers spaced accordingly, and you have an up-to-code sprinkler system.
There is one example where sprinklers actually need to be spaced really close to, rather than away from, an object.. and that is the ceiling (sprinklers must be within 12 in of ceiling typically).
If the HVAC guy decides to reroute his ducts right through my sprinklers, then I could draw 3D HVAC ducts (I usually get 2D drawings coming in) going right through the room and the sprinklers would relocate and auto-space away from the ducts, without actually having to tell the HVAC guy he is colliding with me because all that will do is require me to do a redesign anyway.
And presto, the HVAC guy loves me because I didn't complain to him at all and seemingly did all this work by moving around him when all I really did was use the computer to do it, the job gets done much faster and I don't have to worry that I'm going to lose my job in court because I made a silly human error when I was patching my system manually because some HVAC guy made me redesign 12 times in different places.
From what I have been reading from you guys, doing this is possible although (I realize) ambitious. The end result would be vastly increased productivity, less error making, cheaper design cost, etc. Using programs like Rhino, architects are getting more and more funny-shaped buildings and making it difficult for guys like me to make sprinkler systems within the rules, and I see it as an inevitability that computers will be making almost all of the typical design decisions in the future when it comes to life safety systems, I'm just trying to see if it's possible to start implementing this extra aid today.
…
g-in, brief theory of complex systems, introduction to multi-agent systems and non-linear design, flocking, Boid library, basic examples - brownian motion, adhesion, separation, alignment, geometry following.-----------------------TIME: first session10am – GMT, London11am – Paris, Brussels, Rome, Vienna, Budapest, Bratislava, Warsaw9pm - Sidney7pm – Tokyo6pm – Beijing, Shanghai, Shenzhen, Hong Kong, Taipei3:30pm – Mumbai3pm – Karachi2pm - Samara1pm – Baghdad, Moscow, St Petersburg12pm – Istanbul, Athens, Helsinki, Cairo, JohannesburgTIME: second session3pm – GMT, London4pm – Paris, Brussels, Rome, Vienna, Budapest, Bratislava, Warsaw7pm – Dubai, Abu Dhabi, Baku6:30pm – Tehran6pm – Baghdad, Moscow, St Petersburg5pm – Istanbul, Athens, Helsinki, Cairo, Johannesburg1pm – Rio de Janeiro, São Paulo, Montevideo12pm – Buenos Aires, Santiago10am – Toronto, New York City, Bogota, Lima9am – Mexico City7am – Los AngelesWEBINARSThe rese arch Grasshopper® sessions are unique for their thorough explanation of all the features, which creates a sound foundation for your further individual development or direct use in the practice. The webinars are divided into four groups: Essential, Advanced, Iterative and Architectural. If you are a Rhinoceros 3D or Grasshopper® newcomer, you are advised to take all the Essential sessions before proceeding to the next level. If none of the proposed topics suit your needs or if you require special treatment, you can request a custom-tailored 1on1 session. All sessions are held entirely in English.The webinars are series of on-line live courses for people all over the world. The tutor broadcasts the screen of his computer along with his voice to the connected spectators who can ask questions and comment in real time. This makes webinars similar to live workshops and superior to tutorials.…
Added by Jan Pernecky at 3:36pm on February 17, 2015
ally to describe a process of repeating objects in a self-similar way. Simply stated, the definition of a recursive function includes the function itself. Fractals are among the canonical examples of recursion in mathematics and programming. A loop can simply be a way to apply the same operation to a list of elements, but it is an iterative loop if the results from one step are used in the calculation of the next step. In design research controlling recursion becomes a new strategy to define new forms and spaces.
BRIEF
In this workshop we will be exploring iterative strategies through parametric design. Main tool for the course will be grasshopper3d and its add-on Anemone. Anemone is a simple but effective plug-in for Grasshopper that enables for loops in a simple and linear way. We will explore several strategies such iterative growth, L systems, fractals, recursive subdivisions and more. Our course will focus on how those methods can affect three-dimensional geometries, generating unexpected conformations.
TOPICS
intro to rhinointro to grasshopperadvanced grasshopperdata managementintro to loopscellular automatal-systemsagent based modelling
SCHEDULE
Day 1 / friday 16:00Tour Green Fab LabBasics of 3D modeling in RhinocerosBasics of GrasshopperOpen Lecture by Jan Pernecky, founder of rese arch
Day 2 / saturday 10 am- 18 pmRecursive iterative methodsAdvanced Topics of looping
Day 3 / sunday 10 am – 18 pmRecursive iterative methodsFinal presentation session
REQUIREMENTS
The workshop is open to all participants, no previous knowledge of Rhinoceros and Grasshopper is required (although an introductory knowledge is welcome). Participants should bring their own laptop with a pre-installed software. The software package needed has no additional cost for the participant (Rhino can be downloaded as evaluation version, Grasshopper and plugins are free). These softwares are subject to frequent updates, so a download link to the version used in the workshop will be sent to the participants a few days before the workshop.…
Added by Aldo Sollazzo at 11:10am on October 6, 2015
r ideal surface so they add up where lots of points or lines cluster and create rather unintuitive bulges form a 3D modeler's perspective, here done with Millipede's Geometry Wrapper:
I've learned to do marching tetrahedra or cubes in Python to create the surface as needed from a implicit ( f(x,y,z) = 0 ) mathematical equation based on raw trigonometry but am not yet sure how to define an equation for Rhino user created input items like this or find a way to make marching cubes accept such input let alone one that doesn't treat each geometry item as an electric charge with so little decay.
This would afford an old school "organic" modeling paradigm that T-Splines replaced, but the T-Spines pipe command can't do nearby lines right either, which just makes overlapping junk. Metaballs and lines are not as elegant in that there is a real "dumb clay" aspect to the result that affords little natural structure beyond just smoothing, but still, if it works at all that beats T-Splines, and then I can feed the crude mesh result into Kangaroo MeshMachine to afford surface tension relaxation that will add elegant form to it.
I need both quick hacks and some help on how to deeply approach the mathematics of the required isosurface, now that I can think in Python better than ever.
I got a hint the other day here, about using a different power of fall-off but am not sure how to do the overall task mathematically:
"and just as with point based potentials, one can use different power laws for the distance, function, resulting it different amounts of rounding at the junctions. Below is with a 1/d^3 law for comparision with the above 1/d" - Daniel Piker
http://www.grasshopper3d.com/forum/topics/meshes?commentId=2985220%3AComment%3A1324050
He also included this link about bulging:
http://paulbourke.net/geometry/implicitsurf/
Am I supposed to create an actual implicit equation for my assigned points and lines and use that with marching cubes to surface it? If so, how do I define that equation, at all, and then how to control bulging too?
…
is set up to manipulate strings into an STL file that is quite different from how Grasshopper defines meshes, in that an STL seems to define each face by XYZ points, Grasshopper wants a single list of all vertex points and then has an allied lists of topological connectivity according to vertex number, so for now I just hacked it to spit out points minus so many duplicates it generates for STL:
Right now it has an internal 3D trigonometric function I added input sliders to control, that creates surfaces that look a lot like molecular orbitals.
So how do I make a mesh? I failed to make a single mesh face from each STL face since AddMesh seems to want a list, so I tried making a single list and matching it with a simple ((1,2,3),(4,5,6),(7,8,9)...) array of connectivity but it hasn't worked yet since the STL list of vertices has duplicates that won't work for Grasshopper and removing the duplicates scrambles the connectivity relation.
After some work on this and seeing the output, I figure I could just randomly populate the mathematical function with points instead, unless it really gives a better mesh result than other routines. I'm not sure what to do with it yet, even if I get the mesh figured out.
import rhinoscriptsyntaximport RhinoPOINTS_CONTAINER =[]POINTS = []class Vector: # struct XYZ def __init__(self,x,y,z): self.x=x self.y=y self.z=z def __str__(self): return str(self.x)+" "+str(self.y)+" "+str(self.z) class Gridcell: # struct GRIDCELL def __init__(self,p,n,val): self.p = p # p=[8] self.n = n # n=[8] self.val = val # val=[8] class Triangle: # struct TRIANGLE def __init__(self,p1,p2,p3): self.p = [p1, p2, p3] # vertices # HACK TO GRAB VERTICES FOR PYTHON OUTPUT POINTS_CONTAINER.append( (p1.x,p1.y,p1.z) ) POINTS_CONTAINER.append( (p2.x,p2.y,p2.z) ) POINTS_CONTAINER.append( (p3.x,p3.y,p3.z) )# return a 3d list of values def readdata(f=lambda x,y,z:x*x+y*y+z*z,size=5.0,steps=11): m=int(steps/2) ki = [] for i in range(steps): kj = [] for j in range(steps): kd=[] for k in range(steps): kd.append(f(size*(i-m)/m,size*(j-m)/m,size*(k-m)/m)) kj.append(kd) ki.append(kj) return ki from math import sin,cos,exp,atan2 def lobes(x,y,z): try: theta = atan2(x,y) # sin t = o except: theta = 0 try: phi = atan2(z,y) except: phi = 0 r = x*x+y*y+z*z ct=cos(PARAMETER_A * theta) cp=cos(PARAMETER_B * phi) return ct*ct*cp*cp*exp(-r/10) def main(): data = readdata(lobes,10,40) isolevel = 0.1 #print(data) triangles=[] for i in range(len(data)-1): for j in range(len(data[i])-1): for k in range(len(data[i][j])-1): p=[None]*8 val=[None]*8 #print(i,j,k) p[0]=Vector(i,j,k) val[0] = data[i][j][k] p[1]=Vector(i+1,j,k) val[1] = data[i+1][j][k] p[2]=Vector(i+1,j+1,k) val[2] = data[i+1][j+1][k] p[3]=Vector(i,j+1,k) val[3] = data[i][j+1][k] p[4]=Vector(i,j,k+1) val[4] = data[i][j][k+1] p[5]=Vector(i+1,j,k+1) val[5] = data[i+1][j][k+1] p[6]=Vector(i+1,j+1,k+1) val[6] = data[i+1][j+1][k+1] p[7]=Vector(i,j+1,k+1) val[7] = data[i][j+1][k+1] grid=Gridcell(p,[],val) triangles.extend(PolygoniseTri(grid,isolevel,0,2,3,7)) triangles.extend(PolygoniseTri(grid,isolevel,0,2,6,7)) triangles.extend(PolygoniseTri(grid,isolevel,0,4,6,7)) triangles.extend(PolygoniseTri(grid,isolevel,0,6,1,2)) triangles.extend(PolygoniseTri(grid,isolevel,0,6,1,4)) triangles.extend(PolygoniseTri(grid,isolevel,5,6,1,4)) def t000F(g, iso, v0, v1, v2, v3): return [] def t0E01(g, iso, v0, v1, v2, v3): return [Triangle( VertexInterp(iso,g.p[v0],g.p[v1],g.val[v0],g.val[v1]), VertexInterp(iso,g.p[v0],g.p[v2],g.val[v0],g.val[v2]), VertexInterp(iso,g.p[v0],g.p[v3],g.val[v0],g.val[v3])) ] def t0D02(g, iso, v0, v1, v2, v3): return [Triangle( VertexInterp(iso,g.p[v1],g.p[v0],g.val[v1],g.val[v0]), VertexInterp(iso,g.p[v1],g.p[v3],g.val[v1],g.val[v3]), VertexInterp(iso,g.p[v1],g.p[v2],g.val[v1],g.val[v2])) ] def t0C03(g, iso, v0, v1, v2, v3): tri=Triangle( VertexInterp(iso,g.p[v0],g.p[v3],g.val[v0],g.val[v3]), VertexInterp(iso,g.p[v0],g.p[v2],g.val[v0],g.val[v2]), VertexInterp(iso,g.p[v1],g.p[v3],g.val[v1],g.val[v3])) return [tri,Triangle( tri.p[2], VertexInterp(iso,g.p[v1],g.p[v2],g.val[v1],g.val[v2]), tri.p[1]) ] def t0B04(g, iso, v0, v1, v2, v3): return [Triangle( VertexInterp(iso,g.p[v2],g.p[v0],g.val[v2],g.val[v0]), VertexInterp(iso,g.p[v2],g.p[v1],g.val[v2],g.val[v1]), VertexInterp(iso,g.p[v2],g.p[v3],g.val[v2],g.val[v3])) ] def t0A05(g, iso, v0, v1, v2, v3): tri = Triangle( VertexInterp(iso,g.p[v0],g.p[v1],g.val[v0],g.val[v1]), VertexInterp(iso,g.p[v2],g.p[v3],g.val[v2],g.val[v3]), VertexInterp(iso,g.p[v0],g.p[v3],g.val[v0],g.val[v3])) return [tri,Triangle( tri.p[0], VertexInterp(iso,g.p[v1],g.p[v2],g.val[v1],g.val[v2]), tri.p[1]) ] def t0906(g, iso, v0, v1, v2, v3): tri=Triangle( VertexInterp(iso,g.p[v0],g.p[v1],g.val[v0],g.val[v1]), VertexInterp(iso,g.p[v1],g.p[v3],g.val[v1],g.val[v3]), VertexInterp(iso,g.p[v2],g.p[v3],g.val[v2],g.val[v3])) return [tri, Triangle( tri.p[0], VertexInterp(iso,g.p[v0],g.p[v2],g.val[v0],g.val[v2]), tri.p[2]) ] def t0708(g, iso, v0, v1, v2, v3): return [Triangle( VertexInterp(iso,g.p[v3],g.p[v0],g.val[v3],g.val[v0]), VertexInterp(iso,g.p[v3],g.p[v2],g.val[v3],g.val[v2]), VertexInterp(iso,g.p[v3],g.p[v1],g.val[v3],g.val[v1])) ] trianglefs = {7:t0708,8:t0708,9:t0906,6:t0906,10:t0A05,5:t0A05,11:t0B04,4:t0B04,12:t0C03,3:t0C03,13:t0D02,2:t0D02,14:t0E01,1:t0E01,0:t000F,15:t000F} def PolygoniseTri(g, iso, v0, v1, v2, v3): triangles = [] # Determine which of the 16 cases we have given which vertices # are above or below the isosurface triindex = 0; if g.val[v0] < iso: triindex |= 1 if g.val[v1] < iso: triindex |= 2 if g.val[v2] < iso: triindex |= 4 if g.val[v3] < iso: triindex |= 8 return trianglefs[triindex](g, iso, v0, v1, v2, v3) def VertexInterp(isolevel,p1,p2,valp1,valp2): if abs(isolevel-valp1) < 0.00001 : return(p1); if abs(isolevel-valp2) < 0.00001 : return(p2); if abs(valp1-valp2) < 0.00001 : return(p1); mu = (isolevel - valp1) / (valp2 - valp1) return Vector(p1.x + mu * (p2.x - p1.x), p1.y + mu * (p2.y - p1.y), p1.z + mu * (p2.z - p1.z)) if __name__ == "__main__": main() # GRASSHOPPER PYTHON OUTPUTPOINTS = rhinoscriptsyntax.AddPoints(POINTS_CONTAINER)POINTS = rhinoscriptsyntax.CullDuplicatePoints(POINTS)…