Morphing without SrfMorph component

Hey everybody,

I’m trying to do in python what does what the grasshopper SrfMorph component does.

actually i just want to deform a simple geometry (A) and fit it in a shape (B) that i already have.

did anyone try something like that and could maybe help me out understanding what SrfMorph does!

thanks

1 Like

Not your lucky day. I have quite a few Morph

Screen Shot 064

(related with all the 8 available Cl;asses - as listed above) examples … but in C# not P. Since you can’t translate the former to latter there’s a little problem around.

yup … Not my Lucky day

not true!

you can use them, but you need to be aware that you need to care about disposal by yourself. see this maelstrom example:

Morph_PandC.gh (10.0 KB)


i just want to fit the left box in the right one using python or grasshopper.

Well … Indeed … but I had slightly more complex stuff in mind.

Morphs_twisted_V1.gh (132.5 KB)

Hi Guys,

could you please translate the BoxMorphObject code in the link [http://developer.rhino3d.com/api/rhinoscript/object_methods/boxmorphobject.htm]
from C# to Python?

Grasshopper has box morph component. You need to make the right one into a twisted box. You can do that with the twisted box component or check out my plug-in Pufferfish which has a bunch of twisted box components. You can probably use the “RefTBox” reference twisted box component which was made to turn rhino made box like geometry into a twisted box.

I see nothing in there which couldn’t be translated into Iron-Python, you just need to know how to use Rhinocommon, which is a bit difficult to deal with if you never worked with it in c#. But in theory there is hardly any limitation. Only limitation I know of: overloading custom preview like in c# is not doable, but this is due to the fact that the methods involved are part of the c# or vb.net scriptinstance. Iron-Python per se is very weird, especially if you only know Python but no C-style language.

1 Like

Yes, that’s why GhPython for V6 has the “Grasshopper SDK mode”, which allows to use the exact Grasshopper class (GH_Component) which is used internally by Grasshopper and therefore any overloading is possible.

Note that Grasshopper Scripts in C#/Vb.Net do NOT inherit from GH_Component. You need to use Visual Studio to inherit from them.

1 Like