discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Normal Hull direction vector for extruding geometry

P
Parkinbot
Wed, Jun 24, 2020 10:53 PM

Ronaldo wrote

To have a comparison I have done a lazy simulation of both ways:

You are right, of course, but you will have a hard time to properly
implement sweep() for this kind of extrusion with arbitrary paths (and with
a couple of shapes, as mophead mentioned), because you need some means to
avoid self intersections. Leo's approach made me think of code like:

R=5;      // nozzle width
r = 2.5;  // layer height
$fn=10;

P = [[0,0, 0], [50, 10, 0], [50, 50, 0], [170, -150, 0], [170, 150, 0]];
multiline(P);

module multiline(P)  for(i=[0:len(P)-2]) line(P[i], P[i+1]);

module line(p1, p2)
hull()
{
translate(p1)torus();
translate(p2)torus();
}

module torus(R=R, r=r)
rotate_extrude() translate([R, 0, 0])circle(r);

So, some appropriate sweep() operation can save time and will obviously be
faster than multiline() in my code example. However, the implemenation is
demanding and if you have to union a significant number of such paths,
OpenSCAD again will make you cry. So better use multiline() right away,
spare the programming time and give your machine the time it needs, while
you are on your sommer leave.

@Leo, Maybe you can give us some hint about the complexity of the FEM
analysis you are planning to do. Is it just some layers with, say, a hundred
strokes all together, or are you planning to analyse more complex prints?

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

Ronaldo wrote > To have a comparison I have done a lazy simulation of both ways: You are right, of course, but you will have a hard time to properly implement sweep() for this kind of extrusion with arbitrary paths (and with a couple of shapes, as mophead mentioned), because you need some means to avoid self intersections. Leo's approach made me think of code like: R=5; // nozzle width r = 2.5; // layer height $fn=10; P = [[0,0, 0], [50, 10, 0], [50, 50, 0], [170, -150, 0], [170, 150, 0]]; multiline(P); module multiline(P) for(i=[0:len(P)-2]) line(P[i], P[i+1]); module line(p1, p2) hull() { translate(p1)torus(); translate(p2)torus(); } module torus(R=R, r=r) rotate_extrude() translate([R, 0, 0])circle(r); So, some appropriate sweep() operation can save time and will obviously be faster than multiline() in my code example. However, the implemenation is demanding and if you have to union a significant number of such paths, OpenSCAD again will make you cry. So better use multiline() right away, spare the programming time and give your machine the time it needs, while you are on your sommer leave. @Leo, Maybe you can give us some hint about the complexity of the FEM analysis you are planning to do. Is it just some layers with, say, a hundred strokes all together, or are you planning to analyse more complex prints? -- Sent from: http://forum.openscad.org/
NH
nop head
Thu, Jun 25, 2020 9:34 AM

mophead? I could have been called that a few weeks ago as I last went to
the barbers in December but I managed to buy some clippers and my wife cut
my hair, so back to nophead.

On Wed, 24 Jun 2020 at 23:54, Parkinbot rudolf@digitaldocument.de wrote:

Ronaldo wrote

To have a comparison I have done a lazy simulation of both ways:

You are right, of course, but you will have a hard time to properly
implement sweep() for this kind of extrusion with arbitrary paths (and with
a couple of shapes, as mophead mentioned), because you need some means to
avoid self intersections. Leo's approach made me think of code like:

R=5;      // nozzle width
r = 2.5;  // layer height
$fn=10;

P = [[0,0, 0], [50, 10, 0], [50, 50, 0], [170, -150, 0], [170, 150, 0]];
multiline(P);

module multiline(P)  for(i=[0:len(P)-2]) line(P[i], P[i+1]);

module line(p1, p2)
hull()
{
translate(p1)torus();
translate(p2)torus();
}

module torus(R=R, r=r)
rotate_extrude() translate([R, 0, 0])circle(r);

So, some appropriate sweep() operation can save time and will obviously be
faster than multiline() in my code example. However, the implemenation is
demanding and if you have to union a significant number of such paths,
OpenSCAD again will make you cry. So better use multiline() right away,
spare the programming time and give your machine the time it needs, while
you are on your sommer leave.

@Leo, Maybe you can give us some hint about the complexity of the FEM
analysis you are planning to do. Is it just some layers with, say, a
hundred
strokes all together, or are you planning to analyse more complex prints?

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


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

mophead? I could have been called that a few weeks ago as I last went to the barbers in December but I managed to buy some clippers and my wife cut my hair, so back to nophead. On Wed, 24 Jun 2020 at 23:54, Parkinbot <rudolf@digitaldocument.de> wrote: > Ronaldo wrote > > To have a comparison I have done a lazy simulation of both ways: > > You are right, of course, but you will have a hard time to properly > implement sweep() for this kind of extrusion with arbitrary paths (and with > a couple of shapes, as mophead mentioned), because you need some means to > avoid self intersections. Leo's approach made me think of code like: > > R=5; // nozzle width > r = 2.5; // layer height > $fn=10; > > P = [[0,0, 0], [50, 10, 0], [50, 50, 0], [170, -150, 0], [170, 150, 0]]; > multiline(P); > > module multiline(P) for(i=[0:len(P)-2]) line(P[i], P[i+1]); > > > module line(p1, p2) > hull() > { > translate(p1)torus(); > translate(p2)torus(); > } > > module torus(R=R, r=r) > rotate_extrude() translate([R, 0, 0])circle(r); > > So, some appropriate sweep() operation can save time and will obviously be > faster than multiline() in my code example. However, the implemenation is > demanding and if you have to union a significant number of such paths, > OpenSCAD again will make you cry. So better use multiline() right away, > spare the programming time and give your machine the time it needs, while > you are on your sommer leave. > > @Leo, Maybe you can give us some hint about the complexity of the FEM > analysis you are planning to do. Is it just some layers with, say, a > hundred > strokes all together, or are you planning to analyse more complex prints? > > > > -- > Sent from: http://forum.openscad.org/ > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >
P
Parkinbot
Thu, Jun 25, 2020 12:28 PM

g, sorry for the typo

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

*g*, sorry for the typo -- Sent from: http://forum.openscad.org/