discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

"Melting" models

L
leebc
Fri, May 24, 2019 11:28 AM

I came across this model of a "melted" or "wilting" gear...  (Think Dali's
clocks.)
https://www.thingiverse.com/thing:2872162
http://forum.openscad.org/file/t1632/a22b1cd568ea8d3a6547ed46a6a10119_preview_featured.jpg

Can anyone think of a good way to recreate this in OpenSCAD?

Let's assume you are completely modeling in OpenSCAD so could re-write the
code for the gear generation.

Objective is to curve a flat object around a "pipe" of a certain diameter.

--
Sent from: http://forum.openscad.org/

I came across this model of a "melted" or "wilting" gear... (Think Dali's clocks.) https://www.thingiverse.com/thing:2872162 <http://forum.openscad.org/file/t1632/a22b1cd568ea8d3a6547ed46a6a10119_preview_featured.jpg> Can anyone think of a good way to recreate this in OpenSCAD? Let's assume you are completely modeling in OpenSCAD so could re-write the code for the gear generation. Objective is to curve a flat object around a "pipe" of a certain diameter. -- Sent from: http://forum.openscad.org/
KT
Kevin Toppenberg
Fri, May 24, 2019 1:43 PM

Could you multiple the object (i.e. the mesh of all the points of the
object) by a transform matrix, which effects the radial transformation?

Kevin

On Fri, May 24, 2019 at 7:29 AM leebc leebc11@acm.org wrote:

I came across this model of a "melted" or "wilting" gear...  (Think Dali's
clocks.)
https://www.thingiverse.com/thing:2872162
<
http://forum.openscad.org/file/t1632/a22b1cd568ea8d3a6547ed46a6a10119_preview_featured.jpg>

Can anyone think of a good way to recreate this in OpenSCAD?

Let's assume you are completely modeling in OpenSCAD so could re-write the
code for the gear generation.

Objective is to curve a flat object around a "pipe" of a certain diameter.

--
Sent from: http://forum.openscad.org/


OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

Could you multiple the object (i.e. the mesh of all the points of the object) by a transform matrix, which effects the radial transformation? Kevin On Fri, May 24, 2019 at 7:29 AM leebc <leebc11@acm.org> wrote: > I came across this model of a "melted" or "wilting" gear... (Think Dali's > clocks.) > https://www.thingiverse.com/thing:2872162 > < > http://forum.openscad.org/file/t1632/a22b1cd568ea8d3a6547ed46a6a10119_preview_featured.jpg> > > > Can anyone think of a good way to recreate this in OpenSCAD? > > Let's assume you are completely modeling in OpenSCAD so could re-write the > code for the gear generation. > > Objective is to curve a flat object around a "pipe" of a certain diameter. > > > > -- > Sent from: http://forum.openscad.org/ > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >
DM
Doug Moen
Fri, May 24, 2019 2:11 PM

Kevin Toppenberg says:

Could you multiple the object (i.e. the mesh of all the points of the object) by a transform matrix, which effects the radial transformation?

I don't think so. This requires a non-affine transformation, which can't be represented by a transformation matrix.

My 3D modelling language, Curv, supports non-affine transformations, which are represented by functions that map 3D points onto other 3D points, not matrices. I've implemented several 'bend' operators that do this kind of transformation.

In OpenSCAD, it's not so easy. I bet somebody on the list has a better answer, though.

Doug Moen.

On Fri, May 24, 2019, at 9:44 AM, Kevin Toppenberg wrote:

Could you multiple the object (i.e. the mesh of all the points of the object) by a transform matrix, which effects the radial transformation?

Kevin

On Fri, May 24, 2019 at 7:29 AM leebc leebc11@acm.org wrote:

I came across this model of a "melted" or "wilting" gear... (Think Dali's
clocks.)
https://www.thingiverse.com/thing:2872162
http://forum.openscad.org/file/t1632/a22b1cd568ea8d3a6547ed46a6a10119_preview_featured.jpg

Can anyone think of a good way to recreate this in OpenSCAD?

Let's assume you are completely modeling in OpenSCAD so could re-write the
code for the gear generation.

Objective is to curve a flat object around a "pipe" of a certain diameter.

--
Sent from: http://forum.openscad.org/


OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

Kevin Toppenberg says: > Could you multiple the object (i.e. the mesh of all the points of the object) by a transform matrix, which effects the radial transformation? I don't think so. This requires a non-affine transformation, which can't be represented by a transformation matrix. My 3D modelling language, Curv, supports non-affine transformations, which are represented by functions that map 3D points onto other 3D points, not matrices. I've implemented several 'bend' operators that do this kind of transformation. In OpenSCAD, it's not so easy. I bet somebody on the list has a better answer, though. Doug Moen. On Fri, May 24, 2019, at 9:44 AM, Kevin Toppenberg wrote: > Could you multiple the object (i.e. the mesh of all the points of the object) by a transform matrix, which effects the radial transformation? > > Kevin > > On Fri, May 24, 2019 at 7:29 AM leebc <leebc11@acm.org> wrote: >> I came across this model of a "melted" or "wilting" gear... (Think Dali's >> clocks.) >> https://www.thingiverse.com/thing:2872162 >> <http://forum.openscad.org/file/t1632/a22b1cd568ea8d3a6547ed46a6a10119_preview_featured.jpg> >> >> Can anyone think of a good way to recreate this in OpenSCAD? >> >> Let's assume you are completely modeling in OpenSCAD so could re-write the >> code for the gear generation. >> >> Objective is to curve a flat object around a "pipe" of a certain diameter. >> >> >> >> -- >> Sent from: http://forum.openscad.org/ >> >> _______________________________________________ >> OpenSCAD mailing list >> Discuss@lists.openscad.org >> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >
AC
A. Craig West
Fri, May 24, 2019 2:31 PM

I've implemented bend functionality by taking slices of the original shape
and placing them in position, and unioning it together. It tends to be slow
though

On Fri, 24 May 2019, 10:12 Doug Moen, doug@moens.org wrote:

Kevin Toppenberg says:

Could you multiple the object (i.e. the mesh of all the points of the

object) by a transform matrix, which effects the radial transformation?

I don't think so. This requires a non-affine transformation, which can't
be represented by a transformation matrix.

My 3D modelling language, Curv, supports non-affine transformations, which
are represented by functions that map 3D points onto other 3D points, not
matrices. I've implemented several 'bend' operators that do this kind of
transformation.

In OpenSCAD, it's not so easy. I bet somebody on the list has a better
answer, though.

Doug Moen.

On Fri, May 24, 2019, at 9:44 AM, Kevin Toppenberg wrote:

Could you multiple the object (i.e. the mesh of all the points of the
object) by a transform matrix, which effects the radial transformation?

Kevin

On Fri, May 24, 2019 at 7:29 AM leebc leebc11@acm.org wrote:

I came across this model of a "melted" or "wilting" gear...  (Think Dali's
clocks.)
https://www.thingiverse.com/thing:2872162
<
http://forum.openscad.org/file/t1632/a22b1cd568ea8d3a6547ed46a6a10119_preview_featured.jpg>

Can anyone think of a good way to recreate this in OpenSCAD?

Let's assume you are completely modeling in OpenSCAD so could re-write the
code for the gear generation.

Objective is to curve a flat object around a "pipe" of a certain diameter.

--
Sent from: http://forum.openscad.org/


OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org


OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org


OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org

I've implemented bend functionality by taking slices of the original shape and placing them in position, and unioning it together. It tends to be slow though On Fri, 24 May 2019, 10:12 Doug Moen, <doug@moens.org> wrote: > Kevin Toppenberg says: > > Could you multiple the object (i.e. the mesh of all the points of the > object) by a transform matrix, which effects the radial transformation? > > I don't think so. This requires a non-affine transformation, which can't > be represented by a transformation matrix. > > My 3D modelling language, Curv, supports non-affine transformations, which > are represented by functions that map 3D points onto other 3D points, not > matrices. I've implemented several 'bend' operators that do this kind of > transformation. > > In OpenSCAD, it's not so easy. I bet somebody on the list has a better > answer, though. > > Doug Moen. > > On Fri, May 24, 2019, at 9:44 AM, Kevin Toppenberg wrote: > > Could you multiple the object (i.e. the mesh of all the points of the > object) by a transform matrix, which effects the radial transformation? > > Kevin > > On Fri, May 24, 2019 at 7:29 AM leebc <leebc11@acm.org> wrote: > > I came across this model of a "melted" or "wilting" gear... (Think Dali's > clocks.) > https://www.thingiverse.com/thing:2872162 > < > http://forum.openscad.org/file/t1632/a22b1cd568ea8d3a6547ed46a6a10119_preview_featured.jpg> > > > Can anyone think of a good way to recreate this in OpenSCAD? > > Let's assume you are completely modeling in OpenSCAD so could re-write the > code for the gear generation. > > Objective is to curve a flat object around a "pipe" of a certain diameter. > > > > -- > Sent from: http://forum.openscad.org/ > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org > > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >
N
NateTG
Fri, May 24, 2019 4:21 PM

OpenSCAD doesn't have native support for plastic transformations or for
userland geometry.  I would recommend using something else.

If you're really determined, it's possible to write a geometry engine within
OPENScad, and then implement plastic transforms by subdividing triangles,
but it's a bunch of work and OPENScad isn't well-suited to a task like that.

This is "extruded" and "bent" in OpenSCAD, but I had to scrape the geometry
for the letters from postscript.

http://forum.openscad.org/file/t2140/cylindertext.stl

--
Sent from: http://forum.openscad.org/

OpenSCAD doesn't have native support for plastic transformations or for userland geometry. I would recommend using something else. If you're really determined, it's possible to write a geometry engine within OPENScad, and then implement plastic transforms by subdividing triangles, but it's a bunch of work and OPENScad isn't well-suited to a task like that. This is "extruded" and "bent" in OpenSCAD, but I had to scrape the geometry for the letters from postscript. http://forum.openscad.org/file/t2140/cylindertext.stl -- Sent from: http://forum.openscad.org/
CA
Carsten Arnholm
Fri, May 24, 2019 4:51 PM

On 24.05.2019 13:28, leebc wrote:

I came across this model of a "melted" or "wilting" gear...  (Think Dali's
clocks.)
https://www.thingiverse.com/thing:2872162
http://forum.openscad.org/file/t1632/a22b1cd568ea8d3a6547ed46a6a10119_preview_featured.jpg

Can anyone think of a good way to recreate this in OpenSCAD?

Let's assume you are completely modeling in OpenSCAD so could re-write the
code for the gear generation.

Objective is to curve a flat object around a "pipe" of a certain diameter.

There is no way in OpenSCAD to take an exiting flat object and "melt" it
into something like your example. This is because you cannot access and
transform individual coordinates in an OpenSCAD object.

In AngelCAD you can do it for an imported object as shown here
https://gist.github.com/arnholm/af72c7d0790bb3d72e6bdf29c7aac1ed

There is one requirement in addition to being able to change coordinates
of existing objects, and that is that the discretization of the object
mesh is fine enough to allow the melting/morphing. The link above shows
the difference (use the wirefame options).

Carsten Arnholm

On 24.05.2019 13:28, leebc wrote: > I came across this model of a "melted" or "wilting" gear... (Think Dali's > clocks.) > https://www.thingiverse.com/thing:2872162 > <http://forum.openscad.org/file/t1632/a22b1cd568ea8d3a6547ed46a6a10119_preview_featured.jpg> > > Can anyone think of a good way to recreate this in OpenSCAD? > > Let's assume you are completely modeling in OpenSCAD so could re-write the > code for the gear generation. > > Objective is to curve a flat object around a "pipe" of a certain diameter. There is no way in OpenSCAD to take an exiting flat object and "melt" it into something like your example. This is because you cannot access and transform individual coordinates in an OpenSCAD object. In AngelCAD you can do it for an imported object as shown here https://gist.github.com/arnholm/af72c7d0790bb3d72e6bdf29c7aac1ed There is one requirement in addition to being able to change coordinates of existing objects, and that is that the discretization of the object mesh is fine enough to allow the melting/morphing. The link above shows the difference (use the wirefame options). Carsten Arnholm
A
adrianv
Fri, May 24, 2019 9:41 PM

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.

--
Sent from: http://forum.openscad.org/

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. -- Sent from: http://forum.openscad.org/
A
arnholm@arnholm.org
Sat, May 25, 2019 9:03 AM

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

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
C
caterpillar
Sat, May 25, 2019 9:27 AM

Here's my quick and dirty code based on  my library
https://github.com/JustinSDK/dotSCAD  .

include <shape_starburst.scad>;
include <bend_extrude.scad>;

gear_r = 30;
thickness = 2;
angle = 75;
frags = 24;

module gear() {
rotate(1) difference() {
polygon(shape_starburst(gear_r, 25, 24));
circle(5);
for(i = [0:5]) {
rotate(60 * i) translate([15, 0, 0]) circle(5);
}
}
}

rotate([0, -angle / frags, 0])
translate([gear_r / frags / 2, -gear_r, gear_r * 180 / (angle *
3.14159)])
rotate([90, 0, 0])
bend_extrude([gear_r, gear_r * 2], thickness, angle, frags)
translate([0, gear_r, 0]) gear();

linear_extrude(thickness)
intersection() {
translate([-gear_r / 2, 0, 0])
gear();
}

bend_extrude is not documented currently, however, it's already in the
repository.

  <http://forum.openscad.org/file/t1825/melting_gear.jpg>        

square([gear_r, gear_r * 2], center = true);


http://openhome.cc

Sent from: http://forum.openscad.org/

Here's my quick and dirty code based on my library <https://github.com/JustinSDK/dotSCAD> . include <shape_starburst.scad>; include <bend_extrude.scad>; gear_r = 30; thickness = 2; angle = 75; frags = 24; module gear() { rotate(1) difference() { polygon(shape_starburst(gear_r, 25, 24)); circle(5); for(i = [0:5]) { rotate(60 * i) translate([15, 0, 0]) circle(5); } } } rotate([0, -angle / frags, 0]) translate([gear_r / frags / 2, -gear_r, gear_r * 180 / (angle * 3.14159)]) rotate([90, 0, 0]) bend_extrude([gear_r, gear_r * 2], thickness, angle, frags) translate([0, gear_r, 0]) gear(); linear_extrude(thickness) intersection() { translate([-gear_r / 2, 0, 0]) gear(); } bend_extrude is not documented currently, however, it's already in the repository. <http://forum.openscad.org/file/t1825/melting_gear.jpg> square([gear_r, gear_r * 2], center = true); ----- http://openhome.cc -- Sent from: http://forum.openscad.org/
C
caterpillar
Sat, May 25, 2019 9:32 AM

Here's my quick and dirty code based on  my library
https://github.com/JustinSDK/dotSCAD  .

include <shape_starburst.scad>;
include <bend_extrude.scad>;

gear_r = 30;
thickness = 2;
angle = 75;
frags = 24;

module gear() {
rotate(1) difference() {
polygon(shape_starburst(gear_r, 25, 24));
circle(5);
for(i = [0:5]) {
rotate(60 * i) translate([15, 0, 0]) circle(5);
}
}
}

rotate([0, -angle / frags, 0])
translate([gear_r / frags / 2, -gear_r, gear_r * 180 / (angle *
3.14159)])
rotate([90, 0, 0])
bend_extrude([gear_r, gear_r * 2], thickness, angle, frags)
translate([0, gear_r, 0]) gear();

linear_extrude(thickness)
intersection() {
translate([-gear_r / 2, 0, 0])
square([gear_r, gear_r * 2], center = true);
gear();
}

bend_extrude is not documented currently, however, it's already in the
repository.

http://forum.openscad.org/file/t1825/melting_gear2.jpg


http://openhome.cc

Sent from: http://forum.openscad.org/

Here's my quick and dirty code based on my library <https://github.com/JustinSDK/dotSCAD> . include <shape_starburst.scad>; include <bend_extrude.scad>; gear_r = 30; thickness = 2; angle = 75; frags = 24; module gear() { rotate(1) difference() { polygon(shape_starburst(gear_r, 25, 24)); circle(5); for(i = [0:5]) { rotate(60 * i) translate([15, 0, 0]) circle(5); } } } rotate([0, -angle / frags, 0]) translate([gear_r / frags / 2, -gear_r, gear_r * 180 / (angle * 3.14159)]) rotate([90, 0, 0]) bend_extrude([gear_r, gear_r * 2], thickness, angle, frags) translate([0, gear_r, 0]) gear(); linear_extrude(thickness) intersection() { translate([-gear_r / 2, 0, 0]) square([gear_r, gear_r * 2], center = true); gear(); } bend_extrude is not documented currently, however, it's already in the repository. <http://forum.openscad.org/file/t1825/melting_gear2.jpg> ----- http://openhome.cc -- Sent from: http://forum.openscad.org/