discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

How can I tell what OpenSCAD is doing?

P
Parkinbot
Mon, Oct 10, 2016 2:14 PM

nophead wrote

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

I would say the OP was a rotate_extrude with a twist. A similar question in
an other thread was how to produce a satellite twist within a twisted
linear_extrude.

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

nophead wrote > Going back to the OP, unless I misunderstand the intention, the slices > should be rotated into position, not translated with sine / cosine > coordinates. I would say the OP was a rotate_extrude with a twist. A similar question in an other thread was how to produce a satellite twist within a twisted linear_extrude. -- View this message in context: http://forum.openscad.org/How-can-I-tell-what-OpenSCAD-is-doing-tp18632p18650.html Sent from the OpenSCAD mailing list archive at Nabble.com.
NH
nop head
Mon, Oct 10, 2016 2:46 PM

I can't test it because I don't have a an angle parameter but it seems like
it would make 360 1 degree slices of a torus and place them in a circle.
The problem is they will all be oriented at the same angle, so will not
join up to form a torus.

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

nophead wrote

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

I would say the OP was a rotate_extrude with a twist. A similar question in
an other thread was how to produce a satellite twist within a twisted
linear_extrude.

--
View this message in context: http://forum.openscad.org/How-
can-I-tell-what-OpenSCAD-is-doing-tp18632p18650.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

I can't test it because I don't have a an angle parameter but it seems like it would make 360 1 degree slices of a torus and place them in a circle. The problem is they will all be oriented at the same angle, so will not join up to form a torus. On 10 October 2016 at 15:14, Parkinbot <rudolf@parkinbot.com> wrote: > nophead wrote > > Going back to the OP, unless I misunderstand the intention, the slices > > should be rotated into position, not translated with sine / cosine > > coordinates. > > > I would say the OP was a rotate_extrude with a twist. A similar question in > an other thread was how to produce a satellite twist within a twisted > linear_extrude. > > > > > -- > View this message in context: http://forum.openscad.org/How- > can-I-tell-what-OpenSCAD-is-doing-tp18632p18650.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 >
P
Parkinbot
Mon, Oct 10, 2016 2:54 PM

I understood it as some kind of exercise. Let's say the sin/cos part is meant
to produce a rotation. Doing that properly you'd get some (rough) moebius
code

testTorus();
twists = 3;
// twists = 1;
module testTorus() {
step = 1;
for (i = [0:step:360])
rotate([0, 0, i])
rotate_extrude(angle=step, convexity=10){
translate([20,0,0])
//rotate([0, 0, i/2twists]) square([1,30], center=true);
rotate([0, 0, i/4
twists]) circle(10, $fn=4);
}
}

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

to get
http://forum.openscad.org/file/n18652/Unbenannt1.png

As results are unions of rough interpolations it will be fruitless (and a
waste of CPU-time) to F6-render code like this.

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

I understood it as some kind of exercise. Let's say the sin/cos part is meant to produce a rotation. Doing that properly you'd get some (rough) moebius code > testTorus(); > twists = 3; > // twists = 1; > module testTorus() { > step = 1; > for (i = [0:step:360]) > rotate([0, 0, i]) > rotate_extrude(angle=step, convexity=10){ > translate([20,0,0]) > //rotate([0, 0, i/2*twists]) square([1,30], center=true); > rotate([0, 0, i/4*twists]) circle(10, $fn=4); > } > } <http://forum.openscad.org/file/n18652/Unbenannt.png> <http://forum.openscad.org/file/n18652/Unbenannt2.png> or look at this hypocyloide approach > testTorus(); > module testTorus() { > step = 1; > for (i = [0:step:360]) > rotate([0, 0, i]) > rotate_extrude(angle=step, convexity=10){ > translate([20+5*sin(2*i),0,0]) > circle(10, $fn=4); > } > } to get <http://forum.openscad.org/file/n18652/Unbenannt1.png> As results are unions of rough interpolations it will be fruitless (and a waste of CPU-time) to F6-render code like this. -- View this message in context: http://forum.openscad.org/How-can-I-tell-what-OpenSCAD-is-doing-tp18632p18652.html Sent from the OpenSCAD mailing list archive at Nabble.com.
DS
Dan Shriver
Mon, Oct 10, 2016 3:22 PM

Yes it is a debugging/ proof of concept exercise.

In the real code each slice would vary a little.

But, aside from being wrong it blows up.  So i'll need to do it as
verticies instead.  Do I need to tell OpenSCAD how to form triangles or
does it automatically do that between adjacent polygon slices?

Also I'll probably want to do this instead of linear extruder too since
that now takes 8 hours....
On Oct 10, 2016 10:55 AM, "Parkinbot" rudolf@parkinbot.com wrote:

I understood it as some kind of exercise. Let's say the sin/cos part is
meant
to produce a rotation. Doing that properly you'd get some (rough) moebius
code

testTorus();
twists = 3;
// twists = 1;
module testTorus() {
step = 1;
for (i = [0:step:360])
rotate([0, 0, i])
rotate_extrude(angle=step, convexity=10){
translate([20,0,0])
//rotate([0, 0, i/2twists]) square([1,30], center=true);
rotate([0, 0, i/4
twists]) circle(10, $fn=4);
}
}

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

to get
http://forum.openscad.org/file/n18652/Unbenannt1.png

As results are unions of rough interpolations it will be fruitless (and a
waste of CPU-time) to F6-render code like this.

--
View this message in context: http://forum.openscad.org/How-
can-I-tell-what-OpenSCAD-is-doing-tp18632p18652.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

Yes it is a debugging/ proof of concept exercise. In the real code each slice would vary a little. But, aside from being wrong it blows up. So i'll need to do it as verticies instead. Do I need to tell OpenSCAD how to form triangles or does it automatically do that between adjacent polygon slices? Also I'll probably want to do this instead of linear extruder too since that now takes 8 hours.... On Oct 10, 2016 10:55 AM, "Parkinbot" <rudolf@parkinbot.com> wrote: > I understood it as some kind of exercise. Let's say the sin/cos part is > meant > to produce a rotation. Doing that properly you'd get some (rough) moebius > code > > > > testTorus(); > > twists = 3; > > // twists = 1; > > module testTorus() { > > step = 1; > > for (i = [0:step:360]) > > rotate([0, 0, i]) > > rotate_extrude(angle=step, convexity=10){ > > translate([20,0,0]) > > //rotate([0, 0, i/2*twists]) square([1,30], center=true); > > rotate([0, 0, i/4*twists]) circle(10, $fn=4); > > } > > } > > <http://forum.openscad.org/file/n18652/Unbenannt.png> > <http://forum.openscad.org/file/n18652/Unbenannt2.png> > > or look at this hypocyloide approach > > > > testTorus(); > > module testTorus() { > > step = 1; > > for (i = [0:step:360]) > > rotate([0, 0, i]) > > rotate_extrude(angle=step, convexity=10){ > > translate([20+5*sin(2*i),0,0]) > > circle(10, $fn=4); > > } > > } > > to get > <http://forum.openscad.org/file/n18652/Unbenannt1.png> > > As results are unions of rough interpolations it will be fruitless (and a > waste of CPU-time) to F6-render code like this. > > > > > > -- > View this message in context: http://forum.openscad.org/How- > can-I-tell-what-OpenSCAD-is-doing-tp18632p18652.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 >
P
Parkinbot
Mon, Oct 10, 2016 5:31 PM

DanS wrote

Do I need to tell OpenSCAD how to form triangles or
does it automatically do that between adjacent polygon slices?

Yes and no!
For the yes-part: Yes, you need to define a proper polyhedron to get your
fancy 3D object.
For the no-part: No, in many cases, like for general extrusion, you can use
sweep(), or skin() (which is equivalent) functionality. Have a look at the
"Threading" reference at Thingiverse I gave.

You feed sweep()/skin() with a vector of polygons (living in 3D) that
describe your "thing" by a series of slices. Each "polygon" is represented
as a vector of 3D points and has to be properly positioned in space, so that
neither two polygons intersect. How you to get this? Define the polygon as
2D and then use affine transformations (translations, rotations, and
scaling) to place it into 3D. There is no test for self-intersection. This
is your own responsibility.
Sweep() will connect all polygons into a polyhedron and do the hard work for
you. While this approach is quite mighty, you can only model
non-self-intersecting extrusions with it. For a donut you'd produce to
half-donuts and union them together. This is, what I did for the Threadings.

Rudolf

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

DanS wrote > Do I need to tell OpenSCAD how to form triangles or > does it automatically do that between adjacent polygon slices? Yes and no! For the yes-part: Yes, you need to define a proper polyhedron to get your fancy 3D object. For the no-part: No, in many cases, like for general extrusion, you can use sweep(), or skin() (which is equivalent) functionality. Have a look at the "Threading" reference at Thingiverse I gave. You feed sweep()/skin() with a vector of polygons (living in 3D) that describe your "thing" by a series of slices. Each "polygon" is represented as a vector of 3D points and has to be properly positioned in space, so that neither two polygons intersect. How you to get this? Define the polygon as 2D and then use affine transformations (translations, rotations, and scaling) to place it into 3D. There is no test for self-intersection. This is your own responsibility. Sweep() will connect all polygons into a polyhedron and do the hard work for you. While this approach is quite mighty, you can only model non-self-intersecting extrusions with it. For a donut you'd produce to half-donuts and union them together. This is, what I did for the Threadings. Rudolf -- View this message in context: http://forum.openscad.org/How-can-I-tell-what-OpenSCAD-is-doing-tp18632p18657.html Sent from the OpenSCAD mailing list archive at Nabble.com.
RP
Ronaldo Persiano
Mon, Oct 10, 2016 6:49 PM

2016-10-10 14:31 GMT-03:00 Parkinbot rudolf@parkinbot.com:

Sweep() will connect all polygons into a polyhedron and do the hard work
for
you. While this approach is quite mighty, you can only model
non-self-intersecting extrusions with it. For a donut you'd produce to
half-donuts and union them together. This is, what I did for the
Threadings.

You can do a donut with sweep.scad using the parameter closed=true. The
first and last section are matched by its indices. You couldn't model a
Moebius strip with it because the total twist for closed paths is a
multiple of 360.

2016-10-10 14:31 GMT-03:00 Parkinbot <rudolf@parkinbot.com>: > > Sweep() will connect all polygons into a polyhedron and do the hard work > for > you. While this approach is quite mighty, you can only model > non-self-intersecting extrusions with it. For a donut you'd produce to > half-donuts and union them together. This is, what I did for the > Threadings. > You can do a donut with sweep.scad using the parameter closed=true. The first and last section are matched by its indices. You couldn't model a Moebius strip with it because the total twist for closed paths is a multiple of 360.
P
Parkinbot
Mon, Oct 10, 2016 7:49 PM

Ronaldo wrote

You can do a donut with sweep.scad using the parameter closed=true. The
first and last section are matched by its indices. You couldn't model a
Moebius strip with it because the total twist for closed paths is a
multiple of 360.

Well, I was referring to my  Thingiverse post
http://www.thingiverse.com/thing:1659079  , which uses my very own version
of sweep() from Naca_sweep.scad, which, like skin(), is somehow more
flexible than the version in sweep.scad. For the difference, refer to
https://github.com/openscad/list-comprehension-demos/issues/3

And, you say it: You couldn't model a Moebius strip with an odd number of
windings with it. Isn't any moebius strip kinda donut?
Also a threading with slope > 0 can't be closed automatically.

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

Ronaldo wrote > You can do a donut with sweep.scad using the parameter closed=true. The > first and last section are matched by its indices. You couldn't model a > Moebius strip with it because the total twist for closed paths is a > multiple of 360. Well, I was referring to my Thingiverse post <http://www.thingiverse.com/thing:1659079> , which uses my very own version of sweep() from Naca_sweep.scad, which, like skin(), is somehow more flexible than the version in sweep.scad. For the difference, refer to https://github.com/openscad/list-comprehension-demos/issues/3 And, you say it: You couldn't model a Moebius strip with an odd number of windings with it. Isn't any moebius strip kinda donut? Also a threading with slope > 0 can't be closed automatically. -- View this message in context: http://forum.openscad.org/How-can-I-tell-what-OpenSCAD-is-doing-tp18632p18660.html Sent from the OpenSCAD mailing list archive at Nabble.com.
AC
Alan Cox
Mon, Oct 10, 2016 8:00 PM

following will give you means of obtaining just that speed.
First, understand that OpenSCAD is slow by design, if not by intent. I

If you are going to worry about OpenSCAD performance then actually study
it first. If you are going to write long bogus posts then profile it and
study the profile data.

Alan

> following will give you means of obtaining just that speed. > First, understand that OpenSCAD is slow by design, if not by intent. I If you are going to worry about OpenSCAD performance then actually study it first. If you are going to write long bogus posts then profile it and study the profile data. Alan
R
Ronaldo
Mon, Oct 10, 2016 9:00 PM

Parkinbot wrote

Well, I was referring to my
Thingiverse post http://www.thingiverse.com/thing:1659079
, which uses my very own version of sweep() from Naca_sweep.scad, which,
like skin(), is somehow more flexible than the version in sweep.scad. For
the difference, refer to
https://github.com/openscad/list-comprehension-demos/issues/3

I know your approach but see it more as a powerful version of linear
extrusion.

And, you say it: You couldn't model a Moebius strip with an odd number of
windings with it. Isn't any moebius strip kinda donut?
Also a threading with slope > 0 can't be closed automatically.

The answer to your question is: yes and no. It has a genus if you conceive
it with thickness. But to resemble a Moebius strip you must give it a total
twist of 180 degree and this infeasible with Linde's closed sweeps.
For threads, your approach is perfect. Linde's sweep.scad is useless unless
you control twists and initial angle. And, of course, it is not closed.

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

Parkinbot wrote > Well, I was referring to my > Thingiverse post <http://www.thingiverse.com/thing:1659079> > , which uses my very own version of sweep() from Naca_sweep.scad, which, > like skin(), is somehow more flexible than the version in sweep.scad. For > the difference, refer to > https://github.com/openscad/list-comprehension-demos/issues/3 I know your approach but see it more as a powerful version of linear extrusion. > And, you say it: You couldn't model a Moebius strip with an odd number of > windings with it. Isn't any moebius strip kinda donut? > Also a threading with slope > 0 can't be closed automatically. The answer to your question is: yes and no. It has a genus if you conceive it with thickness. But to resemble a Moebius strip you must give it a total twist of 180 degree and this infeasible with Linde's closed sweeps. For threads, your approach is perfect. Linde's sweep.scad is useless unless you control twists and initial angle. And, of course, it is not closed. -- View this message in context: http://forum.openscad.org/How-can-I-tell-what-OpenSCAD-is-doing-tp18632p18664.html Sent from the OpenSCAD mailing list archive at Nabble.com.