discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

request for relative_extrude

N
Neon22
Mon, Jul 13, 2015 2:39 AM

The current linear_extrude works well but cannot make objects that taper or
do certain kinds of rotation or translation effects.
My request is for either:

  • a relative flag added to linear_extrude, or
  • a new command relative_extrude or similar.

Here is a taper module:

http://forum.openscad.org/file/n13128/2015-07-13_13_54_46-taper.png
This works by incrementally combining the hull() of a pair of cylinders,
where the diameter expands exponentially..
Instead I propose something like this:

The idea is bit like a macro in a lisp-like language. It would create an
implied let() with 'step' defined as a for variable incrementing from
[0:steps].
This could be used as a factor within each iteration.
At each iteration the new shape(2D) would be created based on the previous
one.
So rotates will be local around the center of the previous face and the face
normal would define the Z axis for the next step.
This way many kinds of shapes can be represented including ones that curve
and twist relative for each step.
E.g.

Would create a 180 degree arc in X of the polygon tapering by 95% each
iteration.

If using the existing linear extrude, and adding a relative flag, then not
as many shapes can be created. The flag would be interpreted as indicating
that the next step is local to the just-created face.

I suspect there is a way to do this in the current OpenSCAD using
multmatrix, projection, children(), and hull().
But I am proposing making it work differently and perhaps more simply for
OpenSCAD2.

--
View this message in context: http://forum.openscad.org/request-for-relative-extrude-tp13128.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

The current linear_extrude works well but cannot make objects that taper or do certain kinds of rotation or translation effects. My request is for either: - a relative flag added to linear_extrude, or - a new command relative_extrude or similar. Here is a taper module: <http://forum.openscad.org/file/n13128/2015-07-13_13_54_46-taper.png> This works by incrementally combining the hull() of a pair of cylinders, where the diameter expands exponentially.. Instead I propose something like this: The idea is bit like a macro in a lisp-like language. It would create an implied let() with 'step' defined as a for variable incrementing from [0:steps]. This could be used as a factor within each iteration. At each iteration the new shape(2D) would be created based on the previous one. So rotates will be local around the center of the previous face and the face normal would define the Z axis for the next step. This way many kinds of shapes can be represented including ones that curve and twist relative for each step. E.g. Would create a 180 degree arc in X of the polygon tapering by 95% each iteration. If using the existing linear extrude, and adding a relative flag, then not as many shapes can be created. The flag would be interpreted as indicating that the next step is local to the just-created face. I suspect there is a way to do this in the current OpenSCAD using multmatrix, projection, children(), and hull(). But I am proposing making it work differently and perhaps more simply for OpenSCAD2. -- View this message in context: http://forum.openscad.org/request-for-relative-extrude-tp13128.html Sent from the OpenSCAD mailing list archive at Nabble.com.