Skip to content

aklef/OpenJSCAD-Tree-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

OpenJSCAD Tree Demo

I saw this beautiful tree somewhere on the internet and got immediately inspired...

"Fractal tree"

"Fractal tree" (tree.c, 47 lines of C code.) (source)

... to make the same tree in OpenJSCAD! (spoiler: it partially works)

I ported it, then generated the following portion of a tree before node.js ate up all my RAM and crashed...

"Recursive tree attempt"

"Recursive tree with a Depth of 5" (RecursiveTree.jscad, 49 lines of JavaScript.) (source)

Then I made an iterative version using array-based recursion that uses MUCH less RAM ...

Here's a web-generated tree with a Depth of 4 that uses only a few hundred megs of memory:

"Iterative tree with a Depth of 4"

"Iterative tree with a Depth of 4" (tree.jscad, 44 lines of JavaScript.) (source)

And another similar tree, loaded into Cura.

"Iterative tree with a Depth of 4"

"Iterative tree with a Depth of 4" (tree.jscad, 44 lines of JavaScript.) (source)

I attempted to generate the tree with a Depth of 5, as in the original. However, it failed twice, each time after about five hours computing and using all the (gig and a half) of memory I'd given node. (treeDepth5.jscad, also 44 lines of JavaScript but won't terminate properly, for me. YMMV)

Releases

No releases published

Packages

No packages published