Hey, guys! I have problems with the sweep2 command in python script. Pic 1 shows my idea to generate the model with the sweep2 and the command I used is “rs.AddSweep2([arc_guide1, guideline1], shapes, False)”.
OK, I see the result is different, will need to look at how the AddSweep2 function in rhinoscriptsyntax is set up. You might need to go through RhinoCommon in this case.
Just as a test here, using
faces=rs.AddLoftSrf(shapes)
instead of AddSweep2() seems to make a nice clean surface - especially since your curves are all parametrically generated and thus have a similar structure.
Wow! That’s pretty cool! One reason I didn’t choose loft was that at the end of the shape, the face edges might not be vertical to the reference plane. But now I think just add the number of the planes may fix this problem. Thanks a lot, anyway~
I’ve got a similar problem here with Rhino 7 and the python script rs.AddSweep2. I suspect there is a bug somewhere in the pipeline, since
A) This works with Rhino 5 (not 6)
B) This also works with Rhino 7 in ‘manual mode’, in the main UI using the Sweep2 command.
Another part to the question: Your suggestion effectively corrects the test case I sent, by not the original issue it come from. It seems that writing those curve on layers has modified them. After having read them, their domain has changed. Is it something you have heard about?
If your adding curves to a Rhino document, and then later querying them and finding the domains have changed, then please provide me a code sample so I can repeat what you are seeing.
After several tests, the problem is clearer to me: I now see no Rhino bug; all domains remain the same.
The only thing is: rs.AddSweep2 is harder to use than the manual version in the UI, since the curve seams must be aligned, direction matched, and cross-sections must be ordered accordingly.
My first bug-correction trial really worked by accident: writing the cross_sections on a layer, I (without knowing) reversed the order, making the whole thing work.
My bug was the following; after ordering cross-sections, I set the curveSeams precisely at the beginning (and end) of the first cross-section, creating a kind of limit-condition (not sure about the correct formulation here, in english!); while it would be much safer to set them mid-way between the first and last cross-sections.