Straight Skeleton of polygons in 3d

In the last blog ( ) 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

hole coordinates:

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
sudo apt-get install build-essential libcgal-dev libboost-dev
cd skeleton_polygon3d
cmake . && make && ./skeleton_polygon3d
firefox skeleton_polygon3d.html

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s