From 2d silhouette to 3d shape

Hi, everyone,
I’m pretty new to openframeworks. That’s, in fact, my first project with it.
My goal is to generate a deformable irregular 3d shape from a 2d shape drawn in live. Actually this shape, or silhouette, is being drawn marking points and extending ofCurveVertexs along them.
Because my purpose is to do a 3d mapping of different rounded shapes in a wall, first of all I trace their silhouettes.
What I’m needing now is to extrude them in a rounded way. If I get it, I will start with the deformations and 3d lights. I’m not in any way a 3d magician but that’s my purpose.
Does anyone know how should I try it? Which addon may help me? Any idea?
A lot of thanks in advance.

what do you mean by “extrude in a rounded way”?
First of all I´d recommend you to use ofPath (use if you want a filled shape) or ofPolyline (use if you want a line only) instead of ofCurveVertex as it will give you more flexibility and better performance.
check the following
also check zach lieberman´s repos in particular

hope this helps.

Hi, Roy, thanks for answering!

Maybe the expression was not correct, not clear. What I’m referring with to “extrude in a rounded way” would significate to draw an ellipse for getting an ellipsoid. This example is a pretty exact one, in fact this conversion should work with handmade shapes,
Maybe the solution could be to draw ellipses of 1px in z axis orientation all along the shape with variable radius of length/2 of the shape in this specific pixel position. Maybe I’m not being clear again, I’m sorry. Any better idea, any useful addon?
Thanks for the links, Roy.

I not really understanding what you want to achieve. sorry.
maybe if you make a drawing and post it?
you might want to take a look at CGAL library. There are a few addons for using it. Look at these in
take a look at zach liebermans daily sketches,
I think that some of these might be similar to what you want to achieve


Hi, Roy,
I found a example in the daily sketches of Lieberman that is exactly what I’d like to do.

It generates a 3d from a contour, and it relates to a project called Openteddy.
So that’s what I want and didn’t know how to explain it!
A pity that there’s not any code on the daily sketches page from Lieberman.
On the other hand, I’m experimenting some problems trying to check the CGAL library, in Ubuntu and mac (El Capitan).
clang: error: invalid deployment target for -stdlib=libc++ (requires OS X 10.7 or later) (But I am with OS X 10.11)

Now that you know what I’m trying to get, would you say that working with CGAL could help me?
Thanks a lot!

I don’t share the code for these sketches because I designed this process to be really light for me to make these things and I find it would be hard to share these works in progress (often times I don’t know what they are even), but I do offer open office hours 1x per week and happy to answer any questions there or on ig. Follow me on twitter and I will announce these sessions. I try to offer as much info as I can.

also, openTeddy is honestly pretty buggy! It crashes very often on different polygons I passed to it.

Hi, thanks for the kind reply and of course I will be following your announces. Now I will try to go ahead by myself, and sure in no many time I’ll be begging again for some help! One simple question: do you think the first step could be the simple extrusion of the 2d shape and then try to smooth the vertexs?
Lot of thanks!

sorry for the delay – sure, that can work ! I’ve done that before looking at teddy – you can triangulate the polygon shape so it has inner points (steiner points), then calculate the distance of those points to the edge – points closer to the edge can be pushed out shallower, but points further (closer to the center) can be pushed out more

this is helpful:

ps: to calculate the distance of the point to the edge, I just try to find the closest point on the edge to the point I am considering…

A lot of thanks, I really apreciate it. I was just trying to make this very example work when I realized that I had an answer in the forum!
I have it working now in xcode, but it’s a pitty that I didn’t get to do it in ubuntu.
I really sweat trying the examples of most kinds work in QT, with ubuntu.
Yes, I know maybe it’s not the best idea for a beginer to try it in linux, but I’m interested in developing with humbler machines, and that’s why I was trying to leave osx aside.
But now that I have the example running in xcode I go ahead with your suggestions. Thanks again!