discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Curve a design

MV
Maurice van Peursem
Wed, Apr 14, 2021 8:34 PM

I want to curve a complete design, that is to scale it less on the
'inside' and more on the 'outside', and changing the scale linearly
from inside to outside. The scaling should only be in the x and
y-direction, not in the z-direction. Is there an easy way to do that?

Cheers,
Maurice

I want to curve a complete design, that is to scale it less on the 'inside' and more on the 'outside', and changing the scale linearly from inside to outside. The scaling should only be in the x and y-direction, not in the z-direction. Is there an easy way to do that? Cheers, Maurice
W
Whosawhatsis
Wed, Apr 14, 2021 8:43 PM

There is not a good way to do it in OpenSCAD, no. Several of us have written "bend" modules that slice an input shape into wedges, and reassemble those wedges to simulate such a curve, but because you're discarding some of the geometry on the inside and/or duplicating some on the outside, things don't line up perfectly.

What you really want is something that takes the points in a model and converts its x/y/z cartesian coordinates to theta/r/z cylindrical coordinates. If you created the model as a single polyhedron(), and thus its coordinates are available to your code, the math is fairly trivial. If the geometry was created any other way, your code does not have access to its coordinates, and thus can't perform the operation.
On Apr 14, 2021, 13:35 -0700, Maurice van Peursem openscad@vanpeursem.net, wrote:

I want to curve a complete design, that is to scale it less on the
'inside' and more on the 'outside', and changing the scale linearly
from inside to outside. The scaling should only be in the x and
y-direction, not in the z-direction. Is there an easy way to do that?

Cheers,
Maurice


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

There is not a good way to do it in OpenSCAD, no. Several of us have written "bend" modules that slice an input shape into wedges, and reassemble those wedges to simulate such a curve, but because you're discarding some of the geometry on the inside and/or duplicating some on the outside, things don't line up perfectly. What you really want is something that takes the points in a model and converts its x/y/z cartesian coordinates to theta/r/z cylindrical coordinates. If you created the model as a single polyhedron(), and thus its coordinates are available to your code, the math is fairly trivial. If the geometry was created any other way, your code does not have access to its coordinates, and thus can't perform the operation. On Apr 14, 2021, 13:35 -0700, Maurice van Peursem <openscad@vanpeursem.net>, wrote: > I want to curve a complete design, that is to scale it less on the > 'inside' and more on the 'outside', and changing the scale linearly > from inside to outside. The scaling should only be in the x and > y-direction, not in the z-direction. Is there an easy way to do that? > > Cheers, > Maurice > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org