Sweep 2 erratic result for multiple objects (with data structure)

Hello everyone,

I am 3D modeling a facade from 2D detail curves that get oriented in the appropriate position in space then sweeped along 2 rails (2 rails per window) to control orientation/alignement during the sweep.
Of course : despite having the same profile the windows have alsmost always a different position/orientation/area from each other;

I am trying to achieve 3 goals :

1- Final result should be nice geometry (Nurbs if possible despite the overload in comparaison to meshes) so I can bake and make 2D to create beautiful elevation drawings, with almost 00 cleaning process
2 - Final geometry should be closed breps for volume calculation
3 - The final data structure matter to provide data for LCA : I want my breps after the sweep to have a data structure as follow {A;B;C} where A and B come from the the data structure of my “2D profile” curves (see screenshot below); C may be the flatten data from the planes (refered as “Plane for infill profile”)

I actually succeded to do almost everything by myself with an almost perfect result ; however some parts of the script bug, therefore I consider the result erratic and not satisfying : like item 32 among few other, which geometry is broken (see below). :face_with_raised_eyebrow:

And I cannot quite figure out why.

I checked my tolerance : my file is in meters and to set the tolerance very low because I am dealing with mm-range profile (so my tolerance is 0.00001 (100th of a mm)); I even scaled eveything to work in mm with a 0.01 tolerance, to check if it was a unit/tolerance problem, it still does not work - So I do not know where the bugs come from.
Also about tolerance, if it works nicely for most profiles, then why do few of them bug ? So the bug may not come from tolerances ?

I suspect the “Flatten” in my “Orient” component might be what is wrong, but I cannot find the solution :frowning:

Here is the script with all the input internalised (as a reminder : I work in meters units with tolerance 0.00001)

Sweep2 erratic result facade windows.gh (35.8 KB)

Thanks in advance for your help.

I opened your script, all the windows look the same on my machine, when baked it creates 588 polysurfaces, the file size is 253Mb which is kind of absurd for just windows - I don’t have a bad pc (i7, GTX1650, 64Gb RAM) - but it’s seriously struggling to rotate the model - I dare not think how it would be behaving if there was the rest of the building in there - I really think you need to adjust your expectations or hire some machines from NASA to do your calcs… I’m not seeing any issue with the logic, no duplicate objects… it looks as good as it can…

Here is item 32 - looks all fine on this end

also, ouch man…

Good afternoon and thanks for looking this up !

I shall adress the last part of your answer first as it seems that you felt hurt by my phrasing, and it would be a shame as it was not my intention:
Indeed I could not have succeded in getting to the script provided in this thread without your help on the linked thread below, which was the previous step/first step at tackeling the problem ( https://discourse.mcneel.com/t/data-tree-structure-for-simultaneous-multiple-sweep1/169676/7 )
Now credits are given, I hope that you feel better -

Now back to technial stuff : Indeed this is non-sense to have such a heavy file when baked, I do agree. I guess I was just too concentrated on the script and expected resulte I did not even checked where it was leading me in terms of ressources-

I guess the clean solution is to have two data streams running in parallel :

1/ precise 2D profile sweeped as mesh for volume calculation
2/ simplified, square-ish 2D profiles swepts as nurbs for renders and drawings

Thank you again for your time and help