discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

method to sweep or skin a hollow object without difference function

JJ
Johan Jonker
Thu, Dec 22, 2016 4:23 AM

http://forum.openscad.org/file/n19677/cup.jpg
I thought that it should be possible to make in one sweep a hollow object
like a cup. And the following code works without the use of the difference
function
:Any suggestions how to make a tube without use of the difference function?

--
View this message in context: http://forum.openscad.org/method-to-sweep-or-skin-a-hollow-object-without-difference-function-tp19677.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

<http://forum.openscad.org/file/n19677/cup.jpg> I thought that it should be possible to make in one sweep a hollow object like a cup. And the following code works without the use of the difference function :Any suggestions how to make a tube without use of the difference function? -- View this message in context: http://forum.openscad.org/method-to-sweep-or-skin-a-hollow-object-without-difference-function-tp19677.html Sent from the OpenSCAD mailing list archive at Nabble.com.
R
Ronaldo
Thu, Dec 22, 2016 7:40 AM

I don't know how to do it with Parkinbot's sweep but, yes, it is possible:

http://forum.openscad.org/file/n19680/Tube_polyhedron.png

Tube_example.scad http://forum.openscad.org/file/n19680/Tube_example.scad

--
View this message in context: http://forum.openscad.org/method-to-sweep-or-skin-a-hollow-object-without-difference-function-tp19677p19680.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

I don't know how to do it with Parkinbot's sweep but, yes, it is possible: <http://forum.openscad.org/file/n19680/Tube_polyhedron.png> Tube_example.scad <http://forum.openscad.org/file/n19680/Tube_example.scad> -- View this message in context: http://forum.openscad.org/method-to-sweep-or-skin-a-hollow-object-without-difference-function-tp19677p19680.html Sent from the OpenSCAD mailing list archive at Nabble.com.
JJ
Johan Jonker
Thu, Dec 22, 2016 3:43 PM

Very nice example and I even succeeded in understanding it so well that I
could generate a tube or ring.So I have 4 ways now to make a ring:

  • difference of two cylinders
  • lineair extrude of a 2D ring
  • difference of two sweeped cylinders (works also with skin)
  • creating polyhedrons

I added this to one of my examples files called "lord_of_the_rings.scad"
;-).
lord_of_the_rings.scad
http://forum.openscad.org/file/n19688/lord_of_the_rings.scad
http://forum.openscad.org/file/n19688/lordoftherings.jpg Is there another
way to make the complete olympic serie??

--
View this message in context: http://forum.openscad.org/method-to-sweep-or-skin-a-hollow-object-without-difference-function-tp19677p19688.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

Very nice example and I even succeeded in understanding it so well that I could generate a tube or ring.So I have 4 ways now to make a ring: - difference of two cylinders - lineair extrude of a 2D ring - difference of two sweeped cylinders (works also with skin) - creating polyhedrons I added this to one of my examples files called "lord_of_the_rings.scad" ;-). lord_of_the_rings.scad <http://forum.openscad.org/file/n19688/lord_of_the_rings.scad> <http://forum.openscad.org/file/n19688/lordoftherings.jpg> Is there another way to make the complete olympic serie?? -- View this message in context: http://forum.openscad.org/method-to-sweep-or-skin-a-hollow-object-without-difference-function-tp19677p19688.html Sent from the OpenSCAD mailing list archive at Nabble.com.
JJ
Johan Jonker
Thu, Dec 22, 2016 3:56 PM

Method nr. 5:

color("green") translate([20,20,0])
{
rotate_extrude(angle=360, convexity=10)
translate([8,0,0])
square([2,10]);
}

--
View this message in context: http://forum.openscad.org/method-to-sweep-or-skin-a-hollow-object-without-difference-function-tp19677p19689.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

Method nr. 5: color("green") translate([20,20,0]) { rotate_extrude(angle=360, convexity=10) translate([8,0,0]) square([2,10]); } -- View this message in context: http://forum.openscad.org/method-to-sweep-or-skin-a-hollow-object-without-difference-function-tp19677p19689.html Sent from the OpenSCAD mailing list archive at Nabble.com.
R
Ronaldo
Thu, Dec 22, 2016 3:58 PM

Nice summary, Johan. Conceptually, your sweep example is not distinct from
the difference of cylinders: it only generates the cylinders in an
alternative way. Essentially, sweep is a polyhedron construction.

You want a fifth one... make two half rings by rotate_extruding squares and
union them. In a snapshot version, you can do rotate_extrude specifying an
angle.

--
View this message in context: http://forum.openscad.org/method-to-sweep-or-skin-a-hollow-object-without-difference-function-tp19677p19690.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

Nice summary, Johan. Conceptually, your sweep example is not distinct from the difference of cylinders: it only generates the cylinders in an alternative way. Essentially, sweep is a polyhedron construction. You want a fifth one... make two half rings by rotate_extruding squares and union them. In a snapshot version, you can do rotate_extrude specifying an angle. -- View this message in context: http://forum.openscad.org/method-to-sweep-or-skin-a-hollow-object-without-difference-function-tp19677p19690.html Sent from the OpenSCAD mailing list archive at Nabble.com.
P
Parkinbot
Thu, Dec 22, 2016 3:58 PM

It is not too difficult to write a sweep function that connects a dual
sequence of polygons into a hollow solid like a pipe. At best you commit
yourself to obey to some rules to ease triangulation.

inner and outer polygons must
0. not self-intersect or mutually intersect !!! (no intersection at all )

  1. use a defined orientation
    (2. be coplanar - i.e. at best they use the same affine 2D->3D
    transformation)
    (3. have the same number of points)
    (4. use minimally distanced start points and suitable sequencing.)

2 can be omitted, if you know, what you do.
3 and 4 are good if you want to use a trivial connection scheme like quads
for the first and last face. If you find some other nice triangulation
scheme they can be omitted. For the extruded inner and outer surfaces you
can use a trivial connection scheme like quads.

But honestly, I don't see any progress beyond saving some CPU time against
just differencing an inner solid from an outer solid. If both solids are
proper manifolds, the result will also be. If not, your new scheme will not
be any better.

--
View this message in context: http://forum.openscad.org/method-to-sweep-or-skin-a-hollow-object-without-difference-function-tp19677p19691.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

It is not too difficult to write a sweep function that connects a dual sequence of polygons into a hollow solid like a pipe. At best you commit yourself to obey to some rules to ease triangulation. inner and outer polygons must 0. not self-intersect or mutually intersect !!! (no intersection at all ) 1. use a defined orientation (2. be coplanar - i.e. at best they use the same affine 2D->3D transformation) (3. have the same number of points) (4. use minimally distanced start points and suitable sequencing.) 2 can be omitted, if you know, what you do. 3 and 4 are good if you want to use a trivial connection scheme like quads for the first and last face. If you find some other nice triangulation scheme they can be omitted. For the extruded inner and outer surfaces you can use a trivial connection scheme like quads. But honestly, *I don't see any progress beyond saving some CPU time* against just differencing an inner solid from an outer solid. If both solids are proper manifolds, the result will also be. If not, your new scheme will not be any better. -- View this message in context: http://forum.openscad.org/method-to-sweep-or-skin-a-hollow-object-without-difference-function-tp19677p19691.html Sent from the OpenSCAD mailing list archive at Nabble.com.
RP
Ronaldo Persiano
Thu, Dec 22, 2016 4:01 PM

Nice fifth solution, Johan. I don't see why I divided the ring in two parts
in proposal. Ahrgh.

Nice fifth solution, Johan. I don't see why I divided the ring in two parts in proposal. Ahrgh.
P
Parkinbot
Thu, Dec 22, 2016 4:15 PM

Ronaldo wrote

Nice fifth solution, Johan. I don't see why I divided the ring in two
parts
in proposal. Ahrgh.

because this is the way, you can do it (and even more) with sweep/skin
operations, see http://www.thingiverse.com/thing:1659079

--
View this message in context: http://forum.openscad.org/method-to-sweep-or-skin-a-hollow-object-without-difference-function-tp19677p19693.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

Ronaldo wrote > Nice fifth solution, Johan. I don't see why I divided the ring in two > parts > in proposal. Ahrgh. because this is the way, you can do it (and even more) with sweep/skin operations, see http://www.thingiverse.com/thing:1659079 -- View this message in context: http://forum.openscad.org/method-to-sweep-or-skin-a-hollow-object-without-difference-function-tp19677p19693.html Sent from the OpenSCAD mailing list archive at Nabble.com.
P
Parkinbot
Thu, Dec 22, 2016 4:36 PM

Johan, btw. your first code seemlessly works with my newest version of
Naca_sweep.scad which meanwhile also supports closed extrusions. I uploaded
it for you. Get it at: http://www.thingiverse.com/thing:900137

To use the new feature just alter the sweep() call into:

sweep(objcup, close = true);

--
View this message in context: http://forum.openscad.org/method-to-sweep-or-skin-a-hollow-object-without-difference-function-tp19677p19695.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

Johan, btw. your first code seemlessly works with my newest version of Naca_sweep.scad which meanwhile also supports closed extrusions. I uploaded it for you. Get it at: http://www.thingiverse.com/thing:900137 To use the new feature just alter the sweep() call into: > sweep(objcup, close = true); -- View this message in context: http://forum.openscad.org/method-to-sweep-or-skin-a-hollow-object-without-difference-function-tp19677p19695.html Sent from the OpenSCAD mailing list archive at Nabble.com.
RP
Ronaldo Persiano
Thu, Dec 22, 2016 5:04 PM

Yes, you are right. It seems I have been unconciously influenced by your
smart solution to threads.

Yes, you are right. It seems I have been unconciously influenced by your smart solution to threads.