I’m attempting to find the path of least resistance to apply bevel to an extruded shape. Specifically, extruded text. E.g. this text is currently just a flat shape:
Once bevel has been applied and a nearby light-source is available, it’d look like this:
To show the process with a simpler shape, e.g. a simple 3D rectangle, it’d look like this:
I realize the steps to do this are somewhat counter-intuitively complex. It’s not just a matter of changing the scale/size of the shape to be ‘bevelled’. Cinder has a function called
geom::ExtrudeSpline() which offers a
thickness() function. A naive approach would involve extruding a shape using the
geom::ExtrudeSpline() function and altering the thickness towards one end. But while the approach would work for something as simple as the 3d rectangle, it’d fail on text. E.g. the character A, would have it’s inner hole become smaller rather than bigger.
We would like to shrink the path’s of a character towards its center rather than scale all of them, if that makes sense. Doing this is non-trivial.
Fortunately there is a very handy library available to calculate what changes to make to a series of path’s that are to be ‘shrunk’ or ‘expanded’. Namely, the Clipper library.
But that leaves one remaining conundrum; how can this actually be done in Cinder…?
I’ve noticed in the
Extrude class in Cinder contains this member property:
… which I think describes the front/back of an extruded mesh. Assuming that the shrunk/expanded ‘ends’ don’t actually remove/add any vertices, I figure I should be able to simple offset the correct vertices and ideally be able to create the bevel.
But I can’t see a way of getting at the
TriMesh without adding an accessor in Cinder itself. Perhaps someone else has some ideas of how to best get at the mesh, and how best to modify it to add the intended bevel?
Thanks in advance,