[OpenSCAD] Programming in Functional OpenSCAD
rcmpersiano at gmail.com
Tue Jan 30 16:54:01 EST 2018
2018-01-26 13:35 GMT-02:00 NateTG <nate-openscadforum at pedantic.org>:
> A specific question is whether my sense that adding or removing any data
> from a structure is always going to involve reconstructing the insert or
> remove path, and it seems like the answer to that is yes.
> Do you know if OpenSCAD has garbage collection or some other memory
> management scheme?
My greatest concerns on defining data structures in OpenSCAD language are
not the lacking of a garbage collection but the order of complexity. For
instance, the element insertion and removing from 2-3 trees have order
O(log n). However, an analysis of your implementation in OpenSCAD will show
that its order of complexity is O(n2) or worst due to the repeated structure
copies required by any change in it. And this is true for any data
So, I think there is no point in using complex data structures in OpenSCAD.
A simple ordered list is as good as any search tree.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Discuss