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)…
edit 29/04/14 - Here is a new collection of more than 80 example files, organized by category:
KangarooExamples.zip
This zip is the most up to date collection of examples at the moment, and collects t
stand completely (i just don't get the math part...).The code can be found here: http://digitalsubstance.wordpress.com/subcode/
So i decided to make my own definition: a cube deformed by 5 attractors and i was wondering if someone can help me solve the meshing at the end of the definition because when i bake it, it gives me an open mesh and i don't understand why ? Waterfall meshes are not suitable for 3d printing... I don't think i've used the clean, weld, and unify faces in the good order ? Maybe there is a problem with the surfaces ?
Secondly i'm not very proud of the result of my cube because it's so deformed that it is a not a cube anymore... so i was wondering if a square grid of points can be deformed by an attractor but still keeping the straight boundary of the grid ?
I had an idea to make that: i make my points, create the vectors between the grid and the attractor points, calculate the distance between the grid points and the attractors: it gives me a list of distances that i remap to control the strengh of my attractors. On the other side i calculate the distance between the boundary of the grid and the grid points and it gives me a second list of numbers. So i wanna average the two list of numbers in such a way that the closest it is to the attractor it takes the distance from the first list and the further it is from the attractor (so the closest it is from the boundary) it takes the distance from the second list ?? I'm sorry for my bad english but even in french it's little bit hard for me to explain it ;). So what can i do to have a grid attracted by a point without moving the boundary points ??
And please don't tell me to cull the boundary points first, to deform the grid and to rebuild the grid after... it gives an ugly cube face at the end, even with a lot of polishing with weaverbird...
If someone has another idea to achieve that please tell me ;)
The first definition "CleanCubeMeshingHelp"is a little bit heavy so watch out if you have a small laptop (any ideas to make it work faster are welcomed !!)
The second one is the one with the two list of numbers.
Also a last questions: what is and when to use the "blur number", "interpolate data" and Weighted Average" under math utilities ??
Thank you in advance for you answers and i apologize for my lack of vocubulary.…
we're actually using PET sheets for our flexures. We try to design so that the flexures don't go through more than +/- 30 degrees of deflection. If the angular deflection is kept small, the lifetime can definitely be on the order of 1000000 cycles.
As for the design process (item 2), ideally the designer would be able to use a simple 3D CAD tool to design a model of a robot, and the geometry would be represented by dimensioning the individual parts in the model. Maybe there should be some parametric primitive kinematic building blocks like four bar linkages, box frames, etc. that a user could build up a robot from. But, the key functionality the tool needs to provide is for the designer to be able to visualize how the robot will move when it's fabricated. This could mean observing (or plotting) the motion of a leg, a wing, or a series of body segments. Ideally, then, the tool would generate an unfolding of the design. How this would work is still very vague - maybe the user would assist in the unfolding, maybe there would be an optimization routine that computes optimal unfoldings based on criteria like minimal waste, or fewest pieces (I would *not* constrain the problem to construction from a single monolithic piece as in origami). The biggest problem we have right now, is that our design process is totally divorced from fabrication. Even if we went through the trouble of extruding individual thin plates in Solidworks and creating an assembly for visualizing the kinematics of a mechanism, that particular representation doesn't transfer easily to the fabrication process because it's essentially monolithic.
Item 3: The 2D drawing is simple a drawing done manually in Solidworks. There are different layers for flexure cuts, outline cuts, and potentially any cuts to be made in the plastic flexure layer. Depending on the robot, there may be many separate pieces for different parts and linkages in a single robot. For example, the drawing for a robot containing a fourbar linkage may have the linkage laid out as a physically separate piece consisting of five rigid links connected by four flexure hinges. During assembly, the designer would then fold up that linkage and insert it into the robot wherever it's supposed to go. If you're curious you can see some sample 2D drawings for older designs here: http://robotics.eecs.berkeley.edu/~ronf/Prototype/ under the "Example Structures" heading.
I noticed Kangaroo seems to be a popular choice for physical simulations. I don't really even need to include forces like bending resistance - I'm happy to allow the design tool to approximate flexures as pin joint-type hinges. Once the design is unfolded, the details of how to cut the flexures could be worked out in a post-processing step. I wouldn't expect the tool to be able to realistically simulate the bending of the hinges.
I'm going to have to dig a lot deeper into understanding Grasshopper and Kangaroo. I only just got started with Grasshopper today by following the folding plate tutorial on wa11ace.com.au today. …
serveral questions:the first thing is in c++ i have to implement more methods than in my c# test project.
they are:
int MyGhComponent::MasterParameterIndex::get(){ return 0;}void MyGhComponent::MasterParameterIndex::set(int index){ }bool MyGhComponent::IsValidMasterParameterIndex::get(){ return 1;}
i found no hint for the implementation of that interfaces. could someone tell me that is correct ?OK, it works, but is it well writen ? What is the MasterParameterIndex?
the second "bigger" problem is, i want to have an output of an pointlist.X y Z 1.2 1.3 1.12.1 5.2 9.2...
my first approch was to use a
void MyGhComponent::RegisterOutputParams(GH_Component::GH_OutputParamManager^ pManager){pManager->Register_PointParam("Coordinate", "XYZ", "Node-Coordinate");}
and
void MyGhComponent::SolveInstance(IGH_DataAccess^ DA){Collections::Generic::List<GH_IO::Types::GH_Point3D>^ pnt = gcnew Collections::Generic::List<GH_IO::Types::GH_Point3D>(); for (int i = 0; i < 10; i++) { GH_IO::Types::GH_Point3D^ point = gcnew GH_IO::Types::GH_Point3D(i, i, i); pnt->Add(i); } DA->SetDataList(3, pnt);}
but this exampel doesn't work...i wirte a small workaround and use the following
pManager->Register_DoubleParam("X-Koordinate", "X", "X"); pManager->Register_DoubleParam("Y-Koordinate", "Y", "Y"); pManager->Register_DoubleParam("Z-Koordinate", "Z", "Z"); Collections::Generic::List<double>^ pntx= gcnew Collections::Generic::List<double>(); Collections::Generic::List<double>^ pnty= gcnew Collections::Generic::List<double>(); Collections::Generic::List<double>^ pntz= gcnew Collections::Generic::List<double>(); ... add .. ect.
this workaround do the job, but i want a better soulution. and i know somewhere out there sould be a better solution. i want to use 3D Points directly in GH without list conversation.
so somebody a familiar with c++ / cli ? and could give me some tipps or a soulution ?
the first thing is: what is the right RegisterOutputParams ?
and witch data type is the right ? Point3d doesn't work. so i try GH_IO::Types::GH_Point3D and Rhino::Geometry::Point3d ...
br Friedrich…
rking with. I am architecture student as well so please bear with me :).
I am currently working on a high rise building. All elements (that is core, slabs and colums) will be analyzed as made of reinforced concrete. I do not want to optimize reinforcement distribution, I will create a material that would be close to reinforced concretes properties.
I think i understand how to create and assemble models made of beams (COLUMNS in my model) in Karamba, but I get totally lost when it comes to combining them with shells (CORE, SLABS in my model).
I would like to optimize use of material (volume or mass) with:
A) slab deflection limited to 3cm (GRAVITY + LIFE LOAD)
B) top of the building cannot "lean out" (horizontal defletction from WIND LOAD) more than 1/500 of its height
I post my questions below:
1) I would like to apply wind load on bigger exterior walls of the building. What would the best method bo to do that? I thought about applying load on the level of slabs as uniform line load (marked blue in model). Uniform line load needs to be supplied with beam ID. How can i simulate that? would i have to add beams on slabs edges for that to work correctly? If yes - how would i connect them with slab, so that all elements are transfering the loads cooperatively. Also in that case - how to convert wind pressure (kN/m^2 to kN/m)
2) I know that living load I want to apply is 4kn/m2. How to apply such load to mesh so that results are realiable? it is hard to turn it to point load, as mesh faces (and points where loads are applied) would have to be 1x1m if I understand correctly.
3) How would you place supports under core part?
4)I do not want to vary Slabs/Cores section - I would like to find the minimal value so that mentioned conditions are met. For example - 25cm slabs, 40x40 columns, 50cm core walls. I wouldn't like slab and core to have different heights in different places. Is it possible to use "Optimize Cross Section" Component or should i use Galapagos for that?
Sorry for such long post,
Thank you for your time and help…
Added by Wujo to Karamba3D at 1:11pm on September 27, 2017
) Course Fee: Professional EUR 825,- (+VAT), Student EUR 415,- (+VAT)
Led by plug-in developer and structural engineer Clemens Preisinger, along with Zeynep Aksoz and Matthew Tam from the expert Karamba3D team, this three-day workshop will focus on methods of setting up structural systems in the parametric environment of Grasshopper. The participants will be guided through the basics of analyzing and interpreting structural models, to optimization processes, and how to integrate Karamba3D into C# scripts.
This workshop is aimed towards beginner to intermediate users of Karamba3D. However, advanced users are also encouraged to apply. It is open to both professional and academic users. For beginner users of Rhino and Grasshopper, there will be an optional introductory course one day before the Karamba3D course.
Karamba3D 1is a parametric structural engineering tool which provides accurate analysis of spatial trusses, frames, and shells. Karamba3D is fully embedded in the parametric design environment of Grasshopper, a plug-in for the 3D modeling tool Rhinoceros. This makes it easy to combine parameterized geometric models, finite element calculations, and optimization algorithms like Galapagos.
Course Outline
Introduction and presentation of project examples
Optimization of cross sections of line-based and surface-based elements
Geometric optimization
Topological optimization
Structural performance informed form finding
Understanding analysis algorithms embedded in Karamba3D and visualizing results
Complex workflow processes in Rhino, Grasshopper, and Karamba3D
Places are limited to a maximum of 10 participants with limited educational places. A minimum of 4 participants is required for the workshop to take place. The workshop will be canceled if this quota is not filled by October 28. The workshop will be taught in English.
Course Requirements
Basic Rhino and Grasshopper knowledge is recommended. An introductory course is offered.
No knowledge of Karamba3D is needed. Participants should bring their own laptops with Grasshopper and either Rhino 5 or Rhino 6 installed. You can download a 90-day trial version of Rhino. Karamba3D ½ year licenses for non-commercial use will be provided to all participants.
Please register here……
Added by Matthew Tam at 6:38am on September 13, 2019
en la práctica de nuevos métodos de diseño y fabricación utilizando herramientas digitales. Estos procedimientos emergentes están cambiando radicalmente la manera en que nos aproximamos al proceso de diseño en términos de concepción y producción. Los participantes serán introducidos en el uso de softwares de modelado 2d y 3d para la generación de geometrías que serán posteriormente mecanizadas in situ en una máquina de control numérico CNC de 3 ejes.
¡AL FINAL DEL CURSO TE LLEVAS TU LÁMPARA A CASA!
Profesores: Equipo MEDIODESIGN* + TOOLINGROUP*
*Official Rhino Trainners. Acreditación otorgada por McNeel, desarrolladores del software Rhinoceros.
Lugar: Mediodesign. Pallars 85-91 5-2 BCN
Duración: 16 / 20 horas
Fecha: sábado 9 / domingo 10 julio de 2011
Horario: de 10h a 14h / de 16h a 20h
Plazas: 20 participantes
REQUISITOS
< Dirigido a estudiantes y profesionales de la arquitectura, diseño y profesiones afines.
< Ordenador portátil.
< Softwares instalados. En el momento de la inscripción, los participantes recibirán las instrucciones para la descarga e instalación de versiones gratuitas (trials) de los softwares.
CONTENIDOS
< Introducción al diseño avanzado y la fabricación digital.
< Entorno Rhinoceros y sus plug-ins.
< Herramientas y estrategias de trabajo CNC.
< Materiales y sus características.
< Planteamiento del ejercicio: diseño de una luminaria
< Desarrollo del archivo de RhinoCam para el mecanizado CNC.
< Mecanizado y post-producción.
< Entrega de propuestas: Presentación en formato digital del proceso de diseño y fabricación (pdf, powerpoint, etc…) y del prototipo de luminaria realizado.
INSCRIPCIONES
Precio: 199 € Materiales incluidos.
Forma de pago: mediante transferencia bancaria.
Límite fecha de inscripción: lunes 4 de julio 2011
Se otorgará certificado de asistencia. …