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

<p>This is a standard procedure in 3D modeling software like Blender; see Example 3 <a href="https://blender.stackexchange.com/questions/7365/extrude-faces-along-local-normals">here</a>. </p>

<p>Is this possible in OpenSCAD?</p>

[{'answer_id': 10975, 'author': '0scar', 'author_id': 5740, 'author_profile': 'https://3dprinting.stackexchange.com/users/5740', 'pm_score': 2, 'selected': False, 'text': '<p>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. <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/CSG_Modelling#union" rel="nofollow noreferrer"><code>union</code></a>) to the original shape. For the extrusion, the function <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/2D_to_3D_Extrusion#Linear_Extrude" rel="nofollow noreferrer"><code>linear_extrude</code></a> is available:</p>\n\n<pre><code>linear_extrude(height = fanwidth, center = true, convexity = 10, twist = -fanrot, slices = 20, scale = 1.0, $fn = 16) {...}\n</code></pre>\n'}, {'answer_id': 10976, 'author': 'R.. GitHub STOP HELPING ICE', 'author_id': 11157, 'author_profile': 'https://3dprinting.stackexchange.com/users/11157', 'pm_score': 1, 'selected': False, 'text': '<p>Built-in to the language and its CSG model, no - processing the CSG tree is a completely separate phase following execution of the functional language, and there is no way to "read back" anything from the conversion of the model into faces in order to operate on the faces.</p>\n\n<p>However, you can do this if you\'re willing to do some heavy lifting yourself, or look for library code from someone else who\'s already done it. What it would involve is working out a description form of your own in terms of nested lists representing the model, with a module for converting the list to an OpenSCAD CSG tree. You can then write functions to manipulate this description in arbitrary ways, essentially reinventing the CSG phase of OpenSCAD within its own language. Some lesser versions of this have definitely been done in the past for things like implementing "loft" type functionality in OpenSCAD.</p>\n'}, {'answer_id': 10977, 'author': 'R.. GitHub STOP HELPING ICE', 'author_id': 11157, 'author_profile': 'https://3dprinting.stackexchange.com/users/11157', 'pm_score': 2, 'selected': False, 'text': '<p>For extruding a single face, as long as you can know the plane the face is in, you can <a href="https://en.wikibooks.org/wiki/OpenSCAD_User_Manual/3D_to_2D_Projection" rel="nofollow noreferrer"><code>projection</code></a> it to a 2D shape then <code>linear_extrude</code> that. In general you need the <code>cut=true</code> variant of <code>projection</code>, 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 <em>cross</em> the XY plane, in which case you\'ll end up with an approximation of the face rather than an exact version of it.</p>\n\n<p>(Strictly speaking OpenSCAD doesn\'t have exact things anyway, except in the case of faces sharing points in a <code>polyhedron</code>, so this limitation probably doesn\'t make the situation any worse than it already is in OpenSCAD).</p>\n\n<p>Once you have the projection, you can <code>linear_extrude</code> 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 <code>module</code> that operates on its child[ren].</p>\n\n<p>Another approach would be capturing a thin slice around the face manually via <code>intersection</code>, then performing a <code>hull</code> with a translate of itself, but this will only work if it\'s convex (otherwise <code>hull</code> will fill in the convex hull of the 2D face shape too).</p>\n'}]
['https://3dprinting.stackexchange.com/questions/10974', 'https://3dprinting.stackexchange.com', 'https://3dprinting.stackexchange.com/users/17493/']