[OpenSCAD] "Melting" models

arnholm at arnholm.org arnholm at arnholm.org
Sat May 25 05:03:08 EDT 2019


On 2019-05-24 23:41, adrianv wrote:
> I suppose it's a somewhat advanced effort, but I don't think it would 
> be
> particularly hard to write a "bent_sweep" module that would take a 
> polygon
> expressed as a series of point coordinates and a second "destination"
> polygon also as a series of points.  You could project the first 
> polygon
> onto the second one and then build it up to the desired thickness (in 
> the
> normal direction), constructing the vertices and faces of the necessary
> polyhedron.

A polygon in OpenSCAD is a 2d object with only (x,y) coordinates, so the 
"destination" cannot exist anywhere but in the (x,y) plane. I think you 
would "be on your own" having to write such from scratch using lists of 
3d coordinates. Possible perhaps, but somewhat inconvenient. However, 
sweeping is not the same as "melting" (or morphing rather). In a sweep 
you start with a 2d shape and create a 3d object by sweeping the (rigid) 
2d shape along a path to get a 3d object. OpenSCAD linear_extrude is a 
special case of this. A slightly different case is 
https://gist.github.com/arnholm/931bba4633ca344a3ffe0698b945395f

The melting/morphing case is quite different, it begins with an existing 
valid 3d model created using any method. Usually keeping the topology of 
the model fixed, the *shape* of the 3d model is modified. If the model 
is represented as a polyhedron mesh, either explicitly modeled as such 
or the result of mesh based boolean operations, changing the shape 
translates to transforming the polyhedron vertex coordinates, using 
different transformations for different vertices (i.e. "non-affine 
transformation" of the model).

Carsten Arnholm



More information about the Discuss mailing list