algorithmic modeling for Rhino
Hi all,
I am a python user(beginner) trying to understand meshes and meshing algorithms like Marching cubes, Ball Pivot and Marching tetrahedra. I saw basic example provided with rhinoscriptsyntax, It was hard to imagine how hard it was to make mesh faces assigned from points. One way i could think of not Reinventing the wheel was to call mesh from points commands in python . I needs some direction to head towards creating meshes in rhino
I was suggested Libraries but i not smart enough to figure out how to or where to use them exactly.
Tags:
Update: Now the mesh is joined into one within Python, and I also added a toggle for both resolution and also quite (8X) slower normals calculation that gives a nice preview instead of a checkerboard:
# GRASSHOPPER PYTHON OUTPUT
MESH = Rhino.Geometry.Mesh()
for m in MESH_FACES_CONTAINER:
MESH.Append(m)
if SLOWLY_FIX_NORMALS == True:
MESH.Normals.ComputeNormals() # Gives nice mesh preview but makes the script take 8X longer.
woah...!!! so did u make points sortable ?? i.e in order of 3 so that mesh faces can be created ..and does this work on random point cloud ???
Looking again, despite the somewhat odd coding format used by the original coder (defining a throwaway function using the obscure Python lambda command, inside the def line of another function, then later calling an allied function using no arguments in a way I'm not yet familiar with), no, there is no internal point cloud being generated to sample the mathematical function, only a cubical box array of space sampling points, which also looks like much more work is being done than needed for a slightly offset bounding box, so fixing that may make it much faster:
Marching cubes is supposed to handle surfacing a point cloud, but here I don't know yet how to define that as the necessary implicit equation of f(x,y,z) = 0.
The line needed to output these points is this put in where i,j,k are being used in a loop:
POINTS.append( Rhino.Geometry.Point3d (i,j,k) )
I have a point clouds surfacer working here, though it offsets outwards a bit too:
http://www.grasshopper3d.com/forum/topics/bulge-free-metaballs-and-...
It's faster now that I stopped being dumb about first collecting faces then separately feeding them into a final mesh object, so now I just build the mesh. I removed the optional normal fixing, so it just does that now.
Keyshot renderer fun:
Some info on general point cloud "skinning" geometry theory, which actually uses a Python script for a Blender software plugin:
http://hanspg.web.fc2.com/Pages/csv_scripts/algo_t15.html
Yet here is a video that indicates that triangulating a point cloud as vertices is silly, but there's a way to do it uniformly, independent of the local density of points:
Publication:
We have to realize that our subconscious brains are *very* powerful, almost down to having quantum computer advantage based on molecules forming billion year trained neural networks being taken full advantage of that makes some of this stuff seem so "easy" but our conscious mathematical ability is quite limited in comparison, especially having to use linear code. It seems graphics card won't even do this. They rely on low poly models plus surface mapping of details based on 2D images.
More background of surfacing point clouds, including an IBM patent:
http://doc.cgal.org/latest/Surface_reconstruction_points_3/
http://stackoverflow.com/questions/838761/robust-algorithm-for-surf...
More Keyshot renderer fun, with refraction too, instead of just reflection:
The IBM "Ball Pivoting" point cloud surfacing algorithm, which sound more smart than "marching cubes":
https://www.google.com/patents/US6968299?dq=6,968,299&hl=en&...
Alas, "...not suitable for pointclouds with varying point density."
And a 132 page Ph.D. thesis (mine was 500 pages but lots of NMR spectra were included) called "Surface reconstruction from unorganized points":
http://research.microsoft.com/en-us/um/people/hoppe/proj/thesis/
But screw it: "One perceived weakness of this work is that it requires oriented normals at the input points."
That's not perceived weakness; it's death.
Great info here . Thanks Nik .
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by