How to call rhino6 devloft command in python?

Hello,
i am currently developing a method to create complex geometries out of a developable surface.

In that purpose, I am trying to test some of my resulting curves geometries inside a python grasshopper for more efficiency.
Since that command doesn’t not exist in rhinoscript syntax i was wondering if there was a possibility to parametrize it anyway in a python script ?

Thanks

You could call the Brep.CreateFromLoft method directly with the developable LoftType Enumeration.

Thank you Anders, i already checked those method but i was hopping to call the developable function of rhino 6 which seems to contain an efficient algorythm to generate the rulling curves between two curves. THat’s why i would like to call that function and not the classical loft command.

Ah, sorry, missed the Rhino 6 part. It looks like this class is new in RhinoCommon 6, perhaps it is what is being implemented under the hood in the devloft command:

https://developer.rhino3d.com/api/RhinoCommon/html/T_Rhino_Geometry_DevelopableSrf.htm

Edit: It looks like things have changed more fundamentally, with the the developable LoftType Enumeration now being marked as obsolete:

And there being three different Brep.CreateFromLoft... methods:

image

Perhaps one of the devs can chime in here.

Thanks for the api link, i’ll try this out but i am not so comfortable with c#, i would really apprecite if someone was able to write the scheme to call that function !!

Thanks a lot anders !

@DavidRutten Hello David, any idea on how to do that?

You should be able to implement it in GHPython. Afraid I don’t have have Rhino 6 installed, but perhaps @stevebaer or @piac can lend a hand.

@thomas.sicouri - I don’t really understand what the question is here -
In Rhino6, LoftType Developable has been obsoleted.
DevLoft is a different thing, not related to Loft except that it has Loft as part of the command name

@lowell i don’t know how to call the devloft command into python since i don’t find it into the rhinoscript library.
I would like to be able to call the devloft and integrate it into my grasshopper script to mesure the gaussian curvature for different iteration of my model.
I am very new to python so may be that’s an really easy task…

@thomas.sicouri - Do you mean that you want a function to call rather than using the DevLoft command?
There isn’t such a function, but there probably could be one if I can understand what you want.
Does that sound like what you’re looking for?

The what the command works is either fully automatic or interactive depending on whether you use Dev:of or -DevLoft. In the scripting version (-DevLoft) you adjust parameters until you like what you see.

One thing that’s important to understand about DevLoft in general is that it can make surfaces that are not at all developable and it’s necessary for the user to validate if you get what you wanted. Of course, it has to be that way since some sets of edge curves just don’t make a developable surface.

@lowell Yes exactly, i want to be able to use the function within grasshopper to check the result on many iteration of my structure . to be simple i want to be able to call the devloft function within grasshopper and i don’t know how to do it.

thanks for your help !

i know that the result might not be developable that’s why i need to call it in grasshopper and check the gaussian curvature of my surface regarding the input curves.
i am really interest to know what the theory behind the function

@thomas.sicouri -
DevLoft comes up with some rulings between two rail curves somehow and tries to move those rulings around to get a configuration that will make a developable surface.
There are really 2 things you can adjust on DevLoft -
the “Density”, which means how many ruling lines are added per curve span of the rail curves,
and “Fixed Rulings” which means rulings at certain user specified locations.

Density is a number. Pretty simple.
Fixed rulings are pairs of endpoint locations that would probably be relative parameters on the rails. They can’t cross each other and there has to be some distance between them, so some error checking is necessary.

If you had a function to call, I assume you would you want to specify the density. Would you also want to specify the locations of fixed rulings?

@lowell thanks for your help lowell ! Yes i think that’s it, my goal might be for example to use an optimisation solver to test different solutions of the input input rails, but alsmo the position and ddensity of the ruling and try to minimize the mean gaussian curvature of the surface or the area difference after unrolling and find the best options.

There’s a Future bug report for it now: https://mcneel.myjetbrains.com/youtrack/issue/RH-48289

Hi @thomas.sicouri,

I’m no GH wizard. But the attached GH solution will work then the SR containing the new functions is available.

– Dale

TestDevelopableLoft.gh (6.7 KB)

1 Like

Thanks a lot Dale, What do you mean by the SR containing the function. The next update of rhino 6 ?

Yes, most likely SR10.

– Dale