Flow along space?

I want to make a function that deforms geometry from one space into a warped space. The space is defined by points in two 3d matrices. One as the base space which contains the geometry, and one as the goal space to morph into.

I know this can be done by subdividing the geometry, but ideally, the output should be smooth nurbs surfaces like the input.

From my limited understanding of nurbs mathematics, it seems that a 3d matrix of points could be used to define a “nurbs space” just like a 2d matrix of points can define a nurbs surface.

I want to create such a nurbs space and use it to deform geometry similarly to rhino’s flow along surface, but don’t know quite where to begin. Could anyone with more knowledge about these processes give some advice? I am especially wondering about the following:

Is the assumption about the 3d nurbs space correct, and are there functions in rhino that can be repurposed for this?
Is there documentation for how flow along surface works, and could the methods be repurposed for such a space?
Are there pre-made components already doing something like this?

You are probably talking about something like _Cage and _CageEdit functions on Rhino.
Give it a try: use _Cage on a geometry, then run _CageEdit to edit it.


A quick search: seems that up to 2019 it is not directly accessible from rhinocommon c#

1 Like

“Map to Surface” should allow you to do this if you use “Surface from Points” on your input points. Deconstruct your surfaces into points or curves, do the surface mapping, then reconstruct them.

Yes, cage edit is what I have been looking for. But it looks like a hassle to make it work in grasshopper, so in search of quick solutions, I stumbled over this, which is not exactly space deformation, but should work in my case.

My mesh has very many vertices, though. About 3000-4000. And the affected geometry is a brep. So until now nothing has happened after I set up the definition. How long should I leave it running before giving up @DanielPiker ?

There is also a spatial deform component in grasshopper that works by moving a set of reference points that affect geometry with a sort of force with a falloff function. Will try this soon.

Did you manage to get a result with a simplified example?

And if it doesn’t work out… post your Grasshopper definition maybe and someone can take a look?

1 Like

kbsforshare.gh (3.7 KB)
kbsforshare.3dm (1.5 MB)
Yes, it works with a siplified example. The file includes both a simplified example and the one that does not work(or does not resolve in over an hour). Both target meshes are just the reference meshes with moved vertices.

I don’t see a benefit of doing this with the Mesh Cage Morph component and I think you could use the Sporph component.

The surface in the definition below isn’t exactly yours but I think you’ll get the point.

kbsforshare_sporph.gh (69.8 KB)

1 Like

It does not make much of a difference in this example, but it is important that the deformation is not just a projection of the surface once you get further out. The reason I have used the mesh is because it can be deformed with a simulation to achieve a realistic shape.

Sorry for overlooking your post. Are you talking about a deformation that will map the objects to a surface or projection of it like sporph, or is it something I am misunderstanding?

Sporph looks like a good way to do this. I was describing a more manual way using the UV coordinates of surfaces - like this:
mapbetweensrfs.gh (8.6 KB)

Maybe one important little detail you could improve… Make sure the mesh used for the morphing is slightly larger than the brep within and that there are no coincident points / faces.

I updated my example file from above.

Mesh cage morphing the brep takes a moment and I disabled the component. The result looks ok but Sporph creates a smoother result…

kbsforshare_sporph_meshcagemorph.gh (80.8 KB)

Thanks, from testing with your file it seems that increase in mesh size slows this down by quite a bit. Having the reference mesh intersect with the geometry to be deformed has little effect on runtime if the geometry is a mesh, but a huge effect if it is a brep.

The meshes I sent in my rhino file can deform the tri-remeshed version of the brep in about 30 seconds, and the result is almost acceptable, with some faults here and there. I am guessing it is related to the reference mesh intersecting the mesh to be deformed, but am not sure. Anyway, the mesh is too big, and it makes getting the result as a brep too slow. It could maybe be saved by making the mesh encapsulate the brep perfectly, but in some places, the accuracy would benefit from them being coincident, so it is not optimal.

Cage edit in rhino does this kind of deformation very easily and quickly, even with very many points. But from what I could find out, most of the controls needed to do a cage deform are not accessible with rhinocommon. I will try to fix my mesh generator, but it is looking more and like accessing cage edit somehow might be the best solution.

1 Like