# Is it possible extrude faces along normals individually in OpenSCAD?

For the geometry I am making, I want to extrude each face individually along its normal.

This is a standard procedure in 3D modeling software like Blender; see Example 3 here.

For extruding a single face, as long as you can know the plane the face is in, you can projection it to a 2D shape then linear_extrude that. In general you need the cut=true variant of projection, and you need to translate/rotate the object to be projected such that the face is in the XY plane (this is the "as long as you can know") part. Unfortunately this is subject to numerical instability, so you probably have to translate it by an extra 0.001 or so to cross the XY plane, in which case you'll end up with an approximation of the face rather than an exact version of it.

(Strictly speaking OpenSCAD doesn't have exact things anyway, except in the case of faces sharing points in a polyhedron, so this limitation probably doesn't make the situation any worse than it already is in OpenSCAD).

Once you have the projection, you can linear_extrude it in any direction you want, manipulate the result (e.g. skew with a transformation matrix), and rotate and translate it back onto the face. It should be possible to wrap up this whole operation into a module that operates on its child[ren].

Another approach would be capturing a thin slice around the face manually via intersection, then performing a hull with a translate of itself, but this will only work if it's convex (otherwise hull will fill in the convex hull of the 2D face shape too).

Extruding faces is only possible on 2D polygons. From a 3D object you cannot capture the face and extrude it. To extrude "faces" you would need to define the shape of the face and extend it in the third dimension of your choice. This way a 3D shape is created that could be concatenated (joined using e.g. union) to the original shape. For the extrusion, the function linear_extrude is available:

linear_extrude(height = fanwidth, center = true, convexity = 10, twist = -fanrot, slices = 20, scale = 1.0, \$fn = 16) {...}

• As long as you can know the plane a face is in, you can projection it to a 2D shape then extrude that. You can also capture a thin slice around a face manually via intersection and then hull it with a translate of itself. (Depending on the object the latter may or may not give exact results.) Sep 6 '19 at 11:50