[OpenSCAD] Programming in Functional OpenSCAD

Ronaldo Persiano 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 re​moving 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
structure.

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...
URL: <http://lists.openscad.org/pipermail/discuss_lists.openscad.org/attachments/20180130/90ba5351/attachment-0002.html>


More information about the Discuss mailing list