Dear forum, I wish you all a pleasant weekend. I’m working on this project on which I am at the last stage of creating a brep at the end of all the calculations and I can’t seem to get what I want from a sweep2.
A manual sweep 2 operation manually made within the document works like a charm but the sweep2 operation in rhinocommon Rhino.Geometry.Brep.CreateFromSweep() doesn’t give me the same result. What am I missing here? Any help is greatly appriciated.
Haven’t looked yet at R8 or the Python but R7 Swp2 component looks pretty good after inverting the ‘H’ (Same Height) input. (from default False to True)
Does it continue to give you good results when you fiddle with the curves? There were times when I got a good result on certain settings but when I changed the curves I either lose the ‘Maintain Height’ effect or the corners come not connected to each other (sticking out of where they are supposed to be).
Another thing is that I am trying to write everything in Rhinocommon on this projecct. I am not using any Grasshopper components.
That’s your choice, I am not a Python wizard and won’t try to support your decision.
I haven’t kept up with R8 but think I remember that Python is different in R8? So I tried looking for an R8 Python component (‘Math | Script’ in GH) but see only “Script”, so I chose that and saw that Python was the default… Then I copy/pasted your code from the “old” Python component to the script component and saw it installing Python.
Finally, when it finished, I tried the green triangle to “Run active script” and see this under the ‘Problems’ tab:
I don’t use the new Script component in the GH for R8 because it is not backwards compatible. I rather imported GHPython component from R7 into the GH for R8.
I wanted to do this in Rhinocommon with Python to familiarize myself with the Rhinocommon library and I think Rhinocommon gives you more flexibility and it works more reliable than the GH components because it is closer to the core. I would recommend you to do it as well.
I tried using Rhino.Geometry.Brep.CreateFromSweepSegmented(). This seems to give the best result but it is a shame that you can only supply one rail. A 2 rail version of this would be amazing to have.
Rhino.Geometry.Brep.CreateFromSweepInParts() doesn’t seem to work stable either, but it is better than the CreateFromSweep().
CreateFromSweep method uses one rail and two rails inputs. You need to scroll down to see other options.
CreateFromSweepSegmented() uses only one unfortunately. Does anyone who is familiar with the Rhinocommon know a two rail version of this or how to get around it?