discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Recursive Module Not Rendering

MB
Max Bond
Tue, Dec 10, 2019 6:40 PM

Hi,

I was wondering if I could get some guidance. I'm writing a model with a
recursive module, and I want to operate on the children with some
transformations. However, whenever I try to operate on the children, they
fail to render.

Here is a simplified test case:

module test(d=5) {
if(d>0) {
test(d-1)
union() {
circle();
children();
}
}
}

test();

Commenting out the union causes the circles to render. While the union does
nothing here, the same goes for things like rotate that I rather need.

I'm using 2019.05.

Thanks,
Max

Hi, I was wondering if I could get some guidance. I'm writing a model with a recursive module, and I want to operate on the children with some transformations. However, whenever I try to operate on the children, they fail to render. Here is a simplified test case: module test(d=5) { if(d>0) { test(d-1) union() { circle(); children(); } } } test(); Commenting out the union causes the circles to render. While the union does nothing here, the same goes for things like rotate that I rather need. I'm using 2019.05. Thanks, Max
NH
nop head
Tue, Dec 10, 2019 6:48 PM

I think you need else children(); after the if or the result will be
nothing.

On Tue, 10 Dec 2019 at 18:40, Max Bond max.o.bond@gmail.com wrote:

Hi,

I was wondering if I could get some guidance. I'm writing a model with a
recursive module, and I want to operate on the children with some
transformations. However, whenever I try to operate on the children, they
fail to render.

Here is a simplified test case:

module test(d=5) {
if(d>0) {
test(d-1)
union() {
circle();
children();
}
}
}

test();

Commenting out the union causes the circles to render. While the union
does nothing here, the same goes for things like rotate that I rather need.

I'm using 2019.05.

Thanks,
Max


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

I think you need else children(); after the if or the result will be nothing. On Tue, 10 Dec 2019 at 18:40, Max Bond <max.o.bond@gmail.com> wrote: > Hi, > > I was wondering if I could get some guidance. I'm writing a model with a > recursive module, and I want to operate on the children with some > transformations. However, whenever I try to operate on the children, they > fail to render. > > Here is a simplified test case: > > module test(d=5) { > if(d>0) { > test(d-1) > union() { > circle(); > children(); > } > } > } > > test(); > > Commenting out the union causes the circles to render. While the union > does nothing here, the same goes for things like rotate that I rather need. > > I'm using 2019.05. > > Thanks, > Max > _______________________________________________ > OpenSCAD mailing list > Discuss@lists.openscad.org > http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org >
MB
Max Bond
Tue, Dec 10, 2019 6:52 PM

D'oh! You're right.

Thanks!

On Tue, Dec 10, 2019 at 11:49 AM nop head nop.head@gmail.com wrote:

I think you need else children(); after the if or the result will be
nothing.

On Tue, 10 Dec 2019 at 18:40, Max Bond max.o.bond@gmail.com wrote:

Hi,

I was wondering if I could get some guidance. I'm writing a model with a
recursive module, and I want to operate on the children with some
transformations. However, whenever I try to operate on the children, they
fail to render.

Here is a simplified test case:

module test(d=5) {
if(d>0) {
test(d-1)
union() {
circle();
children();
}
}
}

test();

Commenting out the union causes the circles to render. While the union
does nothing here, the same goes for things like rotate that I rather need.

I'm using 2019.05.

Thanks,
Max


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

D'oh! You're right. Thanks! On Tue, Dec 10, 2019 at 11:49 AM nop head <nop.head@gmail.com> wrote: > I think you need else children(); after the if or the result will be > nothing. > > On Tue, 10 Dec 2019 at 18:40, Max Bond <max.o.bond@gmail.com> wrote: > >> Hi, >> >> I was wondering if I could get some guidance. I'm writing a model with a >> recursive module, and I want to operate on the children with some >> transformations. However, whenever I try to operate on the children, they >> fail to render. >> >> Here is a simplified test case: >> >> module test(d=5) { >> if(d>0) { >> test(d-1) >> union() { >> circle(); >> children(); >> } >> } >> } >> >> test(); >> >> Commenting out the union causes the circles to render. While the union >> does nothing here, the same goes for things like rotate that I rather need. >> >> I'm using 2019.05. >> >> Thanks, >> Max >> _______________________________________________ >> 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 >
AC
A. Craig West
Tue, Dec 10, 2019 6:56 PM

Not sure why that is necessary, particularly since children() is empty...

On Tue, Dec 10, 2019 at 1:49 PM nop head nop.head@gmail.com wrote:

I think you need else children(); after the if or the result will be nothing.

On Tue, 10 Dec 2019 at 18:40, Max Bond max.o.bond@gmail.com wrote:

Hi,

I was wondering if I could get some guidance. I'm writing a model with a recursive module, and I want to operate on the children with some transformations. However, whenever I try to operate on the children, they fail to render.

Here is a simplified test case:

module test(d=5) {
if(d>0) {
test(d-1)
union() {
circle();
children();
}
}
}

test();

Commenting out the union causes the circles to render. While the union does nothing here, the same goes for things like rotate that I rather need.

I'm using 2019.05.

Thanks,
Max


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

Not sure why that is necessary, particularly since children() is empty... On Tue, Dec 10, 2019 at 1:49 PM nop head <nop.head@gmail.com> wrote: > > I think you need else children(); after the if or the result will be nothing. > > On Tue, 10 Dec 2019 at 18:40, Max Bond <max.o.bond@gmail.com> wrote: >> >> Hi, >> >> I was wondering if I could get some guidance. I'm writing a model with a recursive module, and I want to operate on the children with some transformations. However, whenever I try to operate on the children, they fail to render. >> >> Here is a simplified test case: >> >> module test(d=5) { >> if(d>0) { >> test(d-1) >> union() { >> circle(); >> children(); >> } >> } >> } >> >> test(); >> >> Commenting out the union causes the circles to render. While the union does nothing here, the same goes for things like rotate that I rather need. >> >> I'm using 2019.05. >> >> Thanks, >> Max >> _______________________________________________ >> 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
AC
A. Craig West
Tue, Dec 10, 2019 6:57 PM

never mind, I missed the obvious...

On Tue, Dec 10, 2019 at 1:56 PM A. Craig West acraigwest@gmail.com wrote:

Not sure why that is necessary, particularly since children() is empty...

On Tue, Dec 10, 2019 at 1:49 PM nop head nop.head@gmail.com wrote:

I think you need else children(); after the if or the result will be nothing.

On Tue, 10 Dec 2019 at 18:40, Max Bond max.o.bond@gmail.com wrote:

Hi,

I was wondering if I could get some guidance. I'm writing a model with a recursive module, and I want to operate on the children with some transformations. However, whenever I try to operate on the children, they fail to render.

Here is a simplified test case:

module test(d=5) {
if(d>0) {
test(d-1)
union() {
circle();
children();
}
}
}

test();

Commenting out the union causes the circles to render. While the union does nothing here, the same goes for things like rotate that I rather need.

I'm using 2019.05.

Thanks,
Max


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

never mind, I missed the obvious... On Tue, Dec 10, 2019 at 1:56 PM A. Craig West <acraigwest@gmail.com> wrote: > > Not sure why that is necessary, particularly since children() is empty... > > On Tue, Dec 10, 2019 at 1:49 PM nop head <nop.head@gmail.com> wrote: > > > > I think you need else children(); after the if or the result will be nothing. > > > > On Tue, 10 Dec 2019 at 18:40, Max Bond <max.o.bond@gmail.com> wrote: > >> > >> Hi, > >> > >> I was wondering if I could get some guidance. I'm writing a model with a recursive module, and I want to operate on the children with some transformations. However, whenever I try to operate on the children, they fail to render. > >> > >> Here is a simplified test case: > >> > >> module test(d=5) { > >> if(d>0) { > >> test(d-1) > >> union() { > >> circle(); > >> children(); > >> } > >> } > >> } > >> > >> test(); > >> > >> Commenting out the union causes the circles to render. While the union does nothing here, the same goes for things like rotate that I rather need. > >> > >> I'm using 2019.05. > >> > >> Thanks, > >> Max > >> _______________________________________________ > >> 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
MB
Max Bond
Tue, Dec 10, 2019 7:00 PM

You and I both :)

On Tue, Dec 10, 2019 at 11:58 AM A. Craig West acraigwest@gmail.com wrote:

never mind, I missed the obvious...

On Tue, Dec 10, 2019 at 1:56 PM A. Craig West acraigwest@gmail.com
wrote:

Not sure why that is necessary, particularly since children() is empty...

On Tue, Dec 10, 2019 at 1:49 PM nop head nop.head@gmail.com wrote:

I think you need else children(); after the if or the result will be

nothing.

On Tue, 10 Dec 2019 at 18:40, Max Bond max.o.bond@gmail.com wrote:

Hi,

I was wondering if I could get some guidance. I'm writing a model

with a recursive module, and I want to operate on the children with some
transformations. However, whenever I try to operate on the children, they
fail to render.

Here is a simplified test case:

module test(d=5) {
if(d>0) {
test(d-1)
union() {
circle();
children();
}
}
}

test();

Commenting out the union causes the circles to render. While the

union does nothing here, the same goes for things like rotate that I rather
need.

You and I both :) On Tue, Dec 10, 2019 at 11:58 AM A. Craig West <acraigwest@gmail.com> wrote: > never mind, I missed the obvious... > > On Tue, Dec 10, 2019 at 1:56 PM A. Craig West <acraigwest@gmail.com> > wrote: > > > > Not sure why that is necessary, particularly since children() is empty... > > > > On Tue, Dec 10, 2019 at 1:49 PM nop head <nop.head@gmail.com> wrote: > > > > > > I think you need else children(); after the if or the result will be > nothing. > > > > > > On Tue, 10 Dec 2019 at 18:40, Max Bond <max.o.bond@gmail.com> wrote: > > >> > > >> Hi, > > >> > > >> I was wondering if I could get some guidance. I'm writing a model > with a recursive module, and I want to operate on the children with some > transformations. However, whenever I try to operate on the children, they > fail to render. > > >> > > >> Here is a simplified test case: > > >> > > >> module test(d=5) { > > >> if(d>0) { > > >> test(d-1) > > >> union() { > > >> circle(); > > >> children(); > > >> } > > >> } > > >> } > > >> > > >> test(); > > >> > > >> Commenting out the union causes the circles to render. While the > union does nothing here, the same goes for things like rotate that I rather > need. > > >> > > >> I'm using 2019.05. > > >> > > >> Thanks, > > >> Max > > >> _______________________________________________ > > >> 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 >