discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

difference() issue. Any help would be appreciated.

DH
Dave Harris
Thu, Feb 3, 2022 8:12 PM

// test4objectsWithWindows.scad
// Each object has a window,
// cube & prism in +Y plane,
// cube & prism in -Y plane.
//
// Issue: -Y prism disapears.

module window(x, y, w, h)
{
translate([x, y, -1]) // punch out
cube([w, h, 3]);
};

module prism(h, lL, lR, w)
{
polyhedron(points=[
[0, 0, 0]    // 0 back LH corner
,[lL, h, 0]    // 1 back peak
,[lL+lR, 0, 0] // 2 back RH corner
,[0, 0, w]    // 3 front LH corner
,[lL, h, w]    // 4 front peak
,[lL+lR, 0, w] // 5 front RH corner
], faces=[
[0, 3, 5, 2] // bottom
,[0, 1, 4, 3] // LH ramp
,[1, 2, 5, 4] // RH ramp
,[2, 1, 0]    // back wall
,[3, 4, 5]    // front wall
]
);
}

difference() // +Y prism ...ok
{
translate([0, 30, 0])
prism(lL=25, lR=25, h=40, w=1);
window(x=20, y=40, w=10, h=10);
}
// show +Y cube window punch location
window(x=21, y=41, w=8, h=8);

difference() // +Y cube ...ok
{
translate([0, 0, 0])
cube([50, 29, 1]);
window(x=20, y=10, w=10, h=10);
}
// show +Y cube window punch location
window(x=21, y=11, w=8, h=8);

difference() // -Y cube ...ok
{
translate([0, -31, 0])
cube([50, 30, 1]);
window(x=20, y=-20, w=10, h=10);
}
// show -Y cube window punch location
window(x=21, y=-19, w=8, h=8);

difference() // -Y prism ... issue.
{
translate([0, -32, 0])
prism(lL= 25, lR=25, h=-40, w=1);
//window(x=20, y=-50, w=10, h=10);
} //comment out window, -Y prism is back

// show -Y prism window punch location
window(x=22, y=-52, w=8, h=8);

// preview/render - no error or warning
// eof

// Best regards Dave

// test4objectsWithWindows.scad // Each object has a window, // cube & prism in +Y plane, // cube & prism in -Y plane. // // Issue: -Y prism disapears. module window(x, y, w, h) { translate([x, y, -1]) // punch out cube([w, h, 3]); }; module prism(h, lL, lR, w) { polyhedron(points=[ [0, 0, 0] // 0 back LH corner ,[lL, h, 0] // 1 back peak ,[lL+lR, 0, 0] // 2 back RH corner ,[0, 0, w] // 3 front LH corner ,[lL, h, w] // 4 front peak ,[lL+lR, 0, w] // 5 front RH corner ], faces=[ [0, 3, 5, 2] // bottom ,[0, 1, 4, 3] // LH ramp ,[1, 2, 5, 4] // RH ramp ,[2, 1, 0] // back wall ,[3, 4, 5] // front wall ] ); } difference() // +Y prism ...ok { translate([0, 30, 0]) prism(lL=25, lR=25, h=40, w=1); window(x=20, y=40, w=10, h=10); } // show +Y cube window punch location window(x=21, y=41, w=8, h=8); difference() // +Y cube ...ok { translate([0, 0, 0]) cube([50, 29, 1]); window(x=20, y=10, w=10, h=10); } // show +Y cube window punch location window(x=21, y=11, w=8, h=8); difference() // -Y cube ...ok { translate([0, -31, 0]) cube([50, 30, 1]); window(x=20, y=-20, w=10, h=10); } // show -Y cube window punch location window(x=21, y=-19, w=8, h=8); difference() // -Y prism ... issue. { translate([0, -32, 0]) prism(lL= 25, lR=25, h=-40, w=1); //window(x=20, y=-50, w=10, h=10); } //comment out window, -Y prism is back // show -Y prism window punch location window(x=22, y=-52, w=8, h=8); // preview/render - no error or warning // eof // Best regards Dave
NH
nop head
Thu, Feb 3, 2022 8:16 PM

Looks like it is inside out:

[image: image.png]

On Thu, 3 Feb 2022 at 20:12, Dave Harris wortinguk@gmail.com wrote:

// test4objectsWithWindows.scad
// Each object has a window,
// cube & prism in +Y plane,
// cube & prism in -Y plane.
//
// Issue: -Y prism disapears.

module window(x, y, w, h)
{
translate([x, y, -1]) // punch out
cube([w, h, 3]);
};

module prism(h, lL, lR, w)
{
polyhedron(points=[
[0, 0, 0]    // 0 back LH corner
,[lL, h, 0]    // 1 back peak
,[lL+lR, 0, 0] // 2 back RH corner
,[0, 0, w]    // 3 front LH corner
,[lL, h, w]    // 4 front peak
,[lL+lR, 0, w] // 5 front RH corner
], faces=[
[0, 3, 5, 2] // bottom
,[0, 1, 4, 3] // LH ramp
,[1, 2, 5, 4] // RH ramp
,[2, 1, 0]    // back wall
,[3, 4, 5]    // front wall
]
);
}

difference() // +Y prism ...ok
{
translate([0, 30, 0])
prism(lL=25, lR=25, h=40, w=1);
window(x=20, y=40, w=10, h=10);
}
// show +Y cube window punch location
window(x=21, y=41, w=8, h=8);

difference() // +Y cube ...ok
{
translate([0, 0, 0])
cube([50, 29, 1]);
window(x=20, y=10, w=10, h=10);
}
// show +Y cube window punch location
window(x=21, y=11, w=8, h=8);

difference() // -Y cube ...ok
{
translate([0, -31, 0])
cube([50, 30, 1]);
window(x=20, y=-20, w=10, h=10);
}
// show -Y cube window punch location
window(x=21, y=-19, w=8, h=8);

difference() // -Y prism ... issue.
{
translate([0, -32, 0])
prism(lL= 25, lR=25, h=-40, w=1);
//window(x=20, y=-50, w=10, h=10);
} //comment out window, -Y prism is back

// show -Y prism window punch location
window(x=22, y=-52, w=8, h=8);

// preview/render - no error or warning
// eof

// Best regards Dave


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

Looks like it is inside out: [image: image.png] On Thu, 3 Feb 2022 at 20:12, Dave Harris <wortinguk@gmail.com> wrote: > // test4objectsWithWindows.scad > // Each object has a window, > // cube & prism in +Y plane, > // cube & prism in -Y plane. > // > // Issue: -Y prism disapears. > > module window(x, y, w, h) > { > translate([x, y, -1]) // punch out > cube([w, h, 3]); > }; > > module prism(h, lL, lR, w) > { > polyhedron(points=[ > [0, 0, 0] // 0 back LH corner > ,[lL, h, 0] // 1 back peak > ,[lL+lR, 0, 0] // 2 back RH corner > ,[0, 0, w] // 3 front LH corner > ,[lL, h, w] // 4 front peak > ,[lL+lR, 0, w] // 5 front RH corner > ], faces=[ > [0, 3, 5, 2] // bottom > ,[0, 1, 4, 3] // LH ramp > ,[1, 2, 5, 4] // RH ramp > ,[2, 1, 0] // back wall > ,[3, 4, 5] // front wall > ] > ); > } > > difference() // +Y prism ...ok > { > translate([0, 30, 0]) > prism(lL=25, lR=25, h=40, w=1); > window(x=20, y=40, w=10, h=10); > } > // show +Y cube window punch location > window(x=21, y=41, w=8, h=8); > > difference() // +Y cube ...ok > { > translate([0, 0, 0]) > cube([50, 29, 1]); > window(x=20, y=10, w=10, h=10); > } > // show +Y cube window punch location > window(x=21, y=11, w=8, h=8); > > difference() // -Y cube ...ok > { > translate([0, -31, 0]) > cube([50, 30, 1]); > window(x=20, y=-20, w=10, h=10); > } > // show -Y cube window punch location > window(x=21, y=-19, w=8, h=8); > > difference() // -Y prism ... issue. > { > translate([0, -32, 0]) > prism(lL= 25, lR=25, h=-40, w=1); > //window(x=20, y=-50, w=10, h=10); > } //comment out window, -Y prism is back > > // show -Y prism window punch location > window(x=22, y=-52, w=8, h=8); > > // preview/render - no error or warning > // eof > > > // Best regards Dave > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
DH
Dave Harris
Thu, Feb 3, 2022 10:05 PM

Hi

Inside out?
I tried ...

difference() // -Y prism ... issue.
{
translate([0, -32, 1])
prism(lL= 25, lR=25, h=-40, w=-1);
window(x=20, y=-50, w=10, h=10);
}

So the prism width is now -1... and it now works good!

Inside out? Can someone explain this strange concept!

Dave

On Thu, 3 Feb 2022 at 20:16, nop head nop.head@gmail.com wrote:

Looks like it is inside out:

[image: image.png]

On Thu, 3 Feb 2022 at 20:12, Dave Harris wortinguk@gmail.com wrote:

// test4objectsWithWindows.scad
// Each object has a window,
// cube & prism in +Y plane,
// cube & prism in -Y plane.
//
// Issue: -Y prism disapears.

module window(x, y, w, h)
{
translate([x, y, -1]) // punch out
cube([w, h, 3]);
};

module prism(h, lL, lR, w)
{
polyhedron(points=[
[0, 0, 0]    // 0 back LH corner
,[lL, h, 0]    // 1 back peak
,[lL+lR, 0, 0] // 2 back RH corner
,[0, 0, w]    // 3 front LH corner
,[lL, h, w]    // 4 front peak
,[lL+lR, 0, w] // 5 front RH corner
], faces=[
[0, 3, 5, 2] // bottom
,[0, 1, 4, 3] // LH ramp
,[1, 2, 5, 4] // RH ramp
,[2, 1, 0]    // back wall
,[3, 4, 5]    // front wall
]
);
}

difference() // +Y prism ...ok
{
translate([0, 30, 0])
prism(lL=25, lR=25, h=40, w=1);
window(x=20, y=40, w=10, h=10);
}
// show +Y cube window punch location
window(x=21, y=41, w=8, h=8);

difference() // +Y cube ...ok
{
translate([0, 0, 0])
cube([50, 29, 1]);
window(x=20, y=10, w=10, h=10);
}
// show +Y cube window punch location
window(x=21, y=11, w=8, h=8);

difference() // -Y cube ...ok
{
translate([0, -31, 0])
cube([50, 30, 1]);
window(x=20, y=-20, w=10, h=10);
}
// show -Y cube window punch location
window(x=21, y=-19, w=8, h=8);

difference() // -Y prism ... issue.
{
translate([0, -32, 0])
prism(lL= 25, lR=25, h=-40, w=1);
//window(x=20, y=-50, w=10, h=10);
} //comment out window, -Y prism is back

// show -Y prism window punch location
window(x=22, y=-52, w=8, h=8);

// preview/render - no error or warning
// eof

// Best regards Dave


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

--

Best regards
Dave

Hi Inside out? I tried ... difference() // -Y prism ... issue. { translate([0, -32, 1]) prism(lL= 25, lR=25, h=-40, w=-1); window(x=20, y=-50, w=10, h=10); } So the prism width is now -1... and it now works good! Inside out? Can someone explain this strange concept! Dave On Thu, 3 Feb 2022 at 20:16, nop head <nop.head@gmail.com> wrote: > Looks like it is inside out: > > [image: image.png] > > On Thu, 3 Feb 2022 at 20:12, Dave Harris <wortinguk@gmail.com> wrote: > >> // test4objectsWithWindows.scad >> // Each object has a window, >> // cube & prism in +Y plane, >> // cube & prism in -Y plane. >> // >> // Issue: -Y prism disapears. >> >> module window(x, y, w, h) >> { >> translate([x, y, -1]) // punch out >> cube([w, h, 3]); >> }; >> >> module prism(h, lL, lR, w) >> { >> polyhedron(points=[ >> [0, 0, 0] // 0 back LH corner >> ,[lL, h, 0] // 1 back peak >> ,[lL+lR, 0, 0] // 2 back RH corner >> ,[0, 0, w] // 3 front LH corner >> ,[lL, h, w] // 4 front peak >> ,[lL+lR, 0, w] // 5 front RH corner >> ], faces=[ >> [0, 3, 5, 2] // bottom >> ,[0, 1, 4, 3] // LH ramp >> ,[1, 2, 5, 4] // RH ramp >> ,[2, 1, 0] // back wall >> ,[3, 4, 5] // front wall >> ] >> ); >> } >> >> difference() // +Y prism ...ok >> { >> translate([0, 30, 0]) >> prism(lL=25, lR=25, h=40, w=1); >> window(x=20, y=40, w=10, h=10); >> } >> // show +Y cube window punch location >> window(x=21, y=41, w=8, h=8); >> >> difference() // +Y cube ...ok >> { >> translate([0, 0, 0]) >> cube([50, 29, 1]); >> window(x=20, y=10, w=10, h=10); >> } >> // show +Y cube window punch location >> window(x=21, y=11, w=8, h=8); >> >> difference() // -Y cube ...ok >> { >> translate([0, -31, 0]) >> cube([50, 30, 1]); >> window(x=20, y=-20, w=10, h=10); >> } >> // show -Y cube window punch location >> window(x=21, y=-19, w=8, h=8); >> >> difference() // -Y prism ... issue. >> { >> translate([0, -32, 0]) >> prism(lL= 25, lR=25, h=-40, w=1); >> //window(x=20, y=-50, w=10, h=10); >> } //comment out window, -Y prism is back >> >> // show -Y prism window punch location >> window(x=22, y=-52, w=8, h=8); >> >> // preview/render - no error or warning >> // eof >> >> >> // Best regards Dave >> _______________________________________________ >> OpenSCAD mailing list >> To unsubscribe send an email to discuss-leave@lists.openscad.org >> > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org > -- Best regards Dave
NH
nop head
Thu, Feb 3, 2022 10:22 PM

The faces of the polyhedron need to be listed in clockwise order
looking from the outside. If they are anticlockwise they are facing the
wrong way and will be coloured purple in the thrown together view.

On Thu, 3 Feb 2022 at 22:05, Dave Harris wortinguk@gmail.com wrote:

Hi

Inside out?
I tried ...

difference() // -Y prism ... issue.
{
translate([0, -32, 1])
prism(lL= 25, lR=25, h=-40, w=-1);
window(x=20, y=-50, w=10, h=10);
}

So the prism width is now -1... and it now works good!

Inside out? Can someone explain this strange concept!

Dave

On Thu, 3 Feb 2022 at 20:16, nop head nop.head@gmail.com wrote:

Looks like it is inside out:

[image: image.png]

On Thu, 3 Feb 2022 at 20:12, Dave Harris wortinguk@gmail.com wrote:

// test4objectsWithWindows.scad
// Each object has a window,
// cube & prism in +Y plane,
// cube & prism in -Y plane.
//
// Issue: -Y prism disapears.

module window(x, y, w, h)
{
translate([x, y, -1]) // punch out
cube([w, h, 3]);
};

module prism(h, lL, lR, w)
{
polyhedron(points=[
[0, 0, 0]    // 0 back LH corner
,[lL, h, 0]    // 1 back peak
,[lL+lR, 0, 0] // 2 back RH corner
,[0, 0, w]    // 3 front LH corner
,[lL, h, w]    // 4 front peak
,[lL+lR, 0, w] // 5 front RH corner
], faces=[
[0, 3, 5, 2] // bottom
,[0, 1, 4, 3] // LH ramp
,[1, 2, 5, 4] // RH ramp
,[2, 1, 0]    // back wall
,[3, 4, 5]    // front wall
]
);
}

difference() // +Y prism ...ok
{
translate([0, 30, 0])
prism(lL=25, lR=25, h=40, w=1);
window(x=20, y=40, w=10, h=10);
}
// show +Y cube window punch location
window(x=21, y=41, w=8, h=8);

difference() // +Y cube ...ok
{
translate([0, 0, 0])
cube([50, 29, 1]);
window(x=20, y=10, w=10, h=10);
}
// show +Y cube window punch location
window(x=21, y=11, w=8, h=8);

difference() // -Y cube ...ok
{
translate([0, -31, 0])
cube([50, 30, 1]);
window(x=20, y=-20, w=10, h=10);
}
// show -Y cube window punch location
window(x=21, y=-19, w=8, h=8);

difference() // -Y prism ... issue.
{
translate([0, -32, 0])
prism(lL= 25, lR=25, h=-40, w=1);
//window(x=20, y=-50, w=10, h=10);
} //comment out window, -Y prism is back

// show -Y prism window punch location
window(x=22, y=-52, w=8, h=8);

// preview/render - no error or warning
// eof

// Best regards Dave


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

--

Best regards
Dave


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

The faces of the polyhedron need to be listed in clockwise order looking from the outside. If they are anticlockwise they are facing the wrong way and will be coloured purple in the thrown together view. On Thu, 3 Feb 2022 at 22:05, Dave Harris <wortinguk@gmail.com> wrote: > Hi > > Inside out? > I tried ... > > difference() // -Y prism ... issue. > { > translate([0, -32, 1]) > prism(lL= 25, lR=25, h=-40, w=-1); > window(x=20, y=-50, w=10, h=10); > } > > So the prism width is now -1... and it now works good! > > Inside out? Can someone explain this strange concept! > > Dave > > On Thu, 3 Feb 2022 at 20:16, nop head <nop.head@gmail.com> wrote: > >> Looks like it is inside out: >> >> [image: image.png] >> >> On Thu, 3 Feb 2022 at 20:12, Dave Harris <wortinguk@gmail.com> wrote: >> >>> // test4objectsWithWindows.scad >>> // Each object has a window, >>> // cube & prism in +Y plane, >>> // cube & prism in -Y plane. >>> // >>> // Issue: -Y prism disapears. >>> >>> module window(x, y, w, h) >>> { >>> translate([x, y, -1]) // punch out >>> cube([w, h, 3]); >>> }; >>> >>> module prism(h, lL, lR, w) >>> { >>> polyhedron(points=[ >>> [0, 0, 0] // 0 back LH corner >>> ,[lL, h, 0] // 1 back peak >>> ,[lL+lR, 0, 0] // 2 back RH corner >>> ,[0, 0, w] // 3 front LH corner >>> ,[lL, h, w] // 4 front peak >>> ,[lL+lR, 0, w] // 5 front RH corner >>> ], faces=[ >>> [0, 3, 5, 2] // bottom >>> ,[0, 1, 4, 3] // LH ramp >>> ,[1, 2, 5, 4] // RH ramp >>> ,[2, 1, 0] // back wall >>> ,[3, 4, 5] // front wall >>> ] >>> ); >>> } >>> >>> difference() // +Y prism ...ok >>> { >>> translate([0, 30, 0]) >>> prism(lL=25, lR=25, h=40, w=1); >>> window(x=20, y=40, w=10, h=10); >>> } >>> // show +Y cube window punch location >>> window(x=21, y=41, w=8, h=8); >>> >>> difference() // +Y cube ...ok >>> { >>> translate([0, 0, 0]) >>> cube([50, 29, 1]); >>> window(x=20, y=10, w=10, h=10); >>> } >>> // show +Y cube window punch location >>> window(x=21, y=11, w=8, h=8); >>> >>> difference() // -Y cube ...ok >>> { >>> translate([0, -31, 0]) >>> cube([50, 30, 1]); >>> window(x=20, y=-20, w=10, h=10); >>> } >>> // show -Y cube window punch location >>> window(x=21, y=-19, w=8, h=8); >>> >>> difference() // -Y prism ... issue. >>> { >>> translate([0, -32, 0]) >>> prism(lL= 25, lR=25, h=-40, w=1); >>> //window(x=20, y=-50, w=10, h=10); >>> } //comment out window, -Y prism is back >>> >>> // show -Y prism window punch location >>> window(x=22, y=-52, w=8, h=8); >>> >>> // preview/render - no error or warning >>> // eof >>> >>> >>> // Best regards Dave >>> _______________________________________________ >>> OpenSCAD mailing list >>> To unsubscribe send an email to discuss-leave@lists.openscad.org >>> >> _______________________________________________ >> OpenSCAD mailing list >> To unsubscribe send an email to discuss-leave@lists.openscad.org >> > > > -- > > Best regards > Dave > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
DH
Dave Harris
Thu, Feb 3, 2022 10:40 PM

Many thanks for info

Dave

On Thu, 3 Feb 2022 at 22:23, nop head nop.head@gmail.com wrote:

The faces of the polyhedron need to be listed in clockwise order
looking from the outside. If they are anticlockwise they are facing the
wrong way and will be coloured purple in the thrown together view.

On Thu, 3 Feb 2022 at 22:05, Dave Harris wortinguk@gmail.com wrote:

Hi

Inside out?
I tried ...

difference() // -Y prism ... issue.
{
translate([0, -32, 1])
prism(lL= 25, lR=25, h=-40, w=-1);
window(x=20, y=-50, w=10, h=10);
}

So the prism width is now -1... and it now works good!

Inside out? Can someone explain this strange concept!

Dave

On Thu, 3 Feb 2022 at 20:16, nop head nop.head@gmail.com wrote:

Looks like it is inside out:

[image: image.png]

On Thu, 3 Feb 2022 at 20:12, Dave Harris wortinguk@gmail.com wrote:

// test4objectsWithWindows.scad
// Each object has a window,
// cube & prism in +Y plane,
// cube & prism in -Y plane.
//
// Issue: -Y prism disapears.

module window(x, y, w, h)
{
translate([x, y, -1]) // punch out
cube([w, h, 3]);
};

module prism(h, lL, lR, w)
{
polyhedron(points=[
[0, 0, 0]    // 0 back LH corner
,[lL, h, 0]    // 1 back peak
,[lL+lR, 0, 0] // 2 back RH corner
,[0, 0, w]    // 3 front LH corner
,[lL, h, w]    // 4 front peak
,[lL+lR, 0, w] // 5 front RH corner
], faces=[
[0, 3, 5, 2] // bottom
,[0, 1, 4, 3] // LH ramp
,[1, 2, 5, 4] // RH ramp
,[2, 1, 0]    // back wall
,[3, 4, 5]    // front wall
]
);
}

difference() // +Y prism ...ok
{
translate([0, 30, 0])
prism(lL=25, lR=25, h=40, w=1);
window(x=20, y=40, w=10, h=10);
}
// show +Y cube window punch location
window(x=21, y=41, w=8, h=8);

difference() // +Y cube ...ok
{
translate([0, 0, 0])
cube([50, 29, 1]);
window(x=20, y=10, w=10, h=10);
}
// show +Y cube window punch location
window(x=21, y=11, w=8, h=8);

difference() // -Y cube ...ok
{
translate([0, -31, 0])
cube([50, 30, 1]);
window(x=20, y=-20, w=10, h=10);
}
// show -Y cube window punch location
window(x=21, y=-19, w=8, h=8);

difference() // -Y prism ... issue.
{
translate([0, -32, 0])
prism(lL= 25, lR=25, h=-40, w=1);
//window(x=20, y=-50, w=10, h=10);
} //comment out window, -Y prism is back

// show -Y prism window punch location
window(x=22, y=-52, w=8, h=8);

// preview/render - no error or warning
// eof

// Best regards Dave


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

--

Best regards
Dave


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org


OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org

--

Best regards
Dave

Many thanks for info Dave On Thu, 3 Feb 2022 at 22:23, nop head <nop.head@gmail.com> wrote: > The faces of the polyhedron need to be listed in clockwise order > looking from the outside. If they are anticlockwise they are facing the > wrong way and will be coloured purple in the thrown together view. > > On Thu, 3 Feb 2022 at 22:05, Dave Harris <wortinguk@gmail.com> wrote: > >> Hi >> >> Inside out? >> I tried ... >> >> difference() // -Y prism ... issue. >> { >> translate([0, -32, 1]) >> prism(lL= 25, lR=25, h=-40, w=-1); >> window(x=20, y=-50, w=10, h=10); >> } >> >> So the prism width is now -1... and it now works good! >> >> Inside out? Can someone explain this strange concept! >> >> Dave >> >> On Thu, 3 Feb 2022 at 20:16, nop head <nop.head@gmail.com> wrote: >> >>> Looks like it is inside out: >>> >>> [image: image.png] >>> >>> On Thu, 3 Feb 2022 at 20:12, Dave Harris <wortinguk@gmail.com> wrote: >>> >>>> // test4objectsWithWindows.scad >>>> // Each object has a window, >>>> // cube & prism in +Y plane, >>>> // cube & prism in -Y plane. >>>> // >>>> // Issue: -Y prism disapears. >>>> >>>> module window(x, y, w, h) >>>> { >>>> translate([x, y, -1]) // punch out >>>> cube([w, h, 3]); >>>> }; >>>> >>>> module prism(h, lL, lR, w) >>>> { >>>> polyhedron(points=[ >>>> [0, 0, 0] // 0 back LH corner >>>> ,[lL, h, 0] // 1 back peak >>>> ,[lL+lR, 0, 0] // 2 back RH corner >>>> ,[0, 0, w] // 3 front LH corner >>>> ,[lL, h, w] // 4 front peak >>>> ,[lL+lR, 0, w] // 5 front RH corner >>>> ], faces=[ >>>> [0, 3, 5, 2] // bottom >>>> ,[0, 1, 4, 3] // LH ramp >>>> ,[1, 2, 5, 4] // RH ramp >>>> ,[2, 1, 0] // back wall >>>> ,[3, 4, 5] // front wall >>>> ] >>>> ); >>>> } >>>> >>>> difference() // +Y prism ...ok >>>> { >>>> translate([0, 30, 0]) >>>> prism(lL=25, lR=25, h=40, w=1); >>>> window(x=20, y=40, w=10, h=10); >>>> } >>>> // show +Y cube window punch location >>>> window(x=21, y=41, w=8, h=8); >>>> >>>> difference() // +Y cube ...ok >>>> { >>>> translate([0, 0, 0]) >>>> cube([50, 29, 1]); >>>> window(x=20, y=10, w=10, h=10); >>>> } >>>> // show +Y cube window punch location >>>> window(x=21, y=11, w=8, h=8); >>>> >>>> difference() // -Y cube ...ok >>>> { >>>> translate([0, -31, 0]) >>>> cube([50, 30, 1]); >>>> window(x=20, y=-20, w=10, h=10); >>>> } >>>> // show -Y cube window punch location >>>> window(x=21, y=-19, w=8, h=8); >>>> >>>> difference() // -Y prism ... issue. >>>> { >>>> translate([0, -32, 0]) >>>> prism(lL= 25, lR=25, h=-40, w=1); >>>> //window(x=20, y=-50, w=10, h=10); >>>> } //comment out window, -Y prism is back >>>> >>>> // show -Y prism window punch location >>>> window(x=22, y=-52, w=8, h=8); >>>> >>>> // preview/render - no error or warning >>>> // eof >>>> >>>> >>>> // Best regards Dave >>>> _______________________________________________ >>>> OpenSCAD mailing list >>>> To unsubscribe send an email to discuss-leave@lists.openscad.org >>>> >>> _______________________________________________ >>> OpenSCAD mailing list >>> To unsubscribe send an email to discuss-leave@lists.openscad.org >>> >> >> >> -- >> >> Best regards >> Dave >> >> _______________________________________________ >> OpenSCAD mailing list >> To unsubscribe send an email to discuss-leave@lists.openscad.org >> > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org > -- Best regards Dave