Grasshopper

algorithmic modeling for Rhino

I was trying to figure out how to trace an image directly by grasshopper.

It is really time consuming if I manually trace a complicated image using the bitmap method.

If possible can anyone post the grasshopper file for tracing image.It doesn't need to be very accurate.

There had been a discussion on it before but it did not give me the output as I saw.There might be some error in the  file I created.

Could anyone post the working grasshopper file for it?

Thanks in advance..

Views: 26308

Attachments:

Replies to This Discussion

Can I use this output in rhino and extrude it?

PlanarSrf then ExtrudeSrf:

Is is also possible to emboss. Here a script which output mesh and surface. 

Quite long : 1 min for 10 000 points (100 x 100), could surely by optimized.

The best must be Rhino Emboss (which use 1 million = 1000x1000 points). 

Attachments:

200x200 points (201x201 excactly)

Cool!

That's damn good for a Grasshopper script. Hmm.... There are lots of ways to do that and I was once obsessed with this to replace ArtCAM. Kangaroo will inflate meshes, but I haven't seem to have tested it on a big array of them.

http://www.grasshopper3d.com/forum/topics/puffing-of-flat-outlines-...

I don't quite understand how this script works. It rises to the equivalent of a medial axis:

Have you posted this in another thread before?

Python may be able to parallel process this strategy.

It just finds the range of the closest points of each 2D bounding box mesh vertex to that mesh's border curves and raise the point by that amount?! I guess that's simple enough.

How does it know it's inside a loop at all, as well as not in a hole? The background test mesh isn't affected. Why not? The trick is hiding in there. I don't see it yet.

Ah, we are starting with Rhino created flat surfaces that already have holes fully defined as holes, and your script uses that surface in a second distance test. And you are testing that distance before distorting anything so it must be near zero for bounding box mesh points or they are outside the original surfaces, and *that's* how you are testing for background or not.

Any idea how to extract a medial axis from this, the sharp folds in the mountains?

Related to the medial axis is a novel method of "Puffball inflation" that places spheres along the medial axis and Boolean unions them.

http://persci.mit.edu/pub_pdfs/twarog-sap-2012.pdf

http://www.nathanieltwarog.com/puffball.html

However, it looks like it's pretty bulgy.

@Nick
You understood how it works, distance from surface says if it is on a surface or not. The other trick is to graph points, to tranform a list in tree. So it acts like a for loop. So for each point on the array the closest distance for each shape is calculated ( long to calculate). The range component is seeking the extremes so it is possible to extract the minimum. I didn't use the minimum component because it is non standard GH as far as I know.
I never published that as I did it yesterday night!

in 1967 the medial axis was found via photographic defocusing: 

http://pageperso.lif.univ-mrs.fr/~edouard.thiel/rech/1967-blum.pdf

Kangaroo embossing by air pressure inflation is actually pretty fast, if you use a custom meshing setting to make a uniform mesh from the surfaces my script outputs, the same as Rhino can make from curves/holes. However, the Kangaroo script itself is prone to locking up so it seems like it might take forever. You can even double click stop the timer from the Windows task bar, I hadn't noticed that before:

You have to use that or right click disable the timer since even with the Reset toggle button input set to True the timer itself locks up the script a bit when you are changing things around.

Just setting the min/max numbers both to a desired mesh size gives a uniform mesh:

Oh weird, it's about if the timer is right click set to so small an interval that it gets ahead of Kangaroo! When you see how long each cycle is taking with the Display > Canvas Widgets > Profiler you just set the timer for above that and the interface comes back into being responsive. It only takes a few Kangaroo cycles to do the inflation, so a full second timer interval is even workable.

A finer mesh:

It's funny running it so slow since it overinflates at first, bulging out, before it equilibrates.

You have control over inflation pressure and mesh stiffness, for a variety of effects.

This is a good system once I realized the timer needed to be mellowed out.

What made it work was the fast custom meshing since a normal mesh is awful and MeshMachine wouldn't work with sharp corner holes at all, breaking out of the boundary even if I fixed curves or vertices or did the equivalent with NURBS surfaces instead of a starting mesh.

There is an initiation time for Kangaroo that doesn't show up on its Profiler time that happens even with the timer off.

There are some fine areas that can't inflate with a reasonable mesh setting:

Worth playing with but no match for ArtCAM since it suffers odd delays in between working fast. If I could get better 2D meshes, that were more adaptive it would be better, but MeshMachine is one of the only re-meshers I know and it's broken for even mildly sharp hole features.

Ah, how about a crude mesh that is then subdivided, guaranteeing inner vertices everywhere? Sort of works, but is still too dense. Way too dense to even do anything. The subdivision triangulates the quads, vastly increasing the mesh wire density. Better just to make a finer initial mesh with plenty of quads.

Attachments:

Can a good inflatable mesh is made by the new improved ZBrush ZRemesher command?:

Inflating this with Kangaroo is simply too slow. It took me too fine of remeshing to get interior vertices in the very skinny areas. Forced subdivision of a crude quad mesh again just ups the density everywhere into slowness or just blowing Kangaroo up so it gives a "object reference" error. It almost works, but after an hour you simply still don't have the result.

Free Autodesk Meshmixer remeshing should give an adaptive triangle mesh, but just won't do it right. Some islands retain much higher remeshing than others, based on existing mesh edges being crude that lock in big triangles. O.K. let's feed it a finer starting mesh!

It still won't quite cooperate since now long linear sides lock in many tiny triangles, for buggy reasons.

Thus there is much to recommend Laurent's use of a single bounding box mesh that is inflated above a background.

Ah, well that's just it then, right, use Kangaroo to inflate while holding the background points fixed as anchors. That just might be faster than his script if Kangaroo can handle it.

RSS

About

Translate

Search

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service