discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Preview works, but parts missing from render - "mesh is not closed"

AN
Adam Nielsen
Wed, Jul 15, 2026 1:29 AM

Hi all,

Does anyone know why this code works fine in preview but won't render?
The straight part renders, but the round part at the bottom only
appears in preview mode and disappears when rendering.  It gives me the
error during rendering:

ERROR: The given mesh is not closed! Unable to convert to CGAL_Nef_Polyhedron.

The same polygon works if I rotate it at different angles, but this
particular orientation doesn't seem to work.

If I reduce $fn to 51 or below then it works, but above 51 the part
fails to render.  If I remove the straight part, then the round part
renders fine, but when the straight part is present the round part
won't render.  If I comment out some of the translate/rotate lines for
the round part then it renders, but the exact combination I have causes
the error.

Can anyone see what the problem is?

Many thanks,
Adam.


$fn = 51;

gap = 0.01;

bezel_height = 4.1;
b_depth = 1 + 10.4 + 3.9;
profile = [
[0, 0],
[1, 0],
[1, 2],
[4.2, bezel_height],
[10.4, 2],
[10.4, 0],
[b_depth, 0],
[b_depth, 14.2],
[0, 14.2],
];

dims = [240, 133];

// Left
rotate([0, 0, 90])
translate([0, 0, -dims.y])
linear_extrude(height = dims.y)
polygon(profile);

// Bottom-left
translate([0, b_depth, -dims.y])
rotate([0, 0, 180])
rotate([0, 90, 0])
rotate_extrude(angle = 90)
translate([b_depth, 0, 0])
rotate([0, 180, 0])
polygon(profile);

Hi all, Does anyone know why this code works fine in preview but won't render? The straight part renders, but the round part at the bottom only appears in preview mode and disappears when rendering. It gives me the error during rendering: ERROR: The given mesh is not closed! Unable to convert to CGAL_Nef_Polyhedron. The same polygon works if I rotate it at different angles, but this particular orientation doesn't seem to work. If I reduce $fn to 51 or below then it works, but above 51 the part fails to render. If I remove the straight part, then the round part renders fine, but when the straight part is present the round part won't render. If I comment out some of the translate/rotate lines for the round part then it renders, but the exact combination I have causes the error. Can anyone see what the problem is? Many thanks, Adam. ----- $fn = 51; gap = 0.01; bezel_height = 4.1; b_depth = 1 + 10.4 + 3.9; profile = [ [0, 0], [1, 0], [1, 2], [4.2, bezel_height], [10.4, 2], [10.4, 0], [b_depth, 0], [b_depth, 14.2], [0, 14.2], ]; dims = [240, 133]; // Left rotate([0, 0, 90]) translate([0, 0, -dims.y]) linear_extrude(height = dims.y) polygon(profile); // Bottom-left translate([0, b_depth, -dims.y]) rotate([0, 0, 180]) rotate([0, 90, 0]) rotate_extrude(angle = 90) translate([b_depth, 0, 0]) rotate([0, 180, 0]) polygon(profile);
JB
Jordan Brown
Wed, Jul 15, 2026 2:33 AM
  rotate([0, 180, 0])
  polygon(profile);

You're rotating a 2D object around an axis other than Z.  That's almost
never a good idea.  However, it isn't obviously the problem.

My guess is that the endpoint of the 90-degree rotational extrusion
isn't perfect, and it is matching up poorly with the linear extrusion. 
You might try turning things around so that the rotational extrusion
starts at the linear extrusion, rather than ending there.  That
doesn't help if you're going to attach another linear extrusion on the
other side.

Having the linear and rotational extrusions overlap just a hair - say,
extending the linear extrusion by 0.01 - might help.

> rotate([0, 180, 0]) > polygon(profile); You're rotating a 2D object around an axis other than Z.  That's almost never a good idea.  However, it isn't obviously the problem. My guess is that the endpoint of the 90-degree rotational extrusion isn't perfect, and it is matching up poorly with the linear extrusion.  You might try turning things around so that the rotational extrusion *starts* at the linear extrusion, rather than *ending* there.  That doesn't help if you're going to attach another linear extrusion on the other side. Having the linear and rotational extrusions overlap just a hair - say, extending the linear extrusion by 0.01 - might help.
CC
Cory Cross
Wed, Jul 15, 2026 3:03 AM

Try it with Manifold instead of CGAL.

On July 14, 2026 6:29:19 PM PDT, Adam Nielsen via Discuss discuss@lists.openscad.org wrote:

Hi all,

Does anyone know why this code works fine in preview but won't render?
The straight part renders, but the round part at the bottom only
appears in preview mode and disappears when rendering.  It gives me the
error during rendering:

ERROR: The given mesh is not closed! Unable to convert to CGAL_Nef_Polyhedron.

The same polygon works if I rotate it at different angles, but this
particular orientation doesn't seem to work.

If I reduce $fn to 51 or below then it works, but above 51 the part
fails to render.  If I remove the straight part, then the round part
renders fine, but when the straight part is present the round part
won't render.  If I comment out some of the translate/rotate lines for
the round part then it renders, but the exact combination I have causes
the error.

Can anyone see what the problem is?

Many thanks,
Adam.


$fn = 51;

gap = 0.01;

bezel_height = 4.1;
b_depth = 1 + 10.4 + 3.9;
profile = [
[0, 0],
[1, 0],
[1, 2],
[4.2, bezel_height],
[10.4, 2],
[10.4, 0],
[b_depth, 0],
[b_depth, 14.2],
[0, 14.2],
];

dims = [240, 133];

// Left
rotate([0, 0, 90])
translate([0, 0, -dims.y])
linear_extrude(height = dims.y)
polygon(profile);

// Bottom-left
translate([0, b_depth, -dims.y])
rotate([0, 0, 180])
rotate([0, 90, 0])
rotate_extrude(angle = 90)
translate([b_depth, 0, 0])
rotate([0, 180, 0])
polygon(profile);


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

Try it with Manifold instead of CGAL. On July 14, 2026 6:29:19 PM PDT, Adam Nielsen via Discuss <discuss@lists.openscad.org> wrote: >Hi all, > >Does anyone know why this code works fine in preview but won't render? >The straight part renders, but the round part at the bottom only >appears in preview mode and disappears when rendering. It gives me the >error during rendering: > > ERROR: The given mesh is not closed! Unable to convert to CGAL_Nef_Polyhedron. > >The same polygon works if I rotate it at different angles, but this >particular orientation doesn't seem to work. > >If I reduce $fn to 51 or below then it works, but above 51 the part >fails to render. If I remove the straight part, then the round part >renders fine, but when the straight part is present the round part >won't render. If I comment out some of the translate/rotate lines for >the round part then it renders, but the exact combination I have causes >the error. > >Can anyone see what the problem is? > >Many thanks, >Adam. > >----- > >$fn = 51; > >gap = 0.01; > >bezel_height = 4.1; >b_depth = 1 + 10.4 + 3.9; >profile = [ > [0, 0], > [1, 0], > [1, 2], > [4.2, bezel_height], > [10.4, 2], > [10.4, 0], > [b_depth, 0], > [b_depth, 14.2], > [0, 14.2], >]; > >dims = [240, 133]; > >// Left >rotate([0, 0, 90]) > translate([0, 0, -dims.y]) > linear_extrude(height = dims.y) > polygon(profile); > >// Bottom-left >translate([0, b_depth, -dims.y]) >rotate([0, 0, 180]) >rotate([0, 90, 0]) > rotate_extrude(angle = 90) > translate([b_depth, 0, 0]) > rotate([0, 180, 0]) > polygon(profile); >_______________________________________________ >OpenSCAD mailing list >To unsubscribe send an email to discuss-leave@lists.openscad.org
MM
Michael Marx (spintel)
Wed, Jul 15, 2026 3:19 AM

Also use the development snapshot*, it renders fine on the one I have installed.

-----Original Message-----
From: Adam Nielsen via Discuss [mailto:discuss@lists.openscad.org]
Sent: Wednesday, July 15, 2026 11:29 AM
To: discuss@lists.openscad.org
Cc: Adam Nielsen
Subject: [OpenSCAD] Preview works, but parts missing from render - "mesh is not closed"

Hi all,

Does anyone know why this code works fine in preview but won't render?
The straight part renders, but the round part at the bottom only
appears in preview mode and disappears when rendering.  It gives me the
error during rendering:

ERROR: The given mesh is not closed! Unable to convert to CGAL_Nef_Polyhedron.

The same polygon works if I rotate it at different angles, but this
particular orientation doesn't seem to work.

If I reduce $fn to 51 or below then it works, but above 51 the part
fails to render.  If I remove the straight part, then the round part
renders fine, but when the straight part is present the round part
won't render.  If I comment out some of the translate/rotate lines for
the round part then it renders, but the exact combination I have causes
the error.

Can anyone see what the problem is?

Many thanks,
Adam.


$fn = 51;

gap = 0.01;

bezel_height = 4.1;
b_depth = 1 + 10.4 + 3.9;
profile = [
[0, 0],
[1, 0],
[1, 2],
[4.2, bezel_height],
[10.4, 2],
[10.4, 0],
[b_depth, 0],
[b_depth, 14.2],
[0, 14.2],
];

dims = [240, 133];

// Left
rotate([0, 0, 90])
translate([0, 0, -dims.y])
linear_extrude(height = dims.y)
polygon(profile);

// Bottom-left
translate([0, b_depth, -dims.y])
rotate([0, 0, 180])
rotate([0, 90, 0])
rotate_extrude(angle = 90)
translate([b_depth, 0, 0])
rotate([0, 180, 0])
polygon(profile);


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

Also use the development snapshot*, it renders fine on the one I have installed. * https://openscad.org/downloads.html#snapshots > -----Original Message----- > From: Adam Nielsen via Discuss [mailto:discuss@lists.openscad.org] > Sent: Wednesday, July 15, 2026 11:29 AM > To: discuss@lists.openscad.org > Cc: Adam Nielsen > Subject: [OpenSCAD] Preview works, but parts missing from render - "mesh is not closed" > > Hi all, > > Does anyone know why this code works fine in preview but won't render? > The straight part renders, but the round part at the bottom only > appears in preview mode and disappears when rendering. It gives me the > error during rendering: > > ERROR: The given mesh is not closed! Unable to convert to CGAL_Nef_Polyhedron. > > The same polygon works if I rotate it at different angles, but this > particular orientation doesn't seem to work. > > If I reduce $fn to 51 or below then it works, but above 51 the part > fails to render. If I remove the straight part, then the round part > renders fine, but when the straight part is present the round part > won't render. If I comment out some of the translate/rotate lines for > the round part then it renders, but the exact combination I have causes > the error. > > Can anyone see what the problem is? > > Many thanks, > Adam. > > ----- > > $fn = 51; > > gap = 0.01; > > bezel_height = 4.1; > b_depth = 1 + 10.4 + 3.9; > profile = [ > [0, 0], > [1, 0], > [1, 2], > [4.2, bezel_height], > [10.4, 2], > [10.4, 0], > [b_depth, 0], > [b_depth, 14.2], > [0, 14.2], > ]; > > dims = [240, 133]; > > // Left > rotate([0, 0, 90]) > translate([0, 0, -dims.y]) > linear_extrude(height = dims.y) > polygon(profile); > > // Bottom-left > translate([0, b_depth, -dims.y]) > rotate([0, 0, 180]) > rotate([0, 90, 0]) > rotate_extrude(angle = 90) > translate([b_depth, 0, 0]) > rotate([0, 180, 0]) > polygon(profile); > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org
RW
Raymond West
Wed, Jul 15, 2026 9:14 AM

and works fine in my (older version)

OpenSCAD https://www.openscad.org/version 2024.12.03 (git fc3aa54a4)

On 15/07/2026 04:19, Michael Marx (spintel) via Discuss wrote:

Also use the development snapshot*, it renders fine on the one I have installed.
*https://openscad.org/downloads.html#snapshots

-----Original Message-----
From: Adam Nielsen via Discuss [mailto:discuss@lists.openscad.org]
Sent: Wednesday, July 15, 2026 11:29 AM
To:discuss@lists.openscad.org
Cc: Adam Nielsen
Subject: [OpenSCAD] Preview works, but parts missing from render - "mesh is not closed"

Hi all,

Does anyone know why this code works fine in preview but won't render?
The straight part renders, but the round part at the bottom only
appears in preview mode and disappears when rendering.  It gives me the
error during rendering:

ERROR: The given mesh is not closed! Unable to convert to CGAL_Nef_Polyhedron.

The same polygon works if I rotate it at different angles, but this
particular orientation doesn't seem to work.

If I reduce $fn to 51 or below then it works, but above 51 the part
fails to render.  If I remove the straight part, then the round part
renders fine, but when the straight part is present the round part
won't render.  If I comment out some of the translate/rotate lines for
the round part then it renders, but the exact combination I have causes
the error.

Can anyone see what the problem is?

Many thanks,
Adam.


$fn = 51;

gap = 0.01;

bezel_height = 4.1;
b_depth = 1 + 10.4 + 3.9;
profile = [
[0, 0],
[1, 0],
[1, 2],
[4.2, bezel_height],
[10.4, 2],
[10.4, 0],
[b_depth, 0],
[b_depth, 14.2],
[0, 14.2],
];

dims = [240, 133];

// Left
rotate([0, 0, 90])
translate([0, 0, -dims.y])
linear_extrude(height = dims.y)
polygon(profile);

// Bottom-left
translate([0, b_depth, -dims.y])
rotate([0, 0, 180])
rotate([0, 90, 0])
rotate_extrude(angle = 90)
translate([b_depth, 0, 0])
rotate([0, 180, 0])
polygon(profile);


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


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

and works fine in my (older version) OpenSCAD <https://www.openscad.org/>version 2024.12.03 (git fc3aa54a4) On 15/07/2026 04:19, Michael Marx (spintel) via Discuss wrote: > Also use the development snapshot*, it renders fine on the one I have installed. > *https://openscad.org/downloads.html#snapshots > >> -----Original Message----- >> From: Adam Nielsen via Discuss [mailto:discuss@lists.openscad.org] >> Sent: Wednesday, July 15, 2026 11:29 AM >> To:discuss@lists.openscad.org >> Cc: Adam Nielsen >> Subject: [OpenSCAD] Preview works, but parts missing from render - "mesh is not closed" >> >> Hi all, >> >> Does anyone know why this code works fine in preview but won't render? >> The straight part renders, but the round part at the bottom only >> appears in preview mode and disappears when rendering. It gives me the >> error during rendering: >> >> ERROR: The given mesh is not closed! Unable to convert to CGAL_Nef_Polyhedron. >> >> The same polygon works if I rotate it at different angles, but this >> particular orientation doesn't seem to work. >> >> If I reduce $fn to 51 or below then it works, but above 51 the part >> fails to render. If I remove the straight part, then the round part >> renders fine, but when the straight part is present the round part >> won't render. If I comment out some of the translate/rotate lines for >> the round part then it renders, but the exact combination I have causes >> the error. >> >> Can anyone see what the problem is? >> >> Many thanks, >> Adam. >> >> ----- >> >> $fn = 51; >> >> gap = 0.01; >> >> bezel_height = 4.1; >> b_depth = 1 + 10.4 + 3.9; >> profile = [ >> [0, 0], >> [1, 0], >> [1, 2], >> [4.2, bezel_height], >> [10.4, 2], >> [10.4, 0], >> [b_depth, 0], >> [b_depth, 14.2], >> [0, 14.2], >> ]; >> >> dims = [240, 133]; >> >> // Left >> rotate([0, 0, 90]) >> translate([0, 0, -dims.y]) >> linear_extrude(height = dims.y) >> polygon(profile); >> >> // Bottom-left >> translate([0, b_depth, -dims.y]) >> rotate([0, 0, 180]) >> rotate([0, 90, 0]) >> rotate_extrude(angle = 90) >> translate([b_depth, 0, 0]) >> rotate([0, 180, 0]) >> polygon(profile); >> _______________________________________________ >> OpenSCAD mailing list >> To unsubscribe send an email todiscuss-leave@lists.openscad.org > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email todiscuss-leave@lists.openscad.org