In the last blog ( https://sozvyezdami.wordpress.com/2013/04/06/straight-skeleton-into-svg/ ) I pasted some code for turning a geometric shape known as a ” CGAL Straight Skeleton ” into another format known as “svg” – the latter of which is useful for internet browsers and other graphics types of programs.
Now, the goal there was to work towards ‘surface subdivision’ for the ‘smoothing’ of blocky shapes in the OpenSCAD drawing program. I am not there yet. But where am i?
That was the SVG. The Three D is here, using “Mr Doob’s” three.js library:
if you look very close (or click on the image to zoom it in) you can see that this polygon is not flat in the xy, yz, or xz plane. It is actually ’tilted’. Thus. 3d.
polygon body coordinates:
0 0 0 0 10 0 10 10 10 10 0 10
2 2 2 2 5 2 8 5 8 8 2 8
The code is too much to post here. It’s on github though:
For quick starting on Ubuntu Linux:
git clone https://github.com/donbright/skeleton_polygon3d sudo apt-get install build-essential libcgal-dev libboost-dev cd skeleton_polygon3d cmake . && make && ./skeleton_polygon3d firefox skeleton_polygon3d.html