discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

recursion crash

PF
Peter Falke
Thu, Apr 2, 2015 11:41 AM

This crushes on Win 7 with version 2015.03

module mirror(v){
children();
mirror(v)children();
}

mirror([1,0,0])cube();

--
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!

This crushes on Win 7 with version 2015.03 module mirror(v){ children(); mirror(v)children(); } mirror([1,0,0])cube(); -- 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!
GF
Greg Frost
Thu, Apr 2, 2015 11:46 AM

That is infinite recursion. Definitely invalid, but I'm not sure it should crash.

On 2 Apr 2015, at 10:11 pm, Peter Falke stempeldergeschichte@googlemail.com wrote:

This crushes on Win 7 with version 2015.03

module mirror(v){
children();
mirror(v)children();
}

mirror([1,0,0])cube();

--
stempeldergeschichte@googlemail.com

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

That is infinite recursion. Definitely invalid, but I'm not sure it should crash. > On 2 Apr 2015, at 10:11 pm, Peter Falke <stempeldergeschichte@googlemail.com> wrote: > > This crushes on Win 7 with version 2015.03 > > module mirror(v){ > children(); > mirror(v)children(); > } > > mirror([1,0,0])cube(); > > > -- > stempeldergeschichte@googlemail.com > > 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
MH
Martin Herdieckerhoff
Thu, Apr 2, 2015 12:50 PM

You redefine the predefined module mirror.
What you want is probably this:

module mirror_duplicate(v){
children();
mirror(v) children();
}

mirror_duplicate([1,0,0]) cube();

Am 02.04.2015 um 13:41 schrieb Peter Falke:

This crushes on Win 7 with version 2015.03

module mirror(v){
children();
mirror(v)children();
}

mirror([1,0,0])cube();

**

You redefine the predefined module mirror. What you want is probably this: module mirror_duplicate(v){ children(); mirror(v) children(); } mirror_duplicate([1,0,0]) cube(); Am 02.04.2015 um 13:41 schrieb Peter Falke: > This crushes on Win 7 with version 2015.03 > > module mirror(v){ > children(); > mirror(v)children(); > } > > mirror([1,0,0])cube(); **
PF
Peter Falke
Thu, Apr 2, 2015 1:32 PM

What I want is:

mirror(v,keep=true)

But, I may not get it. ;)

I posted it only, because it crashes and I think Kintel tries hard to fix
OpenSCAD crashing at all.

2015-04-02 14:50 GMT+02:00 Martin Herdieckerhoff <
Martin.Herdieckerhoff@mnet-mail.de>:

You redefine the predefined module mirror.
What you want is probably this:

module mirror_duplicate(v){
children();
mirror(v) children();
}

mirror_duplicate([1,0,0]) cube();

Am 02.04.2015 um 13:41 schrieb Peter Falke:

This crushes on Win 7 with version 2015.03

module mirror(v){
children();
mirror(v)children();
}

mirror([1,0,0])cube();


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!

What I want is: mirror(v,keep=true) But, I may not get it. ;) I posted it only, because it crashes and I think Kintel tries hard to fix OpenSCAD crashing at all. 2015-04-02 14:50 GMT+02:00 Martin Herdieckerhoff < Martin.Herdieckerhoff@mnet-mail.de>: > You redefine the predefined module mirror. > What you want is probably this: > > module mirror_duplicate(v){ > children(); > mirror(v) children(); > } > > mirror_duplicate([1,0,0]) cube(); > > > Am 02.04.2015 um 13:41 schrieb Peter Falke: > > This crushes on Win 7 with version 2015.03 > > module mirror(v){ > children(); > mirror(v)children(); > } > > mirror([1,0,0])cube(); > > > _______________________________________________ > 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
Thu, Apr 2, 2015 2:06 PM

Now, what I want, can be done in user space: redefining mirror, so to
accept keep=true.
I'm using multimarix to avoid a recursive definition.
Using the reflection matrix:

[image: \mathbf{A} = \begin{bmatrix} 1 - 2 a^2 & - 2 a b & - 2 a c \ - 2 a
b & 1 - 2 b^2 & - 2 b c \ - 2 a c & - 2 b c & 1 - 2c^2 \end{bmatrix}]

from:
http://en.wikipedia.org/wiki/Transformation_matrix#Affine_transformations
If it can be done in user space, this could be an argument not to include
it into the core language.
But I still think: it makes it easier for newbies and it makes cde easier
to read and write if this is included into OpenSCAD.

module mirror(v,keep=false){
if(keep)children();
u=v/norm(v);
a=u.x;
b=u.y;
c=u.z;
multmatrix(m = [
[1-2aa, -2ab, -2ac, 0],
[-2ab,1-2bb, -2bc, 0],
[-2ac, -2bc, 1-2cc, 0],
[0, 0, 0,  1]
])
children();
}

mirror([1,1,1],true)cube(1);

2015-04-02 15:32 GMT+02:00 Peter Falke stempeldergeschichte@googlemail.com
:

What I want is:

mirror(v,keep=true)

But, I may not get it. ;)

I posted it only, because it crashes and I think Kintel tries hard to fix
OpenSCAD crashing at all.

2015-04-02 14:50 GMT+02:00 Martin Herdieckerhoff <
Martin.Herdieckerhoff@mnet-mail.de>:

You redefine the predefined module mirror.
What you want is probably this:

module mirror_duplicate(v){
children();
mirror(v) children();
}

mirror_duplicate([1,0,0]) cube();

Am 02.04.2015 um 13:41 schrieb Peter Falke:

This crushes on Win 7 with version 2015.03

module mirror(v){
children();
mirror(v)children();
}

mirror([1,0,0])cube();


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!

Now, what I want, can be done in user space: redefining mirror, so to accept keep=true. I'm using multimarix to avoid a recursive definition. Using the reflection matrix: [image: \mathbf{A} = \begin{bmatrix} 1 - 2 a^2 & - 2 a b & - 2 a c \\ - 2 a b & 1 - 2 b^2 & - 2 b c \\ - 2 a c & - 2 b c & 1 - 2c^2 \end{bmatrix}] from: http://en.wikipedia.org/wiki/Transformation_matrix#Affine_transformations If it can be done in user space, this could be an argument not to include it into the core language. But I still think: it makes it easier for newbies and it makes cde easier to read and write if this is included into OpenSCAD. module mirror(v,keep=false){ if(keep)children(); u=v/norm(v); a=u.x; b=u.y; c=u.z; multmatrix(m = [ [1-2*a*a, -2*a*b, -2*a*c, 0], [-2*a*b,1-2*b*b, -2*b*c, 0], [-2*a*c, -2*b*c, 1-2*c*c, 0], [0, 0, 0, 1] ]) children(); } mirror([1,1,1],true)cube(1); 2015-04-02 15:32 GMT+02:00 Peter Falke <stempeldergeschichte@googlemail.com> : > What I want is: > > mirror(v,keep=true) > > But, I may not get it. ;) > > I posted it only, because it crashes and I think Kintel tries hard to fix > OpenSCAD crashing at all. > > 2015-04-02 14:50 GMT+02:00 Martin Herdieckerhoff < > Martin.Herdieckerhoff@mnet-mail.de>: > >> You redefine the predefined module mirror. >> What you want is probably this: >> >> module mirror_duplicate(v){ >> children(); >> mirror(v) children(); >> } >> >> mirror_duplicate([1,0,0]) cube(); >> >> >> Am 02.04.2015 um 13:41 schrieb Peter Falke: >> >> This crushes on Win 7 with version 2015.03 >> >> module mirror(v){ >> children(); >> mirror(v)children(); >> } >> >> mirror([1,0,0])cube(); >> >> >> _______________________________________________ >> 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!