discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Re: [OpenSCAD] Fwd: Rotary extrude with constant wall thickness, plz help!

P
PYM
Tue, Jul 28, 2015 10:00 AM

Hi,

thanks for the code, but i dont think it makes a good ellipse. I used hull()
around the for-loop to illustrate that. See the picture.
http://forum.openscad.org/file/n13330/ellipse2.png

--
View this message in context: http://forum.openscad.org/Rotary-extrude-with-constant-wall-thickness-plz-help-tp13287p13330.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

Hi, thanks for the code, but i dont think it makes a good ellipse. I used hull() around the for-loop to illustrate that. See the picture. <http://forum.openscad.org/file/n13330/ellipse2.png> -- View this message in context: http://forum.openscad.org/Rotary-extrude-with-constant-wall-thickness-plz-help-tp13287p13330.html Sent from the OpenSCAD mailing list archive at Nabble.com.
P
PYM
Tue, Jul 28, 2015 1:22 PM

Hello guys,

@wolf: Sorry i overread in your post that only the inner boundary is an
ellipse. You are of course right about that!

I made some advancements in creating an elliptic brim with sweep() in
scad-utils.

However, i dont get why my extruded shape twists around its path with my
ellipse equation:
http://forum.openscad.org/file/n13333/twisted_shape.png

Here is my code:

use <list-comprehension-demos/sweep.scad>
use <scad-utils/transformations.scad>
use <scad-utils/shapes.scad>

A=450;  //long half-axis of ellipse
B=300;  //short half-axis of ellipse

/*
function f(t) = [
(t / 1.5 + 0.5) * 100 * cos(6 * 360 * t),
(t / 1.5 + 0.5) * 100 * sin(6 * 360 * t),
200 * (1 - t)
];
*/
function e(i) = [
450 * cos(6 * 360 * i),
300 * sin(6 * 360 * i),
0
];

function shape() = [
[-10, -1],
[-10,  6],
[ -7,  6],
[ -7,  1],
[  7,  1],
[  7,  6],
[ 10,  6],
[ 10, -1]];

function myshape() = square(10);

step = 0.0005;

/*
path = [for (t=[0:step:1-step]) f(t)];
path_transforms = construct_transform_path(path);
sweep(shape(), path_transforms);
*/

path = [for (i=[0:step:1-step]) e(i)];
path_transforms = construct_transform_path(path);
sweep(myshape(), path_transforms);

--
View this message in context: http://forum.openscad.org/Rotary-extrude-with-constant-wall-thickness-plz-help-tp13287p13333.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

Hello guys, @wolf: Sorry i overread in your post that only the inner boundary is an ellipse. You are of course right about that! I made some advancements in creating an elliptic brim with sweep() in scad-utils. However, i dont get why my extruded shape twists around its path with my ellipse equation: <http://forum.openscad.org/file/n13333/twisted_shape.png> Here is my code: use <list-comprehension-demos/sweep.scad> use <scad-utils/transformations.scad> use <scad-utils/shapes.scad> A=450; //long half-axis of ellipse B=300; //short half-axis of ellipse /* function f(t) = [ (t / 1.5 + 0.5) * 100 * cos(6 * 360 * t), (t / 1.5 + 0.5) * 100 * sin(6 * 360 * t), 200 * (1 - t) ]; */ function e(i) = [ 450 * cos(6 * 360 * i), 300 * sin(6 * 360 * i), 0 ]; function shape() = [ [-10, -1], [-10, 6], [ -7, 6], [ -7, 1], [ 7, 1], [ 7, 6], [ 10, 6], [ 10, -1]]; function myshape() = square(10); step = 0.0005; /* path = [for (t=[0:step:1-step]) f(t)]; path_transforms = construct_transform_path(path); sweep(shape(), path_transforms); */ path = [for (i=[0:step:1-step]) e(i)]; path_transforms = construct_transform_path(path); sweep(myshape(), path_transforms); -- View this message in context: http://forum.openscad.org/Rotary-extrude-with-constant-wall-thickness-plz-help-tp13287p13333.html Sent from the OpenSCAD mailing list archive at Nabble.com.
TP
Torsten Paul
Tue, Jul 28, 2015 6:04 PM

On 07/28/2015 03:22 PM, PYM wrote:

I made some advancements in creating an elliptic brim with sweep() in
scad-utils.

However, i dont get why my extruded shape twists around its path with my
ellipse equation:
http://forum.openscad.org/file/n13333/twisted_shape.png

I don't have the math background to explain why it happens, but there's
an easy workaround. Just sweep in the X-Z plane by changing e() to

function e(i) = [
450 * cos(6 * 360 * i),
0,
300 * sin(6 * 360 * i)
];

and rotate the result back to X-Y.

ciao,
Torsten.

On 07/28/2015 03:22 PM, PYM wrote: > I made some advancements in creating an elliptic brim with sweep() in > scad-utils. > > However, i dont get why my extruded shape twists around its path with my > ellipse equation: > <http://forum.openscad.org/file/n13333/twisted_shape.png> > I don't have the math background to explain why it happens, but there's an easy workaround. Just sweep in the X-Z plane by changing e() to function e(i) = [ 450 * cos(6 * 360 * i), 0, 300 * sin(6 * 360 * i) ]; and rotate the result back to X-Y. ciao, Torsten.
PF
Peter Falke
Tue, Jul 28, 2015 6:23 PM

No, this does not work:

function aa_n(x1,x2,aa)=atan2(x1,x2*tan(aa));

x1 and x2 are constant, they are the two axis of the ellipse a and b

2015-07-28 20:04 GMT+02:00 Torsten Paul Torsten.Paul@gmx.de:

On 07/28/2015 03:22 PM, PYM wrote:

I made some advancements in creating an elliptic brim with sweep() in
scad-utils.

However, i dont get why my extruded shape twists around its path with my
ellipse equation:
http://forum.openscad.org/file/n13333/twisted_shape.png

I don't have the math background to explain why it happens, but there's

an easy workaround. Just sweep in the X-Z plane by changing e() to

function e(i) = [
450 * cos(6 * 360 * i),
0,
300 * sin(6 * 360 * i)
];

and rotate the result back to X-Y.

ciao,
Torsten.


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

--
stempeldergeschichte@googlemail.com karsten@rohrbach.de

P.S. Falls meine E-Mail kürzer ausfällt als Dir angenehm ist:
Ich probiere gerade aus kurze Antworten statt gar keine Antworten zu
schreiben.
Wenn Du gerne mehr lesen möchtest, dann lass es mich bitte wissen.

P.S. In case my e-mail is shorter than you enjoy:
I am currently trying short replies instead of no replies at all.
Please let me know, if you like to read more.

Enjoy!

No, this does not work: function aa_n(x1,x2,aa)=atan2(x1,x2*tan(aa)); x1 and x2 are constant, they are the two axis of the ellipse a and b ​ 2015-07-28 20:04 GMT+02:00 Torsten Paul <Torsten.Paul@gmx.de>: > On 07/28/2015 03:22 PM, PYM wrote: > >> I made some advancements in creating an elliptic brim with sweep() in >> scad-utils. >> >> However, i dont get why my extruded shape twists around its path with my >> ellipse equation: >> <http://forum.openscad.org/file/n13333/twisted_shape.png> >> >> I don't have the math background to explain why it happens, but there's > an easy workaround. Just sweep in the X-Z plane by changing e() to > > function e(i) = [ > 450 * cos(6 * 360 * i), > 0, > 300 * sin(6 * 360 * i) > ]; > > and rotate the result back to X-Y. > > ciao, > Torsten. > > > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org > -- stempeldergeschichte@googlemail.com <karsten@rohrbach.de> P.S. Falls meine E-Mail kürzer ausfällt als Dir angenehm ist: Ich probiere gerade aus kurze Antworten statt gar keine Antworten zu schreiben. Wenn Du gerne mehr lesen möchtest, dann lass es mich bitte wissen. P.S. In case my e-mail is shorter than you enjoy: I am currently trying short replies instead of no replies at all. Please let me know, if you like to read more. Enjoy!
PF
Peter Falke
Tue, Jul 28, 2015 6:42 PM

OK, I figured it out. This works:

// angle of the normal (aa_n) along the ellipse as function of the polar
angle (aa)

function
aa_n(x1,x2,aa)=(aa>270)?atan(x1tan(aa)/x2):(aa>90)?90+90+atan(x1tan(aa)/x2):atan(x1*tan(aa)/x2);

Now everything looks fine:

And the profile is undistorted along every cut through any normal along the
ellipse:


2015-07-28 20:23 GMT+02:00 Peter Falke stempeldergeschichte@googlemail.com
:

No, this does not work:

function aa_n(x1,x2,aa)=atan2(x1,x2*tan(aa));

x1 and x2 are constant, they are the two axis of the ellipse a and b

2015-07-28 20:04 GMT+02:00 Torsten Paul Torsten.Paul@gmx.de:

On 07/28/2015 03:22 PM, PYM wrote:

I made some advancements in creating an elliptic brim with sweep() in
scad-utils.

However, i dont get why my extruded shape twists around its path with my
ellipse equation:
http://forum.openscad.org/file/n13333/twisted_shape.png

I don't have the math background to explain why it happens, but there's

an easy workaround. Just sweep in the X-Z plane by changing e() to

function e(i) = [
450 * cos(6 * 360 * i),
0,
300 * sin(6 * 360 * i)
];

and rotate the result back to X-Y.

ciao,
Torsten.


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

--
stempeldergeschichte@googlemail.com karsten@rohrbach.de

P.S. Falls meine E-Mail kürzer ausfällt als Dir angenehm ist:
Ich probiere gerade aus kurze Antworten statt gar keine Antworten zu
schreiben.
Wenn Du gerne mehr lesen möchtest, dann lass es mich bitte wissen.

P.S. In case my e-mail is shorter than you enjoy:
I am currently trying short replies instead of no replies at all.
Please let me know, if you like to read more.

Enjoy!

--
stempeldergeschichte@googlemail.com karsten@rohrbach.de

P.S. Falls meine E-Mail kürzer ausfällt als Dir angenehm ist:
Ich probiere gerade aus kurze Antworten statt gar keine Antworten zu
schreiben.
Wenn Du gerne mehr lesen möchtest, dann lass es mich bitte wissen.

P.S. In case my e-mail is shorter than you enjoy:
I am currently trying short replies instead of no replies at all.
Please let me know, if you like to read more.

Enjoy!

OK, I figured it out. This works: // angle of the normal (aa_n) along the ellipse as function of the polar angle (aa) function aa_n(x1,x2,aa)=(aa>270)?atan(x1*tan(aa)/x2):(aa>90)?90+90+atan(x1*tan(aa)/x2):atan(x1*tan(aa)/x2); Now everything looks fine: And the profile is undistorted along every cut through any normal along the ellipse: ​ ​ 2015-07-28 20:23 GMT+02:00 Peter Falke <stempeldergeschichte@googlemail.com> : > No, this does not work: > > function aa_n(x1,x2,aa)=atan2(x1,x2*tan(aa)); > > x1 and x2 are constant, they are the two axis of the ellipse a and b > > > ​ > > 2015-07-28 20:04 GMT+02:00 Torsten Paul <Torsten.Paul@gmx.de>: > >> On 07/28/2015 03:22 PM, PYM wrote: >> >>> I made some advancements in creating an elliptic brim with sweep() in >>> scad-utils. >>> >>> However, i dont get why my extruded shape twists around its path with my >>> ellipse equation: >>> <http://forum.openscad.org/file/n13333/twisted_shape.png> >>> >>> I don't have the math background to explain why it happens, but there's >> an easy workaround. Just sweep in the X-Z plane by changing e() to >> >> function e(i) = [ >> 450 * cos(6 * 360 * i), >> 0, >> 300 * sin(6 * 360 * i) >> ]; >> >> and rotate the result back to X-Y. >> >> ciao, >> Torsten. >> >> >> >> _______________________________________________ >> OpenSCAD mailing list >> Discuss@lists.openscad.org >> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >> > > > > -- > stempeldergeschichte@googlemail.com <karsten@rohrbach.de> > > P.S. Falls meine E-Mail kürzer ausfällt als Dir angenehm ist: > Ich probiere gerade aus kurze Antworten statt gar keine Antworten zu > schreiben. > Wenn Du gerne mehr lesen möchtest, dann lass es mich bitte wissen. > > P.S. In case my e-mail is shorter than you enjoy: > I am currently trying short replies instead of no replies at all. > Please let me know, if you like to read more. > > Enjoy! > -- stempeldergeschichte@googlemail.com <karsten@rohrbach.de> P.S. Falls meine E-Mail kürzer ausfällt als Dir angenehm ist: Ich probiere gerade aus kurze Antworten statt gar keine Antworten zu schreiben. Wenn Du gerne mehr lesen möchtest, dann lass es mich bitte wissen. P.S. In case my e-mail is shorter than you enjoy: I am currently trying short replies instead of no replies at all. Please let me know, if you like to read more. Enjoy!
NH
nop head
Tue, Jul 28, 2015 7:37 PM

The whole point of atan2 is that it covers the full range -180 to 180
because it knows the sign of both the numerator and denominator. atan is
only -90 to 90. I think the reason it didn't work is you seem to have
changed from x1/x2tan(aa) to x1tan(aa)/x2 so it should probably be
atan2(x1*tan(aa),x2) in that case.

On 28 July 2015 at 19:42, Peter Falke stempeldergeschichte@googlemail.com
wrote:

OK, I figured it out. This works:

// angle of the normal (aa_n) along the ellipse as function of the polar
angle (aa)

function
aa_n(x1,x2,aa)=(aa>270)?atan(x1tan(aa)/x2):(aa>90)?90+90+atan(x1tan(aa)/x2):atan(x1*tan(aa)/x2);

Now everything looks fine:

And the profile is undistorted along every cut through any normal along
the ellipse:


2015-07-28 20:23 GMT+02:00 Peter Falke <
stempeldergeschichte@googlemail.com>:

No, this does not work:

function aa_n(x1,x2,aa)=atan2(x1,x2*tan(aa));

x1 and x2 are constant, they are the two axis of the ellipse a and b

2015-07-28 20:04 GMT+02:00 Torsten Paul Torsten.Paul@gmx.de:

On 07/28/2015 03:22 PM, PYM wrote:

I made some advancements in creating an elliptic brim with sweep() in
scad-utils.

However, i dont get why my extruded shape twists around its path with my
ellipse equation:
http://forum.openscad.org/file/n13333/twisted_shape.png

I don't have the math background to explain why it happens, but there's

an easy workaround. Just sweep in the X-Z plane by changing e() to

function e(i) = [
450 * cos(6 * 360 * i),
0,
300 * sin(6 * 360 * i)
];

and rotate the result back to X-Y.

ciao,
Torsten.


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

--
stempeldergeschichte@googlemail.com karsten@rohrbach.de

P.S. Falls meine E-Mail kürzer ausfällt als Dir angenehm ist:
Ich probiere gerade aus kurze Antworten statt gar keine Antworten zu
schreiben.
Wenn Du gerne mehr lesen möchtest, dann lass es mich bitte wissen.

P.S. In case my e-mail is shorter than you enjoy:
I am currently trying short replies instead of no replies at all.
Please let me know, if you like to read more.

Enjoy!

--
stempeldergeschichte@googlemail.com karsten@rohrbach.de

P.S. Falls meine E-Mail kürzer ausfällt als Dir angenehm ist:
Ich probiere gerade aus kurze Antworten statt gar keine Antworten zu
schreiben.
Wenn Du gerne mehr lesen möchtest, dann lass es mich bitte wissen.

P.S. In case my e-mail is shorter than you enjoy:
I am currently trying short replies instead of no replies at all.
Please let me know, if you like to read more.

Enjoy!


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

The whole point of atan2 is that it covers the full range -180 to 180 because it knows the sign of both the numerator and denominator. atan is only -90 to 90. I think the reason it didn't work is you seem to have changed from x1/x2*tan(aa) to x1*tan(aa)/x2 so it should probably be atan2(x1*tan(aa),x2) in that case. On 28 July 2015 at 19:42, Peter Falke <stempeldergeschichte@googlemail.com> wrote: > OK, I figured it out. This works: > > // angle of the normal (aa_n) along the ellipse as function of the polar > angle (aa) > > function > aa_n(x1,x2,aa)=(aa>270)?atan(x1*tan(aa)/x2):(aa>90)?90+90+atan(x1*tan(aa)/x2):atan(x1*tan(aa)/x2); > > > Now everything looks fine: > > And the profile is undistorted along every cut through any normal along > the ellipse: > > ​ > ​ > > > 2015-07-28 20:23 GMT+02:00 Peter Falke < > stempeldergeschichte@googlemail.com>: > >> No, this does not work: >> >> function aa_n(x1,x2,aa)=atan2(x1,x2*tan(aa)); >> >> x1 and x2 are constant, they are the two axis of the ellipse a and b >> >> >> ​ >> >> 2015-07-28 20:04 GMT+02:00 Torsten Paul <Torsten.Paul@gmx.de>: >> >>> On 07/28/2015 03:22 PM, PYM wrote: >>> >>>> I made some advancements in creating an elliptic brim with sweep() in >>>> scad-utils. >>>> >>>> However, i dont get why my extruded shape twists around its path with my >>>> ellipse equation: >>>> <http://forum.openscad.org/file/n13333/twisted_shape.png> >>>> >>>> I don't have the math background to explain why it happens, but there's >>> an easy workaround. Just sweep in the X-Z plane by changing e() to >>> >>> function e(i) = [ >>> 450 * cos(6 * 360 * i), >>> 0, >>> 300 * sin(6 * 360 * i) >>> ]; >>> >>> and rotate the result back to X-Y. >>> >>> ciao, >>> Torsten. >>> >>> >>> >>> _______________________________________________ >>> OpenSCAD mailing list >>> Discuss@lists.openscad.org >>> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >>> >> >> >> >> -- >> stempeldergeschichte@googlemail.com <karsten@rohrbach.de> >> >> P.S. Falls meine E-Mail kürzer ausfällt als Dir angenehm ist: >> Ich probiere gerade aus kurze Antworten statt gar keine Antworten zu >> schreiben. >> Wenn Du gerne mehr lesen möchtest, dann lass es mich bitte wissen. >> >> P.S. In case my e-mail is shorter than you enjoy: >> I am currently trying short replies instead of no replies at all. >> Please let me know, if you like to read more. >> >> Enjoy! >> > > > > -- > stempeldergeschichte@googlemail.com <karsten@rohrbach.de> > > P.S. Falls meine E-Mail kürzer ausfällt als Dir angenehm ist: > Ich probiere gerade aus kurze Antworten statt gar keine Antworten zu > schreiben. > Wenn Du gerne mehr lesen möchtest, dann lass es mich bitte wissen. > > P.S. In case my e-mail is shorter than you enjoy: > I am currently trying short replies instead of no replies at all. > Please let me know, if you like to read more. > > Enjoy! > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org > >
PF
Peter Falke
Tue, Jul 28, 2015 8:04 PM

x1 and x2 are constant here: only tan(aa) changes, so no look with atan2()

2015-07-28 21:37 GMT+02:00 nop head nop.head@gmail.com:

The whole point of atan2 is that it covers the full range -180 to 180
because it knows the sign of both the numerator and denominator. atan is
only -90 to 90. I think the reason it didn't work is you seem to have
changed from x1/x2tan(aa) to x1tan(aa)/x2 so it should probably be
atan2(x1*tan(aa),x2) in that case.

On 28 July 2015 at 19:42, Peter Falke <stempeldergeschichte@googlemail.com

wrote:

OK, I figured it out. This works:

// angle of the normal (aa_n) along the ellipse as function of the polar
angle (aa)

function
aa_n(x1,x2,aa)=(aa>270)?atan(x1tan(aa)/x2):(aa>90)?90+90+atan(x1tan(aa)/x2):atan(x1*tan(aa)/x2);

Now everything looks fine:

And the profile is undistorted along every cut through any normal along
the ellipse:


2015-07-28 20:23 GMT+02:00 Peter Falke <
stempeldergeschichte@googlemail.com>:

No, this does not work:

function aa_n(x1,x2,aa)=atan2(x1,x2*tan(aa));

x1 and x2 are constant, they are the two axis of the ellipse a and b

2015-07-28 20:04 GMT+02:00 Torsten Paul Torsten.Paul@gmx.de:

On 07/28/2015 03:22 PM, PYM wrote:

I made some advancements in creating an elliptic brim with sweep() in
scad-utils.

However, i dont get why my extruded shape twists around its path with
my
ellipse equation:
http://forum.openscad.org/file/n13333/twisted_shape.png

I don't have the math background to explain why it happens, but

there's
an easy workaround. Just sweep in the X-Z plane by changing e() to

function e(i) = [
450 * cos(6 * 360 * i),
0,
300 * sin(6 * 360 * i)
];

and rotate the result back to X-Y.

ciao,
Torsten.


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

--
stempeldergeschichte@googlemail.com karsten@rohrbach.de

P.S. Falls meine E-Mail kürzer ausfällt als Dir angenehm ist:
Ich probiere gerade aus kurze Antworten statt gar keine Antworten zu
schreiben.
Wenn Du gerne mehr lesen möchtest, dann lass es mich bitte wissen.

P.S. In case my e-mail is shorter than you enjoy:
I am currently trying short replies instead of no replies at all.
Please let me know, if you like to read more.

Enjoy!

--
stempeldergeschichte@googlemail.com karsten@rohrbach.de

P.S. Falls meine E-Mail kürzer ausfällt als Dir angenehm ist:
Ich probiere gerade aus kurze Antworten statt gar keine Antworten zu
schreiben.
Wenn Du gerne mehr lesen möchtest, dann lass es mich bitte wissen.

P.S. In case my e-mail is shorter than you enjoy:
I am currently trying short replies instead of no replies at all.
Please let me know, if you like to read more.

Enjoy!


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

--
stempeldergeschichte@googlemail.com karsten@rohrbach.de

P.S. Falls meine E-Mail kürzer ausfällt als Dir angenehm ist:
Ich probiere gerade aus kurze Antworten statt gar keine Antworten zu
schreiben.
Wenn Du gerne mehr lesen möchtest, dann lass es mich bitte wissen.

P.S. In case my e-mail is shorter than you enjoy:
I am currently trying short replies instead of no replies at all.
Please let me know, if you like to read more.

Enjoy!

x1 and x2 are constant here: only tan(aa) changes, so no look with atan2() 2015-07-28 21:37 GMT+02:00 nop head <nop.head@gmail.com>: > The whole point of atan2 is that it covers the full range -180 to 180 > because it knows the sign of both the numerator and denominator. atan is > only -90 to 90. I think the reason it didn't work is you seem to have > changed from x1/x2*tan(aa) to x1*tan(aa)/x2 so it should probably be > atan2(x1*tan(aa),x2) in that case. > > On 28 July 2015 at 19:42, Peter Falke <stempeldergeschichte@googlemail.com > > wrote: > >> OK, I figured it out. This works: >> >> // angle of the normal (aa_n) along the ellipse as function of the polar >> angle (aa) >> >> function >> aa_n(x1,x2,aa)=(aa>270)?atan(x1*tan(aa)/x2):(aa>90)?90+90+atan(x1*tan(aa)/x2):atan(x1*tan(aa)/x2); >> >> >> Now everything looks fine: >> >> And the profile is undistorted along every cut through any normal along >> the ellipse: >> >> ​ >> ​ >> >> >> 2015-07-28 20:23 GMT+02:00 Peter Falke < >> stempeldergeschichte@googlemail.com>: >> >>> No, this does not work: >>> >>> function aa_n(x1,x2,aa)=atan2(x1,x2*tan(aa)); >>> >>> x1 and x2 are constant, they are the two axis of the ellipse a and b >>> >>> >>> ​ >>> >>> 2015-07-28 20:04 GMT+02:00 Torsten Paul <Torsten.Paul@gmx.de>: >>> >>>> On 07/28/2015 03:22 PM, PYM wrote: >>>> >>>>> I made some advancements in creating an elliptic brim with sweep() in >>>>> scad-utils. >>>>> >>>>> However, i dont get why my extruded shape twists around its path with >>>>> my >>>>> ellipse equation: >>>>> <http://forum.openscad.org/file/n13333/twisted_shape.png> >>>>> >>>>> I don't have the math background to explain why it happens, but >>>> there's >>>> an easy workaround. Just sweep in the X-Z plane by changing e() to >>>> >>>> function e(i) = [ >>>> 450 * cos(6 * 360 * i), >>>> 0, >>>> 300 * sin(6 * 360 * i) >>>> ]; >>>> >>>> and rotate the result back to X-Y. >>>> >>>> ciao, >>>> Torsten. >>>> >>>> >>>> >>>> _______________________________________________ >>>> OpenSCAD mailing list >>>> Discuss@lists.openscad.org >>>> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >>>> >>> >>> >>> >>> -- >>> stempeldergeschichte@googlemail.com <karsten@rohrbach.de> >>> >>> P.S. Falls meine E-Mail kürzer ausfällt als Dir angenehm ist: >>> Ich probiere gerade aus kurze Antworten statt gar keine Antworten zu >>> schreiben. >>> Wenn Du gerne mehr lesen möchtest, dann lass es mich bitte wissen. >>> >>> P.S. In case my e-mail is shorter than you enjoy: >>> I am currently trying short replies instead of no replies at all. >>> Please let me know, if you like to read more. >>> >>> Enjoy! >>> >> >> >> >> -- >> stempeldergeschichte@googlemail.com <karsten@rohrbach.de> >> >> P.S. Falls meine E-Mail kürzer ausfällt als Dir angenehm ist: >> Ich probiere gerade aus kurze Antworten statt gar keine Antworten zu >> schreiben. >> Wenn Du gerne mehr lesen möchtest, dann lass es mich bitte wissen. >> >> P.S. In case my e-mail is shorter than you enjoy: >> I am currently trying short replies instead of no replies at all. >> Please let me know, if you like to read more. >> >> Enjoy! >> >> _______________________________________________ >> 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 > > -- stempeldergeschichte@googlemail.com <karsten@rohrbach.de> P.S. Falls meine E-Mail kürzer ausfällt als Dir angenehm ist: Ich probiere gerade aus kurze Antworten statt gar keine Antworten zu schreiben. Wenn Du gerne mehr lesen möchtest, dann lass es mich bitte wissen. P.S. In case my e-mail is shorter than you enjoy: I am currently trying short replies instead of no replies at all. Please let me know, if you like to read more. Enjoy!
NH
nop head
Tue, Jul 28, 2015 8:13 PM

Ah I see. Possibly you can split tan(aa) into sin(aa)/cos(aa) and then use
atan2(x1 * sin(aa), x2 * cos(aa))

On 28 July 2015 at 21:04, Peter Falke stempeldergeschichte@googlemail.com
wrote:

x1 and x2 are constant here: only tan(aa) changes, so no look with atan2()

2015-07-28 21:37 GMT+02:00 nop head nop.head@gmail.com:

The whole point of atan2 is that it covers the full range -180 to 180
because it knows the sign of both the numerator and denominator. atan is
only -90 to 90. I think the reason it didn't work is you seem to have
changed from x1/x2tan(aa) to x1tan(aa)/x2 so it should probably be
atan2(x1*tan(aa),x2) in that case.

On 28 July 2015 at 19:42, Peter Falke <
stempeldergeschichte@googlemail.com> wrote:

OK, I figured it out. This works:

// angle of the normal (aa_n) along the ellipse as function of the polar
angle (aa)

function
aa_n(x1,x2,aa)=(aa>270)?atan(x1tan(aa)/x2):(aa>90)?90+90+atan(x1tan(aa)/x2):atan(x1*tan(aa)/x2);

Now everything looks fine:

And the profile is undistorted along every cut through any normal along
the ellipse:


2015-07-28 20:23 GMT+02:00 Peter Falke <
stempeldergeschichte@googlemail.com>:

No, this does not work:

function aa_n(x1,x2,aa)=atan2(x1,x2*tan(aa));

x1 and x2 are constant, they are the two axis of the ellipse a and b

2015-07-28 20:04 GMT+02:00 Torsten Paul Torsten.Paul@gmx.de:

On 07/28/2015 03:22 PM, PYM wrote:

I made some advancements in creating an elliptic brim with sweep() in
scad-utils.

However, i dont get why my extruded shape twists around its path with
my
ellipse equation:
http://forum.openscad.org/file/n13333/twisted_shape.png

I don't have the math background to explain why it happens, but

there's
an easy workaround. Just sweep in the X-Z plane by changing e() to

function e(i) = [
450 * cos(6 * 360 * i),
0,
300 * sin(6 * 360 * i)
];

and rotate the result back to X-Y.

ciao,
Torsten.


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

--
stempeldergeschichte@googlemail.com karsten@rohrbach.de

P.S. Falls meine E-Mail kürzer ausfällt als Dir angenehm ist:
Ich probiere gerade aus kurze Antworten statt gar keine Antworten zu
schreiben.
Wenn Du gerne mehr lesen möchtest, dann lass es mich bitte wissen.

P.S. In case my e-mail is shorter than you enjoy:
I am currently trying short replies instead of no replies at all.
Please let me know, if you like to read more.

Enjoy!

--
stempeldergeschichte@googlemail.com karsten@rohrbach.de

P.S. Falls meine E-Mail kürzer ausfällt als Dir angenehm ist:
Ich probiere gerade aus kurze Antworten statt gar keine Antworten zu
schreiben.
Wenn Du gerne mehr lesen möchtest, dann lass es mich bitte wissen.

P.S. In case my e-mail is shorter than you enjoy:
I am currently trying short replies instead of no replies at all.
Please let me know, if you like to read more.

Enjoy!


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

--
stempeldergeschichte@googlemail.com karsten@rohrbach.de

P.S. Falls meine E-Mail kürzer ausfällt als Dir angenehm ist:
Ich probiere gerade aus kurze Antworten statt gar keine Antworten zu
schreiben.
Wenn Du gerne mehr lesen möchtest, dann lass es mich bitte wissen.

P.S. In case my e-mail is shorter than you enjoy:
I am currently trying short replies instead of no replies at all.
Please let me know, if you like to read more.

Enjoy!


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

Ah I see. Possibly you can split tan(aa) into sin(aa)/cos(aa) and then use atan2(x1 * sin(aa), x2 * cos(aa)) On 28 July 2015 at 21:04, Peter Falke <stempeldergeschichte@googlemail.com> wrote: > x1 and x2 are constant here: only tan(aa) changes, so no look with atan2() > > 2015-07-28 21:37 GMT+02:00 nop head <nop.head@gmail.com>: > >> The whole point of atan2 is that it covers the full range -180 to 180 >> because it knows the sign of both the numerator and denominator. atan is >> only -90 to 90. I think the reason it didn't work is you seem to have >> changed from x1/x2*tan(aa) to x1*tan(aa)/x2 so it should probably be >> atan2(x1*tan(aa),x2) in that case. >> >> On 28 July 2015 at 19:42, Peter Falke < >> stempeldergeschichte@googlemail.com> wrote: >> >>> OK, I figured it out. This works: >>> >>> // angle of the normal (aa_n) along the ellipse as function of the polar >>> angle (aa) >>> >>> function >>> aa_n(x1,x2,aa)=(aa>270)?atan(x1*tan(aa)/x2):(aa>90)?90+90+atan(x1*tan(aa)/x2):atan(x1*tan(aa)/x2); >>> >>> >>> Now everything looks fine: >>> >>> And the profile is undistorted along every cut through any normal along >>> the ellipse: >>> >>> ​ >>> ​ >>> >>> >>> 2015-07-28 20:23 GMT+02:00 Peter Falke < >>> stempeldergeschichte@googlemail.com>: >>> >>>> No, this does not work: >>>> >>>> function aa_n(x1,x2,aa)=atan2(x1,x2*tan(aa)); >>>> >>>> x1 and x2 are constant, they are the two axis of the ellipse a and b >>>> >>>> >>>> ​ >>>> >>>> 2015-07-28 20:04 GMT+02:00 Torsten Paul <Torsten.Paul@gmx.de>: >>>> >>>>> On 07/28/2015 03:22 PM, PYM wrote: >>>>> >>>>>> I made some advancements in creating an elliptic brim with sweep() in >>>>>> scad-utils. >>>>>> >>>>>> However, i dont get why my extruded shape twists around its path with >>>>>> my >>>>>> ellipse equation: >>>>>> <http://forum.openscad.org/file/n13333/twisted_shape.png> >>>>>> >>>>>> I don't have the math background to explain why it happens, but >>>>> there's >>>>> an easy workaround. Just sweep in the X-Z plane by changing e() to >>>>> >>>>> function e(i) = [ >>>>> 450 * cos(6 * 360 * i), >>>>> 0, >>>>> 300 * sin(6 * 360 * i) >>>>> ]; >>>>> >>>>> and rotate the result back to X-Y. >>>>> >>>>> ciao, >>>>> Torsten. >>>>> >>>>> >>>>> >>>>> _______________________________________________ >>>>> OpenSCAD mailing list >>>>> Discuss@lists.openscad.org >>>>> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >>>>> >>>> >>>> >>>> >>>> -- >>>> stempeldergeschichte@googlemail.com <karsten@rohrbach.de> >>>> >>>> P.S. Falls meine E-Mail kürzer ausfällt als Dir angenehm ist: >>>> Ich probiere gerade aus kurze Antworten statt gar keine Antworten zu >>>> schreiben. >>>> Wenn Du gerne mehr lesen möchtest, dann lass es mich bitte wissen. >>>> >>>> P.S. In case my e-mail is shorter than you enjoy: >>>> I am currently trying short replies instead of no replies at all. >>>> Please let me know, if you like to read more. >>>> >>>> Enjoy! >>>> >>> >>> >>> >>> -- >>> stempeldergeschichte@googlemail.com <karsten@rohrbach.de> >>> >>> P.S. Falls meine E-Mail kürzer ausfällt als Dir angenehm ist: >>> Ich probiere gerade aus kurze Antworten statt gar keine Antworten zu >>> schreiben. >>> Wenn Du gerne mehr lesen möchtest, dann lass es mich bitte wissen. >>> >>> P.S. In case my e-mail is shorter than you enjoy: >>> I am currently trying short replies instead of no replies at all. >>> Please let me know, if you like to read more. >>> >>> Enjoy! >>> >>> _______________________________________________ >>> 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 >> >> > > > -- > stempeldergeschichte@googlemail.com <karsten@rohrbach.de> > > P.S. Falls meine E-Mail kürzer ausfällt als Dir angenehm ist: > Ich probiere gerade aus kurze Antworten statt gar keine Antworten zu > schreiben. > Wenn Du gerne mehr lesen möchtest, dann lass es mich bitte wissen. > > P.S. In case my e-mail is shorter than you enjoy: > I am currently trying short replies instead of no replies at all. > Please let me know, if you like to read more. > > Enjoy! > > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org > >
PF
Peter Falke
Tue, Jul 28, 2015 9:00 PM

Yes, this works fine. And its much shorter than my piecewise definition:

function
aa_n(x1,x2,aa)=(aa>270)?atan(x1tan(aa)/x2):(aa>90)?90+90+atan(x1tan(aa)/x2):atan(x1*tan(aa)/x2);

Thanks

Yes, this works fine. And its much shorter than my piecewise definition: function aa_n(x1,x2,aa)=(aa>270)?atan(x1*tan(aa)/x2):(aa>90)?90+90+atan(x1*tan(aa)/x2):atan(x1*tan(aa)/x2); Thanks
P
PYM
Wed, Jul 29, 2015 10:03 AM

Hi tp3,

i did exactly that shortly after my previousand it worked. i Dont understand
why though :)

--
View this message in context: http://forum.openscad.org/Rotary-extrude-with-constant-wall-thickness-plz-help-tp13287p13364.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

Hi tp3, i did exactly that shortly after my previousand it worked. i Dont understand why though :) -- View this message in context: http://forum.openscad.org/Rotary-extrude-with-constant-wall-thickness-plz-help-tp13287p13364.html Sent from the OpenSCAD mailing list archive at Nabble.com.