r/OpenPythonSCAD • u/WillAdams • Nov 10 '24
append vs. union?
Just noticed append being used in the table example --- is there a reason to use it rather than union? Is there a meaningful difference?
3
Upvotes
View all comments
Show parent comment
2
u/gadget3D Nov 11 '24
If you get your cut objects sequentially and always ran an union if you have 2 to get back one result only,
you would end up having N-1 union operations, all of them stacked together, which is not only quite expensive in terms of memory, but also quite inperformant.
Much better would actually be to collect all of the items and a big list 1st.
The you could either union one of them at once , or you could union always 2 neighbor leaves together to end up with with N/2 new leafs and repeat that step until you have only one result. This approach would be best for accuracy where small dimensions need to be accurate next to big dimensions.
Hope that helps.
did not really get last question.