discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

How can I tell what OpenSCAD is doing?

DS
Dan Shriver
Sun, Oct 9, 2016 4:05 PM

I know this is is somewhat of a bad question (because CGAL is a black
box...) but, even if the progress bar is a complete lie (which it usually
is for me) is there some way that I can tell that openSCAD is still doing
something and hasn't stopped?

I ask because I have some simple test code:

module testTorus() {
for (i = [0:360]) {
translate([(20cos(i)),(20sin(i)),0]) {
rotate_extrude(angle=1, convexity=10){
translate([20,20,0]) {
circle(r=10,$fn=5);
}
}
}
}
}

I ask it to run and I get "Rendering Polygon Mesh using CGAL..." and no
other indication that things are progressing and just want to be sure it is
still working.

Why am I doing things this very painful way when I could just
rotate_extrude through 360 degrees?  This is just a simple test case to see
if what I am doing will work.  When I actually implement things I will have
the different slices each be slightly different.

I know this is is somewhat of a bad question (because CGAL is a black box...) but, even if the progress bar is a complete lie (which it usually is for me) is there some way that I can tell that openSCAD is still doing something and hasn't stopped? I ask because I have some simple test code: module testTorus() { for (i = [0:360]) { translate([(20*cos(i)),(20*sin(i)),0]) { rotate_extrude(angle=1, convexity=10){ translate([20,20,0]) { circle(r=10,$fn=5); } } } } } I ask it to run and I get "Rendering Polygon Mesh using CGAL..." and no other indication that things are progressing and just want to be sure it is still working. Why am I doing things this very painful way when I could just rotate_extrude through 360 degrees? This is just a simple test case to see if what I am doing will work. When I actually implement things I will have the different slices each be slightly different.
NH
nop head
Sun, Oct 9, 2016 4:32 PM

The only thing you are asking CGAL to do is union 360 overlapping tori, so
that is what it will be trying to do. That will take a time approaching
infinity as union is very slow especially with overlapping shapes with lots
of vertices.

On 9 October 2016 at 17:05, Dan Shriver tabbydan@gmail.com wrote:

I know this is is somewhat of a bad question (because CGAL is a black
box...) but, even if the progress bar is a complete lie (which it usually
is for me) is there some way that I can tell that openSCAD is still doing
something and hasn't stopped?

I ask because I have some simple test code:

module testTorus() {
for (i = [0:360]) {
translate([(20cos(i)),(20sin(i)),0]) {
rotate_extrude(angle=1, convexity=10){
translate([20,20,0]) {
circle(r=10,$fn=5);
}
}
}
}
}

I ask it to run and I get "Rendering Polygon Mesh using CGAL..." and no
other indication that things are progressing and just want to be sure it is
still working.

Why am I doing things this very painful way when I could just
rotate_extrude through 360 degrees?  This is just a simple test case to see
if what I am doing will work.  When I actually implement things I will have
the different slices each be slightly different.


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

The only thing you are asking CGAL to do is union 360 overlapping tori, so that is what it will be trying to do. That will take a time approaching infinity as union is very slow especially with overlapping shapes with lots of vertices. On 9 October 2016 at 17:05, Dan Shriver <tabbydan@gmail.com> wrote: > I know this is is somewhat of a bad question (because CGAL is a black > box...) but, even if the progress bar is a complete lie (which it usually > is for me) is there some way that I can tell that openSCAD is still doing > something and hasn't stopped? > > I ask because I have some simple test code: > > module testTorus() { > for (i = [0:360]) { > translate([(20*cos(i)),(20*sin(i)),0]) { > rotate_extrude(angle=1, convexity=10){ > translate([20,20,0]) { > circle(r=10,$fn=5); > } > } > } > } > } > > I ask it to run and I get "Rendering Polygon Mesh using CGAL..." and no > other indication that things are progressing and just want to be sure it is > still working. > > Why am I doing things this very painful way when I could just > rotate_extrude through 360 degrees? This is just a simple test case to see > if what I am doing will work. When I actually implement things I will have > the different slices each be slightly different. > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org > >
DS
Dan Shriver
Sun, Oct 9, 2016 5:00 PM

I want to make sure I understand your response.

When you say "tori" you don't mean each is a torus, but each is a slice of
a torus, right?

I'm trying to make a torus of 360 slices, the goal being that if I can do
that I can change each slice a little bit so the torus "morphs".

I have been doing this kind of thing with linear_extrude() and am just
doing a test here to make sure my approach with rotate_extrude() is correct.

You are indicating that  it will be slow and painful the way I'm doing it.
Is there any way inside of OpenSCAD for me to make it faster (like
rotate_extrude() does if it does the entire 360 itself) without decreasing
the number of slices?

On Sun, Oct 9, 2016 at 12:32 PM, nop head nop.head@gmail.com wrote:

The only thing you are asking CGAL to do is union 360 overlapping tori, so
that is what it will be trying to do. That will take a time approaching
infinity as union is very slow especially with overlapping shapes with lots
of vertices.

On 9 October 2016 at 17:05, Dan Shriver tabbydan@gmail.com wrote:

I know this is is somewhat of a bad question (because CGAL is a black
box...) but, even if the progress bar is a complete lie (which it usually
is for me) is there some way that I can tell that openSCAD is still doing
something and hasn't stopped?

I ask because I have some simple test code:

module testTorus() {
for (i = [0:360]) {
translate([(20cos(i)),(20sin(i)),0]) {
rotate_extrude(angle=1, convexity=10){
translate([20,20,0]) {
circle(r=10,$fn=5);
}
}
}
}
}

I ask it to run and I get "Rendering Polygon Mesh using CGAL..." and no
other indication that things are progressing and just want to be sure it is
still working.

Why am I doing things this very painful way when I could just
rotate_extrude through 360 degrees?  This is just a simple test case to see
if what I am doing will work.  When I actually implement things I will have
the different slices each be slightly different.


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

I want to make sure I understand your response. When you say "tori" you don't mean each is a torus, but each is a slice of a torus, right? I'm trying to make a torus of 360 slices, the goal being that if I can do that I can change each slice a little bit so the torus "morphs". I have been doing this kind of thing with linear_extrude() and am just doing a test here to make sure my approach with rotate_extrude() is correct. You are indicating that it will be slow and painful the way I'm doing it. Is there any way inside of OpenSCAD for me to make it faster (like rotate_extrude() does if it does the entire 360 itself) without decreasing the number of slices? On Sun, Oct 9, 2016 at 12:32 PM, nop head <nop.head@gmail.com> wrote: > The only thing you are asking CGAL to do is union 360 overlapping tori, so > that is what it will be trying to do. That will take a time approaching > infinity as union is very slow especially with overlapping shapes with lots > of vertices. > > On 9 October 2016 at 17:05, Dan Shriver <tabbydan@gmail.com> wrote: > >> I know this is is somewhat of a bad question (because CGAL is a black >> box...) but, even if the progress bar is a complete lie (which it usually >> is for me) is there some way that I can tell that openSCAD is still doing >> something and hasn't stopped? >> >> I ask because I have some simple test code: >> >> module testTorus() { >> for (i = [0:360]) { >> translate([(20*cos(i)),(20*sin(i)),0]) { >> rotate_extrude(angle=1, convexity=10){ >> translate([20,20,0]) { >> circle(r=10,$fn=5); >> } >> } >> } >> } >> } >> >> I ask it to run and I get "Rendering Polygon Mesh using CGAL..." and no >> other indication that things are progressing and just want to be sure it is >> still working. >> >> Why am I doing things this very painful way when I could just >> rotate_extrude through 360 degrees? This is just a simple test case to see >> if what I am doing will work. When I actually implement things I will have >> the different slices each be slightly different. >> >> _______________________________________________ >> 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 > >
NH
nop head
Sun, Oct 9, 2016 5:03 PM

The only way to make things like that fast is to generate lists of vertices
and faces and pass them to polyhedron. GCAL is too slow to union hundreds
of objects.

On 9 October 2016 at 18:00, Dan Shriver tabbydan@gmail.com wrote:

I want to make sure I understand your response.

When you say "tori" you don't mean each is a torus, but each is a slice of
a torus, right?

I'm trying to make a torus of 360 slices, the goal being that if I can do
that I can change each slice a little bit so the torus "morphs".

I have been doing this kind of thing with linear_extrude() and am just
doing a test here to make sure my approach with rotate_extrude() is correct.

You are indicating that  it will be slow and painful the way I'm doing
it.  Is there any way inside of OpenSCAD for me to make it faster (like
rotate_extrude() does if it does the entire 360 itself) without decreasing
the number of slices?

On Sun, Oct 9, 2016 at 12:32 PM, nop head nop.head@gmail.com wrote:

The only thing you are asking CGAL to do is union 360 overlapping tori,
so that is what it will be trying to do. That will take a time approaching
infinity as union is very slow especially with overlapping shapes with lots
of vertices.

On 9 October 2016 at 17:05, Dan Shriver tabbydan@gmail.com wrote:

I know this is is somewhat of a bad question (because CGAL is a black
box...) but, even if the progress bar is a complete lie (which it usually
is for me) is there some way that I can tell that openSCAD is still doing
something and hasn't stopped?

I ask because I have some simple test code:

module testTorus() {
for (i = [0:360]) {
translate([(20cos(i)),(20sin(i)),0]) {
rotate_extrude(angle=1, convexity=10){
translate([20,20,0]) {
circle(r=10,$fn=5);
}
}
}
}
}

I ask it to run and I get "Rendering Polygon Mesh using CGAL..." and no
other indication that things are progressing and just want to be sure it is
still working.

Why am I doing things this very painful way when I could just
rotate_extrude through 360 degrees?  This is just a simple test case to see
if what I am doing will work.  When I actually implement things I will have
the different slices each be slightly different.


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

The only way to make things like that fast is to generate lists of vertices and faces and pass them to polyhedron. GCAL is too slow to union hundreds of objects. On 9 October 2016 at 18:00, Dan Shriver <tabbydan@gmail.com> wrote: > I want to make sure I understand your response. > > When you say "tori" you don't mean each is a torus, but each is a slice of > a torus, right? > > I'm trying to make a torus of 360 slices, the goal being that if I can do > that I can change each slice a little bit so the torus "morphs". > > I have been doing this kind of thing with linear_extrude() and am just > doing a test here to make sure my approach with rotate_extrude() is correct. > > You are indicating that it will be slow and painful the way I'm doing > it. Is there any way inside of OpenSCAD for me to make it faster (like > rotate_extrude() does if it does the entire 360 itself) without decreasing > the number of slices? > > On Sun, Oct 9, 2016 at 12:32 PM, nop head <nop.head@gmail.com> wrote: > >> The only thing you are asking CGAL to do is union 360 overlapping tori, >> so that is what it will be trying to do. That will take a time approaching >> infinity as union is very slow especially with overlapping shapes with lots >> of vertices. >> >> On 9 October 2016 at 17:05, Dan Shriver <tabbydan@gmail.com> wrote: >> >>> I know this is is somewhat of a bad question (because CGAL is a black >>> box...) but, even if the progress bar is a complete lie (which it usually >>> is for me) is there some way that I can tell that openSCAD is still doing >>> something and hasn't stopped? >>> >>> I ask because I have some simple test code: >>> >>> module testTorus() { >>> for (i = [0:360]) { >>> translate([(20*cos(i)),(20*sin(i)),0]) { >>> rotate_extrude(angle=1, convexity=10){ >>> translate([20,20,0]) { >>> circle(r=10,$fn=5); >>> } >>> } >>> } >>> } >>> } >>> >>> I ask it to run and I get "Rendering Polygon Mesh using CGAL..." and no >>> other indication that things are progressing and just want to be sure it is >>> still working. >>> >>> Why am I doing things this very painful way when I could just >>> rotate_extrude through 360 degrees? This is just a simple test case to see >>> if what I am doing will work. When I actually implement things I will have >>> the different slices each be slightly different. >>> >>> _______________________________________________ >>> 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 > >
NH
nop head
Sun, Oct 9, 2016 5:05 PM

Yes they are only one degree slices of tori.

On 9 October 2016 at 18:03, nop head nop.head@gmail.com wrote:

The only way to make things like that fast is to generate lists of
vertices and faces and pass them to polyhedron. GCAL is too slow to union
hundreds of objects.

On 9 October 2016 at 18:00, Dan Shriver tabbydan@gmail.com wrote:

I want to make sure I understand your response.

When you say "tori" you don't mean each is a torus, but each is a slice
of a torus, right?

I'm trying to make a torus of 360 slices, the goal being that if I can do
that I can change each slice a little bit so the torus "morphs".

I have been doing this kind of thing with linear_extrude() and am just
doing a test here to make sure my approach with rotate_extrude() is correct.

You are indicating that  it will be slow and painful the way I'm doing
it.  Is there any way inside of OpenSCAD for me to make it faster (like
rotate_extrude() does if it does the entire 360 itself) without decreasing
the number of slices?

On Sun, Oct 9, 2016 at 12:32 PM, nop head nop.head@gmail.com wrote:

The only thing you are asking CGAL to do is union 360 overlapping tori,
so that is what it will be trying to do. That will take a time approaching
infinity as union is very slow especially with overlapping shapes with lots
of vertices.

On 9 October 2016 at 17:05, Dan Shriver tabbydan@gmail.com wrote:

I know this is is somewhat of a bad question (because CGAL is a black
box...) but, even if the progress bar is a complete lie (which it usually
is for me) is there some way that I can tell that openSCAD is still doing
something and hasn't stopped?

I ask because I have some simple test code:

module testTorus() {
for (i = [0:360]) {
translate([(20cos(i)),(20sin(i)),0]) {
rotate_extrude(angle=1, convexity=10){
translate([20,20,0]) {
circle(r=10,$fn=5);
}
}
}
}
}

I ask it to run and I get "Rendering Polygon Mesh using CGAL..." and no
other indication that things are progressing and just want to be sure it is
still working.

Why am I doing things this very painful way when I could just
rotate_extrude through 360 degrees?  This is just a simple test case to see
if what I am doing will work.  When I actually implement things I will have
the different slices each be slightly different.


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

Yes they are only one degree slices of tori. On 9 October 2016 at 18:03, nop head <nop.head@gmail.com> wrote: > The only way to make things like that fast is to generate lists of > vertices and faces and pass them to polyhedron. GCAL is too slow to union > hundreds of objects. > > On 9 October 2016 at 18:00, Dan Shriver <tabbydan@gmail.com> wrote: > >> I want to make sure I understand your response. >> >> When you say "tori" you don't mean each is a torus, but each is a slice >> of a torus, right? >> >> I'm trying to make a torus of 360 slices, the goal being that if I can do >> that I can change each slice a little bit so the torus "morphs". >> >> I have been doing this kind of thing with linear_extrude() and am just >> doing a test here to make sure my approach with rotate_extrude() is correct. >> >> You are indicating that it will be slow and painful the way I'm doing >> it. Is there any way inside of OpenSCAD for me to make it faster (like >> rotate_extrude() does if it does the entire 360 itself) without decreasing >> the number of slices? >> >> On Sun, Oct 9, 2016 at 12:32 PM, nop head <nop.head@gmail.com> wrote: >> >>> The only thing you are asking CGAL to do is union 360 overlapping tori, >>> so that is what it will be trying to do. That will take a time approaching >>> infinity as union is very slow especially with overlapping shapes with lots >>> of vertices. >>> >>> On 9 October 2016 at 17:05, Dan Shriver <tabbydan@gmail.com> wrote: >>> >>>> I know this is is somewhat of a bad question (because CGAL is a black >>>> box...) but, even if the progress bar is a complete lie (which it usually >>>> is for me) is there some way that I can tell that openSCAD is still doing >>>> something and hasn't stopped? >>>> >>>> I ask because I have some simple test code: >>>> >>>> module testTorus() { >>>> for (i = [0:360]) { >>>> translate([(20*cos(i)),(20*sin(i)),0]) { >>>> rotate_extrude(angle=1, convexity=10){ >>>> translate([20,20,0]) { >>>> circle(r=10,$fn=5); >>>> } >>>> } >>>> } >>>> } >>>> } >>>> >>>> I ask it to run and I get "Rendering Polygon Mesh using CGAL..." and no >>>> other indication that things are progressing and just want to be sure it is >>>> still working. >>>> >>>> Why am I doing things this very painful way when I could just >>>> rotate_extrude through 360 degrees? This is just a simple test case to see >>>> if what I am doing will work. When I actually implement things I will have >>>> the different slices each be slightly different. >>>> >>>> _______________________________________________ >>>> 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 >> >> >
DS
Dan Shriver
Sun, Oct 9, 2016 5:15 PM

Is it also bad to use linear_extrude() in such a manner?
I've been doing that for some programs where I make very thin slices that
change slightly.
Those programs run slowly too, but not quite this slowly.

I do have a  list of verticies but I may need some help in generating a
toroidal slice (given that it is slightly thicker further away from the z
axis, and my list of points is not necessarily simple).

On Sun, Oct 9, 2016 at 1:05 PM, nop head nop.head@gmail.com wrote:

Yes they are only one degree slices of tori.

On 9 October 2016 at 18:03, nop head nop.head@gmail.com wrote:

The only way to make things like that fast is to generate lists of
vertices and faces and pass them to polyhedron. GCAL is too slow to union
hundreds of objects.

On 9 October 2016 at 18:00, Dan Shriver tabbydan@gmail.com wrote:

I want to make sure I understand your response.

When you say "tori" you don't mean each is a torus, but each is a slice
of a torus, right?

I'm trying to make a torus of 360 slices, the goal being that if I can
do that I can change each slice a little bit so the torus "morphs".

I have been doing this kind of thing with linear_extrude() and am just
doing a test here to make sure my approach with rotate_extrude() is correct.

You are indicating that  it will be slow and painful the way I'm doing
it.  Is there any way inside of OpenSCAD for me to make it faster (like
rotate_extrude() does if it does the entire 360 itself) without decreasing
the number of slices?

On Sun, Oct 9, 2016 at 12:32 PM, nop head nop.head@gmail.com wrote:

The only thing you are asking CGAL to do is union 360 overlapping tori,
so that is what it will be trying to do. That will take a time approaching
infinity as union is very slow especially with overlapping shapes with lots
of vertices.

On 9 October 2016 at 17:05, Dan Shriver tabbydan@gmail.com wrote:

I know this is is somewhat of a bad question (because CGAL is a black
box...) but, even if the progress bar is a complete lie (which it usually
is for me) is there some way that I can tell that openSCAD is still doing
something and hasn't stopped?

I ask because I have some simple test code:

module testTorus() {
for (i = [0:360]) {
translate([(20cos(i)),(20sin(i)),0]) {
rotate_extrude(angle=1, convexity=10){
translate([20,20,0]) {
circle(r=10,$fn=5);
}
}
}
}
}

I ask it to run and I get "Rendering Polygon Mesh using CGAL..." and
no other indication that things are progressing and just want to be sure it
is still working.

Why am I doing things this very painful way when I could just
rotate_extrude through 360 degrees?  This is just a simple test case to see
if what I am doing will work.  When I actually implement things I will have
the different slices each be slightly different.


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

Is it also bad to use linear_extrude() in such a manner? I've been doing that for some programs where I make very thin slices that change slightly. Those programs run slowly too, but not quite this slowly. I do have a list of verticies but I may need some help in generating a toroidal slice (given that it is slightly thicker further away from the z axis, and my list of points is not necessarily simple). On Sun, Oct 9, 2016 at 1:05 PM, nop head <nop.head@gmail.com> wrote: > Yes they are only one degree slices of tori. > > On 9 October 2016 at 18:03, nop head <nop.head@gmail.com> wrote: > >> The only way to make things like that fast is to generate lists of >> vertices and faces and pass them to polyhedron. GCAL is too slow to union >> hundreds of objects. >> >> On 9 October 2016 at 18:00, Dan Shriver <tabbydan@gmail.com> wrote: >> >>> I want to make sure I understand your response. >>> >>> When you say "tori" you don't mean each is a torus, but each is a slice >>> of a torus, right? >>> >>> I'm trying to make a torus of 360 slices, the goal being that if I can >>> do that I can change each slice a little bit so the torus "morphs". >>> >>> I have been doing this kind of thing with linear_extrude() and am just >>> doing a test here to make sure my approach with rotate_extrude() is correct. >>> >>> You are indicating that it will be slow and painful the way I'm doing >>> it. Is there any way inside of OpenSCAD for me to make it faster (like >>> rotate_extrude() does if it does the entire 360 itself) without decreasing >>> the number of slices? >>> >>> On Sun, Oct 9, 2016 at 12:32 PM, nop head <nop.head@gmail.com> wrote: >>> >>>> The only thing you are asking CGAL to do is union 360 overlapping tori, >>>> so that is what it will be trying to do. That will take a time approaching >>>> infinity as union is very slow especially with overlapping shapes with lots >>>> of vertices. >>>> >>>> On 9 October 2016 at 17:05, Dan Shriver <tabbydan@gmail.com> wrote: >>>> >>>>> I know this is is somewhat of a bad question (because CGAL is a black >>>>> box...) but, even if the progress bar is a complete lie (which it usually >>>>> is for me) is there some way that I can tell that openSCAD is still doing >>>>> something and hasn't stopped? >>>>> >>>>> I ask because I have some simple test code: >>>>> >>>>> module testTorus() { >>>>> for (i = [0:360]) { >>>>> translate([(20*cos(i)),(20*sin(i)),0]) { >>>>> rotate_extrude(angle=1, convexity=10){ >>>>> translate([20,20,0]) { >>>>> circle(r=10,$fn=5); >>>>> } >>>>> } >>>>> } >>>>> } >>>>> } >>>>> >>>>> I ask it to run and I get "Rendering Polygon Mesh using CGAL..." and >>>>> no other indication that things are progressing and just want to be sure it >>>>> is still working. >>>>> >>>>> Why am I doing things this very painful way when I could just >>>>> rotate_extrude through 360 degrees? This is just a simple test case to see >>>>> if what I am doing will work. When I actually implement things I will have >>>>> the different slices each be slightly different. >>>>> >>>>> _______________________________________________ >>>>> 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 >>> >>> >> > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org > >
NH
nop head
Sun, Oct 9, 2016 5:24 PM

Actually the version of OpenScad I use doesn't have an angle parameter so
they are full tori.

Linear extrude is fast because it doesn't use CGAL, but unioning anything
with lots of vertices is very slow.

To make a torus you need to just rotate flat sections of vertices and
connect them together with pairs of triangles to make the faces of the
tube. The rotation of the flat points takes care of the faces being bigger
further from the Z axis. See previous discussions about making 3D knots.

On 9 October 2016 at 18:05, nop head nop.head@gmail.com wrote:

Yes they are only one degree slices of tori.

On 9 October 2016 at 18:03, nop head nop.head@gmail.com wrote:

The only way to make things like that fast is to generate lists of
vertices and faces and pass them to polyhedron. GCAL is too slow to union
hundreds of objects.

On 9 October 2016 at 18:00, Dan Shriver tabbydan@gmail.com wrote:

I want to make sure I understand your response.

When you say "tori" you don't mean each is a torus, but each is a slice
of a torus, right?

I'm trying to make a torus of 360 slices, the goal being that if I can
do that I can change each slice a little bit so the torus "morphs".

I have been doing this kind of thing with linear_extrude() and am just
doing a test here to make sure my approach with rotate_extrude() is correct.

You are indicating that  it will be slow and painful the way I'm doing
it.  Is there any way inside of OpenSCAD for me to make it faster (like
rotate_extrude() does if it does the entire 360 itself) without decreasing
the number of slices?

On Sun, Oct 9, 2016 at 12:32 PM, nop head nop.head@gmail.com wrote:

The only thing you are asking CGAL to do is union 360 overlapping tori,
so that is what it will be trying to do. That will take a time approaching
infinity as union is very slow especially with overlapping shapes with lots
of vertices.

On 9 October 2016 at 17:05, Dan Shriver tabbydan@gmail.com wrote:

I know this is is somewhat of a bad question (because CGAL is a black
box...) but, even if the progress bar is a complete lie (which it usually
is for me) is there some way that I can tell that openSCAD is still doing
something and hasn't stopped?

I ask because I have some simple test code:

module testTorus() {
for (i = [0:360]) {
translate([(20cos(i)),(20sin(i)),0]) {
rotate_extrude(angle=1, convexity=10){
translate([20,20,0]) {
circle(r=10,$fn=5);
}
}
}
}
}

I ask it to run and I get "Rendering Polygon Mesh using CGAL..." and
no other indication that things are progressing and just want to be sure it
is still working.

Why am I doing things this very painful way when I could just
rotate_extrude through 360 degrees?  This is just a simple test case to see
if what I am doing will work.  When I actually implement things I will have
the different slices each be slightly different.


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

Actually the version of OpenScad I use doesn't have an angle parameter so they are full tori. Linear extrude is fast because it doesn't use CGAL, but unioning anything with lots of vertices is very slow. To make a torus you need to just rotate flat sections of vertices and connect them together with pairs of triangles to make the faces of the tube. The rotation of the flat points takes care of the faces being bigger further from the Z axis. See previous discussions about making 3D knots. On 9 October 2016 at 18:05, nop head <nop.head@gmail.com> wrote: > Yes they are only one degree slices of tori. > > On 9 October 2016 at 18:03, nop head <nop.head@gmail.com> wrote: > >> The only way to make things like that fast is to generate lists of >> vertices and faces and pass them to polyhedron. GCAL is too slow to union >> hundreds of objects. >> >> On 9 October 2016 at 18:00, Dan Shriver <tabbydan@gmail.com> wrote: >> >>> I want to make sure I understand your response. >>> >>> When you say "tori" you don't mean each is a torus, but each is a slice >>> of a torus, right? >>> >>> I'm trying to make a torus of 360 slices, the goal being that if I can >>> do that I can change each slice a little bit so the torus "morphs". >>> >>> I have been doing this kind of thing with linear_extrude() and am just >>> doing a test here to make sure my approach with rotate_extrude() is correct. >>> >>> You are indicating that it will be slow and painful the way I'm doing >>> it. Is there any way inside of OpenSCAD for me to make it faster (like >>> rotate_extrude() does if it does the entire 360 itself) without decreasing >>> the number of slices? >>> >>> On Sun, Oct 9, 2016 at 12:32 PM, nop head <nop.head@gmail.com> wrote: >>> >>>> The only thing you are asking CGAL to do is union 360 overlapping tori, >>>> so that is what it will be trying to do. That will take a time approaching >>>> infinity as union is very slow especially with overlapping shapes with lots >>>> of vertices. >>>> >>>> On 9 October 2016 at 17:05, Dan Shriver <tabbydan@gmail.com> wrote: >>>> >>>>> I know this is is somewhat of a bad question (because CGAL is a black >>>>> box...) but, even if the progress bar is a complete lie (which it usually >>>>> is for me) is there some way that I can tell that openSCAD is still doing >>>>> something and hasn't stopped? >>>>> >>>>> I ask because I have some simple test code: >>>>> >>>>> module testTorus() { >>>>> for (i = [0:360]) { >>>>> translate([(20*cos(i)),(20*sin(i)),0]) { >>>>> rotate_extrude(angle=1, convexity=10){ >>>>> translate([20,20,0]) { >>>>> circle(r=10,$fn=5); >>>>> } >>>>> } >>>>> } >>>>> } >>>>> } >>>>> >>>>> I ask it to run and I get "Rendering Polygon Mesh using CGAL..." and >>>>> no other indication that things are progressing and just want to be sure it >>>>> is still working. >>>>> >>>>> Why am I doing things this very painful way when I could just >>>>> rotate_extrude through 360 degrees? This is just a simple test case to see >>>>> if what I am doing will work. When I actually implement things I will have >>>>> the different slices each be slightly different. >>>>> >>>>> _______________________________________________ >>>>> 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 >>> >>> >> >
W
wolf
Sun, Oct 9, 2016 10:34 PM

You are expecting to write a program taking a long time to render on
OpenSCAD. How fast do you want to be? And how much support do you expect
from your software to create your shape in? If you want and need lots of
support, ignore what I am saying, use OpenSCAD, and what my fellow
contributors have to say here on this forum.

If you are truly interested in speed and can think on your own, the
following will give you means of obtaining just that speed.
First, understand that OpenSCAD is slow by design, if not by intent. It uses
the functional programming paradigm, meaning that the smallest assembly
level programming step requires at least three cycles of the CPU clock:
1.fetch some data from memory and put it into a register, 2.work on it, 3.
write the result to memory. And because ordinary memory is much slower than
the CPU, memory access is buffered by caches, So, if you use large caches,
your computer's level 1 cache (the only cache that can match the speed of
the CPU, but is rather limited in size) overflows, and the CPU must add
extra clock cycles waiting for the data to be fetched. With imperative
programming, you can keep your data in memory and need not do step 3. That
already makes your program run faster. Additionally, you waste less level 1
cache space, since all writes to memory and, eventually, the hard disk,
moves through the level 1 cache, and your CPU need not wait as much for data
to arrive. So you again gain speed.

Thus, for the fastest rendering speed, you forget about OpenSCAD and use an
imperative language like C or Pascal. This gives you the best speed (I have
achieved speedups of up to 30000 (thirty thousand) times where I used that
approach.) Major disadvantage of this approach is that you also have to
figure out a means to write an .stl file to disk - not too difficult a task.
In my case, writing to disk a 200000 facet file took longer than rendering
it. For viewing your file I would suggest you use MeshLab, as OpenSCAD is
just too slow.

For an intermediate approach, may I suggest you look at the code I reported
in my second posting in
http://forum.openscad.org/Improve-rendering-speed-td17580.html#a17613. The
idea is simple: create polygons (I call them slices, function CircularSlice)
and arrange them in space (function TiltSlice_X and function MoveSlice).
Once the polygons are where you want them, connect them into two lists of,
first,  vertices, and then faces. Finally, call polyhedron() and create your
shape.

What you should never do is use boolean operations inside a loop, that
creates very long rendering times. The problem here is not that CGAL (the
library that OpenSCAD uses to render) is very slow - that is just another
excuse by the OpenSCAD developers. The problem is that if you want to
calculate the coordinates of the point or line at which two facets
intersect, you have to divide by the tangens of the intersection angle. And
for perfectly smooth intersections, that angle is 180 degrees, and its
tangens is zero. You get the problem? You have to find a way to do a
division by zero. OpenSCAD "solves" that (more correctly, covers it up) with
the $fn directive. The smaller $fn, the less smooth is your shape, the more
is the actual intersecting angle away from 180 degree, and the smaller are
the demands on numerical accuracy. CGAL tackles the demands on numerical
accuracy by not relying on the physical size of registers at all. Rather, it
uses what is called "Arbitrary Precision Arithmetic", which allows to do
numerical operations at any accuracy you may desire. The price for that is
execution time - the extra precision may easily slow down the computer by a
factor of 1000. Both OpenSCAD and CGAL rely on boolean operations.

If you can think outside the box far enough to realize there are other
mathematics operations that deal with division by zero, you are on track to
understand what I am doing. As far as I know set theory, it can demonstrate
that, in general, the result of a division by zero is undefined. But set
theory cannot and does not show whether there are  exceptions from this
rule. And these exceptions do exist. If you are familiar with Calculus, you
know one branch of mathematics that routinely does divisions by zero.
The program I suggested does that division by zero by falling back upon
Calculus (that's why I call it a Reverse Slicer), or more accurately, by
falling back upon epsilontics, a branch of mathematics that deals explicitly
with divisions by zero. As such, I don't need arbitrary precision
arithmetic, and thus can replace unions with something much faster than what
OpenSCAD uses. But currently I do not attempt to do differences or
intersections.  First, I need to deal with the other nonsense that is
lurking under the surface of OpenSCAD and that (some?) of the developers /
users on this forum are so hard-set to keep.
To give you an idea on speed that has been achieved: Hull() is somewhat
faster, about twice as fast as union() for the cases I investigated (two
hours for union(), one hour for hull(), 11 seconds for above program, 0.1
seconds when doing it outside OpenSCAD). The 2D functions OpenSCAD offers I
have never tried, they are too limited for my purposes.
wolf

--
View this message in context: http://forum.openscad.org/How-can-I-tell-what-OpenSCAD-is-doing-tp18632p18639.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

You are expecting to write a program taking a long time to render on OpenSCAD. How fast do you want to be? And how much support do you expect from your software to create your shape in? If you want and need lots of support, ignore what I am saying, use OpenSCAD, and what my fellow contributors have to say here on this forum. If you are truly interested in speed and can think on your own, the following will give you means of obtaining just that speed. First, understand that OpenSCAD is slow by design, if not by intent. It uses the functional programming paradigm, meaning that the smallest assembly level programming step requires at least three cycles of the CPU clock: 1.fetch some data from memory and put it into a register, 2.work on it, 3. write the result to memory. And because ordinary memory is much slower than the CPU, memory access is buffered by caches, So, if you use large caches, your computer's level 1 cache (the only cache that can match the speed of the CPU, but is rather limited in size) overflows, and the CPU must add extra clock cycles waiting for the data to be fetched. With imperative programming, you can keep your data in memory and need not do step 3. That already makes your program run faster. Additionally, you waste less level 1 cache space, since all writes to memory and, eventually, the hard disk, moves through the level 1 cache, and your CPU need not wait as much for data to arrive. So you again gain speed. Thus, for the fastest rendering speed, you forget about OpenSCAD and use an imperative language like C or Pascal. This gives you the best speed (I have achieved speedups of up to 30000 (thirty thousand) times where I used that approach.) Major disadvantage of this approach is that you also have to figure out a means to write an .stl file to disk - not too difficult a task. In my case, writing to disk a 200000 facet file took longer than rendering it. For viewing your file I would suggest you use MeshLab, as OpenSCAD is just too slow. For an intermediate approach, may I suggest you look at the code I reported in my second posting in http://forum.openscad.org/Improve-rendering-speed-td17580.html#a17613. The idea is simple: create polygons (I call them slices, function CircularSlice) and arrange them in space (function TiltSlice_X and function MoveSlice). Once the polygons are where you want them, connect them into two lists of, first, vertices, and then faces. Finally, call polyhedron() and create your shape. What you should never do is use boolean operations inside a loop, that creates very long rendering times. The problem here is not that CGAL (the library that OpenSCAD uses to render) is very slow - that is just another excuse by the OpenSCAD developers. The problem is that if you want to calculate the coordinates of the point or line at which two facets intersect, you have to divide by the tangens of the intersection angle. And for perfectly smooth intersections, that angle is 180 degrees, and its tangens is zero. You get the problem? You have to find a way to do a division by zero. OpenSCAD "solves" that (more correctly, covers it up) with the $fn directive. The smaller $fn, the less smooth is your shape, the more is the actual intersecting angle away from 180 degree, and the smaller are the demands on numerical accuracy. CGAL tackles the demands on numerical accuracy by not relying on the physical size of registers at all. Rather, it uses what is called "Arbitrary Precision Arithmetic", which allows to do numerical operations at any accuracy you may desire. The price for that is execution time - the extra precision may easily slow down the computer by a factor of 1000. Both OpenSCAD and CGAL rely on boolean operations. If you can think outside the box far enough to realize there are other mathematics operations that deal with division by zero, you are on track to understand what I am doing. As far as I know set theory, it can demonstrate that, in general, the result of a division by zero is undefined. But set theory cannot and does not show whether there are exceptions from this rule. And these exceptions do exist. If you are familiar with Calculus, you know one branch of mathematics that routinely does divisions by zero. The program I suggested does that division by zero by falling back upon Calculus (that's why I call it a Reverse Slicer), or more accurately, by falling back upon epsilontics, a branch of mathematics that deals explicitly with divisions by zero. As such, I don't need arbitrary precision arithmetic, and thus can replace unions with something much faster than what OpenSCAD uses. But currently I do not attempt to do differences or intersections. First, I need to deal with the other nonsense that is lurking under the surface of OpenSCAD and that (some?) of the developers / users on this forum are so hard-set to keep. To give you an idea on speed that has been achieved: Hull() is somewhat faster, about twice as fast as union() for the cases I investigated (two hours for union(), one hour for hull(), 11 seconds for above program, 0.1 seconds when doing it outside OpenSCAD). The 2D functions OpenSCAD offers I have never tried, they are too limited for my purposes. wolf -- View this message in context: http://forum.openscad.org/How-can-I-tell-what-OpenSCAD-is-doing-tp18632p18639.html Sent from the OpenSCAD mailing list archive at Nabble.com.
P
Parkinbot
Mon, Oct 10, 2016 9:31 AM

wolf wrote

Thus, for the fastest rendering speed, you forget about OpenSCAD and use
an imperative language like C or Pascal. This gives you the best speed (I
have achieved speedups of up to 30000 (thirty thousand) times where I used
that approach.) Major disadvantage of this approach is that you also have
to figure out a means to write an .stl file to disk - not too difficult a
task. In my case, writing to disk a 200000 facet file took longer than
rendering it. For viewing your file I would suggest you use MeshLab, as
OpenSCAD is just too slow.

Again, and again you propagate this wild approach. High level approaches are
versatile but slow. Hardcoding a problem with C or Assembler will of course
be faster in execution. But it can take hours, days, weeks to code such a
special solution. And any attempt to alter your design later on will bring
you back to start forcing you to reinvent the wheel again an again. Might be
fun for you, but not for others.
The stuff you are presenting is special cases and will work for
non-self-intersecting designs only. As soon as non-linear extrusion comes
into play you either have to go the VERY HARD way and implement Boolean
operations on your own (this is what CGAL mainly is used for), or you use
some tricky code to treat self-intersections (SI) that are known by analytic
means.

This, at least from an OpenSCAD perspective, FAST code will give you an
example: http://www.thingiverse.com/thing:1659079. It combines a general
(ignorant) sweep with a union to get around a pre-analyzed SI problem in a
viable way.

Rudolf

--
View this message in context: http://forum.openscad.org/How-can-I-tell-what-OpenSCAD-is-doing-tp18632p18646.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

wolf wrote > Thus, for the fastest rendering speed, you forget about OpenSCAD and use > an imperative language like C or Pascal. This gives you the best speed (I > have achieved speedups of up to 30000 (thirty thousand) times where I used > that approach.) Major disadvantage of this approach is that you also have > to figure out a means to write an .stl file to disk - not too difficult a > task. In my case, writing to disk a 200000 facet file took longer than > rendering it. For viewing your file I would suggest you use MeshLab, as > OpenSCAD is just too slow. Again, and again you propagate this wild approach. High level approaches are versatile but slow. Hardcoding a problem with C or Assembler will of course be faster in execution. But it can take hours, days, weeks to code such a special solution. And any attempt to alter your design later on will bring you back to start forcing you to reinvent the wheel again an again. Might be fun for you, but not for others. The stuff you are presenting is special cases and will work for non-self-intersecting designs only. As soon as non-linear extrusion comes into play you either have to go the VERY HARD way and implement Boolean operations on your own (this is what CGAL mainly is used for), or you use some tricky code to treat self-intersections (SI) that are known by analytic means. This, at least from an OpenSCAD perspective, FAST code will give you an example: http://www.thingiverse.com/thing:1659079. It combines a general (ignorant) sweep with a union to get around a pre-analyzed SI problem in a viable way. Rudolf -- View this message in context: http://forum.openscad.org/How-can-I-tell-what-OpenSCAD-is-doing-tp18632p18646.html Sent from the OpenSCAD mailing list archive at Nabble.com.
NH
nop head
Mon, Oct 10, 2016 12:50 PM

Going back to the OP, unless I misunderstand the intention, the slices
should be rotated into position, not translated with sine / cosine
coordinates.

On 10 October 2016 at 10:31, Parkinbot rudolf@parkinbot.com wrote:

wolf wrote

Thus, for the fastest rendering speed, you forget about OpenSCAD and use
an imperative language like C or Pascal. This gives you the best speed (I
have achieved speedups of up to 30000 (thirty thousand) times where I

used

that approach.) Major disadvantage of this approach is that you also have
to figure out a means to write an .stl file to disk - not too difficult a
task. In my case, writing to disk a 200000 facet file took longer than
rendering it. For viewing your file I would suggest you use MeshLab, as
OpenSCAD is just too slow.

Again, and again you propagate this wild approach. High level approaches
are
versatile but slow. Hardcoding a problem with C or Assembler will of course
be faster in execution. But it can take hours, days, weeks to code such a
special solution. And any attempt to alter your design later on will bring
you back to start forcing you to reinvent the wheel again an again. Might
be
fun for you, but not for others.
The stuff you are presenting is special cases and will work for
non-self-intersecting designs only. As soon as non-linear extrusion comes
into play you either have to go the VERY HARD way and implement Boolean
operations on your own (this is what CGAL mainly is used for), or you use
some tricky code to treat self-intersections (SI) that are known by
analytic
means.

This, at least from an OpenSCAD perspective, FAST code will give you an
example: http://www.thingiverse.com/thing:1659079. It combines a general
(ignorant) sweep with a union to get around a pre-analyzed SI problem in a
viable way.

Rudolf

--
View this message in context: http://forum.openscad.org/How-
can-I-tell-what-OpenSCAD-is-doing-tp18632p18646.html
Sent from the OpenSCAD mailing list archive at Nabble.com.


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

Going back to the OP, unless I misunderstand the intention, the slices should be rotated into position, not translated with sine / cosine coordinates. On 10 October 2016 at 10:31, Parkinbot <rudolf@parkinbot.com> wrote: > wolf wrote > > Thus, for the fastest rendering speed, you forget about OpenSCAD and use > > an imperative language like C or Pascal. This gives you the best speed (I > > have achieved speedups of up to 30000 (thirty thousand) times where I > used > > that approach.) Major disadvantage of this approach is that you also have > > to figure out a means to write an .stl file to disk - not too difficult a > > task. In my case, writing to disk a 200000 facet file took longer than > > rendering it. For viewing your file I would suggest you use MeshLab, as > > OpenSCAD is just too slow. > > Again, and again you propagate this wild approach. High level approaches > are > versatile but slow. Hardcoding a problem with C or Assembler will of course > be faster in execution. But it can take hours, days, weeks to code such a > special solution. And any attempt to alter your design later on will bring > you back to start forcing you to reinvent the wheel again an again. Might > be > fun for you, but not for others. > The stuff you are presenting is special cases and will work for > non-self-intersecting designs only. As soon as non-linear extrusion comes > into play you either have to go the VERY HARD way and implement Boolean > operations on your own (this is what CGAL mainly is used for), or you use > some tricky code to treat self-intersections (SI) that are known by > analytic > means. > > This, at least from an OpenSCAD perspective, FAST code will give you an > example: http://www.thingiverse.com/thing:1659079. It combines a general > (ignorant) sweep with a union to get around a pre-analyzed SI problem in a > viable way. > > Rudolf > > > > > > -- > View this message in context: http://forum.openscad.org/How- > can-I-tell-what-OpenSCAD-is-doing-tp18632p18646.html > Sent from the OpenSCAD mailing list archive at Nabble.com. > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >