discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Different CGAL error when trying to manipulate imported stl file

RT
Richard Thomas
Fri, Jul 12, 2024 3:24 PM

Hi,

I get error "ERROR: The given mesh is not closed! Unable to convert to
CGAL_Nef_Polyhedron." at the render stage when using either of the scad
files shown further down in this email.
This happens even if I run it through
https://www.formware.co/onlinestlrepair

OpenSCAD version: 2021.01
OS: Windows 10
'Normal' stl file :
https://drive.google.com/file/d/1ifjqNpaKD4BoEhCJbF08Vpw2lHTa48WM/view?usp=drive_link
'Repaired' stl file :
https://drive.google.com/file/d/1HtTx3R_td5oH-A6fGRcz7PK-mCRDLI4F/view?usp=drive_link

If I take out the translate cube lines, it renders fine.

Any ideas please?

Thanks.

Richard.

depth_to_cut=25;
width_to_cut=40;
thickness_of_key=3;
distance_beyond_key=9;
depth_of_key=1.0;

difference(){

translate([-8.5,12,-10]) rotate([94,-11.5,0])

import("172079254104-OSC_fixed.stl", convexity=3);
#translate([-width_to_cut/2,thickness_of_key/2,-depth_to_cut/2])
cube([width_to_cut,width_to_cut,depth_to_cut]);

#rotate([0,0,180])

translate([-width_to_cut/2,thickness_of_key/2,-depth_to_cut/2])
cube([width_to_cut,width_to_cut,depth_to_cut]);

}

Hi, I get error "ERROR: The given mesh is not closed! Unable to convert to CGAL_Nef_Polyhedron." at the render stage when using either of the scad files shown further down in this email. This happens even if I run it through https://www.formware.co/onlinestlrepair OpenSCAD version: 2021.01 OS: Windows 10 'Normal' stl file : https://drive.google.com/file/d/1ifjqNpaKD4BoEhCJbF08Vpw2lHTa48WM/view?usp=drive_link 'Repaired' stl file : https://drive.google.com/file/d/1HtTx3R_td5oH-A6fGRcz7PK-mCRDLI4F/view?usp=drive_link If I take out the translate cube lines, it renders fine. Any ideas please? Thanks. Richard. depth_to_cut=25; width_to_cut=40; thickness_of_key=3; distance_beyond_key=9; depth_of_key=1.0; difference(){ translate([-8.5,12,-10]) rotate([94,-11.5,0]) import("172079254104-OSC_fixed.stl", convexity=3); #translate([-width_to_cut/2,thickness_of_key/2,-depth_to_cut/2]) cube([width_to_cut,width_to_cut,depth_to_cut]); #rotate([0,0,180]) translate([-width_to_cut/2,thickness_of_key/2,-depth_to_cut/2]) cube([width_to_cut,width_to_cut,depth_to_cut]); }
JB
Jordan Brown
Fri, Jul 12, 2024 3:57 PM

One piece of the puzzle is easy:  if there's only one object, the
imported STL, then most of the CGAL processing doesn't get done and so
any problems with the STL are not detected.  It's only when it's
necessary to do Boolean operations that the problems are detected. 
That's why it renders fine when you remove the cubes.

For example, here's a malformed cube.  (It's created with polyhedron()
rather than as an imported STL, but the issues are the same.)  The top
face is wound backwards.  (Use View/Thrown Together to see this.)

There are no complaints as long as it's the only object.  In fact, you
can remove one of the faces and there will still be no complaints.

But as soon as you add in the tiny cube(), CGAL hates it.

Note:  if you experiment with this sort of thing, Design/Flush Caches
before each render attempt.  There's something of a bug in that OpenSCAD
will cache subassemblies that had render errors, and so subsequent
render attempts will get the empty result but will not show an error
message.

points = [
    [0,0,0],
    [0,0,1],
    [0,1,0],
    [0,1,1],
    [1,0,0],
    [1,0,1],
    [1,1,0],
    [1,1,1],
];
faces = [
    [2,3,1,0],
    [2,6,7,3],
    [4,5,7,6],
    [4,6,2,0],
    [5,7,3,1],  // incorrect
//    [1,3,7,5],  // correct
    [1,5,4,0],
];

polyhedron(points=points, faces=faces);
cube(0.01);
One piece of the puzzle is easy:  if there's only one object, the imported STL, then most of the CGAL processing doesn't get done and so any problems with the STL are not detected.  It's only when it's necessary to do Boolean operations that the problems are detected.  That's why it renders fine when you remove the cubes. For example, here's a malformed cube.  (It's created with polyhedron() rather than as an imported STL, but the issues are the same.)  The top face is wound backwards.  (Use View/Thrown Together to see this.) There are no complaints as long as it's the only object.  In fact, you can remove one of the faces and there will still be no complaints. But as soon as you add in the tiny cube(), CGAL hates it. Note:  if you experiment with this sort of thing, Design/Flush Caches before each render attempt.  There's something of a bug in that OpenSCAD will cache subassemblies that had render errors, and so subsequent render attempts will get the empty result but will not show an error message. points = [ [0,0,0], [0,0,1], [0,1,0], [0,1,1], [1,0,0], [1,0,1], [1,1,0], [1,1,1], ]; faces = [ [2,3,1,0], [2,6,7,3], [4,5,7,6], [4,6,2,0], [5,7,3,1], // incorrect // [1,3,7,5], // correct [1,5,4,0], ]; polyhedron(points=points, faces=faces); cube(0.01);
JB
Jordan Brown
Fri, Jul 12, 2024 4:05 PM

I'm not an expert at diagnosing STLs, but this one isn't hard to find
problems with, using View/Thrown Together.

The un-fixed version has great gaping holes in the top and bottom, and
smaller problems elsewhere.  (Purple is bad.)

The "fixed" version is much better, but still has some - and all it
takes is one.  Here's a wide shot to establish context, and then a
zoom-in on the central pillar.  Note the tiny purple slices on the right.

I'm not an expert at diagnosing STLs, but this one isn't hard to find problems with, using View/Thrown Together. The un-fixed version has great gaping holes in the top and bottom, and smaller problems elsewhere.  (Purple is bad.) The "fixed" version is much better, but still has some - and all it takes is one.  Here's a wide shot to establish context, and then a zoom-in on the central pillar.  Note the tiny purple slices on the right.
RT
Richard Thomas
Fri, Jul 12, 2024 5:15 PM

Hi,

Wow, that is very hidden!  Where do I start in order to complete the
repairs on this?

Thanks,

Richard.

On Fri, 12 Jul 2024 at 17:05, Jordan Brown openscad@jordan.maileater.net
wrote:

I'm not an expert at diagnosing STLs, but this one isn't hard to find
problems with, using View/Thrown Together.

The un-fixed version has great gaping holes in the top and bottom, and
smaller problems elsewhere.  (Purple is bad.)

The "fixed" version is much better, but still has some - and all it takes
is one.  Here's a wide shot to establish context, and then a zoom-in on the
central pillar.  Note the tiny purple slices on the right.

Hi, Wow, that is very hidden! Where do I start in order to complete the repairs on this? Thanks, Richard. On Fri, 12 Jul 2024 at 17:05, Jordan Brown <openscad@jordan.maileater.net> wrote: > I'm not an expert at diagnosing STLs, but this one isn't hard to find > problems with, using View/Thrown Together. > > The un-fixed version has great gaping holes in the top and bottom, and > smaller problems elsewhere. (Purple is bad.) > > > > > The "fixed" version is much better, but still has some - and all it takes > is one. Here's a wide shot to establish context, and then a zoom-in on the > central pillar. Note the tiny purple slices on the right. > > > >
JB
Jordan Brown
Fri, Jul 12, 2024 11:46 PM

On 7/12/2024 10:15 AM, Richard Thomas wrote:

Wow, that is very hidden!  Where do I start in order to complete the
repairs on this?

Sorry, no idea.  See my previous note about how I'm not an expert on
diagnosing (and repairing) STLs.

Others might know what repair tools and services are available.

On 7/12/2024 10:15 AM, Richard Thomas wrote: > Wow, that is very hidden!  Where do I start in order to complete the > repairs on this? Sorry, no idea.  See my previous note about how I'm not an expert on diagnosing (and repairing) STLs. Others might know what repair tools and services are available.
MK
Marius Kintel
Sat, Jul 13, 2024 1:04 AM

On Jul 12, 2024, at 13:15, Richard Thomas via Discuss discuss@lists.openscad.org wrote:

Wow, that is very hidden!  Where do I start in order to complete the repairs on this?

I think your best bet would be to go back to the original source and try to figure out why it was wrong in the first place.

Alternatively, if you download the latest development snapshot of OpenSCAD from https://openscad.org/downloads.html, launch it, and enable “manifold” under Preferences->Features, that might be a bit more forgiving; we have some automated mesh repair tools built into that feature which may be able to reconstruct the intent of the geometry described in your STL.

-Marius

> On Jul 12, 2024, at 13:15, Richard Thomas via Discuss <discuss@lists.openscad.org> wrote: > > Wow, that is very hidden! Where do I start in order to complete the repairs on this? > I think your best bet would be to go back to the original source and try to figure out why it was wrong in the first place. Alternatively, if you download the latest development snapshot of OpenSCAD from https://openscad.org/downloads.html, launch it, and enable “manifold” under Preferences->Features, that might be a bit more forgiving; we have some automated mesh repair tools built into that feature which _may_ be able to reconstruct the intent of the geometry described in your STL. -Marius
MA
Martin Axelsen
Sat, Jul 13, 2024 2:11 AM

Netfabb basic was once the free tool of choice for things such as stl
repairs.

A backup from before Autodesk screwed up that part can be found here:

https://github.com/3DprintFIT/netfabb-basic-download/releases

On Sat, Jul 13, 2024, 03:04 Marius Kintel via Discuss <
discuss@lists.openscad.org> wrote:

On Jul 12, 2024, at 13:15, Richard Thomas via Discuss <
discuss@lists.openscad.org> wrote:

Wow, that is very hidden!  Where do I start in order to complete the
repairs on this?

I think your best bet would be to go back to the original source and try
to figure out why it was wrong in the first place.

Alternatively, if you download the latest development snapshot of OpenSCAD
from https://openscad.org/downloads.html, launch it, and enable
“manifold” under Preferences->Features, that might be a bit more forgiving;
we have some automated mesh repair tools built into that feature which
may be able to reconstruct the intent of the geometry described in your
STL.

-Marius


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

Netfabb basic was once the free tool of choice for things such as stl repairs. A backup from before Autodesk screwed up that part can be found here: https://github.com/3DprintFIT/netfabb-basic-download/releases On Sat, Jul 13, 2024, 03:04 Marius Kintel via Discuss < discuss@lists.openscad.org> wrote: > On Jul 12, 2024, at 13:15, Richard Thomas via Discuss < > discuss@lists.openscad.org> wrote: > > Wow, that is very hidden! Where do I start in order to complete the > repairs on this? > > I think your best bet would be to go back to the original source and try > to figure out why it was wrong in the first place. > > Alternatively, if you download the latest development snapshot of OpenSCAD > from https://openscad.org/downloads.html, launch it, and enable > “manifold” under Preferences->Features, that might be a bit more forgiving; > we have some automated mesh repair tools built into that feature which > _may_ be able to reconstruct the intent of the geometry described in your > STL. > > -Marius > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
RW
Raymond West
Sat, Jul 13, 2024 10:21 AM

This free online repair often works https://www.formware.co/onlinestlrepair

On 13/07/2024 03:11, Martin Axelsen via Discuss wrote:

Netfabb basic was once the free tool of choice for things such as stl
repairs.

A backup from before Autodesk screwed up that part can be found here:

https://github.com/3DprintFIT/netfabb-basic-download/releases

On Sat, Jul 13, 2024, 03:04 Marius Kintel via Discuss
discuss@lists.openscad.org wrote:

 On Jul 12, 2024, at 13:15, Richard Thomas via Discuss
 <discuss@lists.openscad.org> wrote:

 Wow, that is very hidden!  Where do I start in order to complete
 the repairs on this?
 I think your best bet would be to go back to the original source
 and try to figure out why it was wrong in the first place.

 Alternatively, if you download the latest development snapshot of
 OpenSCAD from https://openscad.org/downloads.html, launch it, and
 enable “manifold” under Preferences->Features, that might be a bit
 more forgiving; we have some automated mesh repair tools built
 into that feature which _may_ be able to reconstruct the intent of
 the geometry described in your STL.

  -Marius

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

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

This free online repair often works https://www.formware.co/onlinestlrepair On 13/07/2024 03:11, Martin Axelsen via Discuss wrote: > > Netfabb basic was once the free tool of choice for things such as stl > repairs. > > A backup from before Autodesk screwed up that part can be found here: > > https://github.com/3DprintFIT/netfabb-basic-download/releases > > > On Sat, Jul 13, 2024, 03:04 Marius Kintel via Discuss > <discuss@lists.openscad.org> wrote: > >> On Jul 12, 2024, at 13:15, Richard Thomas via Discuss >> <discuss@lists.openscad.org> wrote: >> >> Wow, that is very hidden!  Where do I start in order to complete >> the repairs on this? >> > I think your best bet would be to go back to the original source > and try to figure out why it was wrong in the first place. > > Alternatively, if you download the latest development snapshot of > OpenSCAD from https://openscad.org/downloads.html, launch it, and > enable “manifold” under Preferences->Features, that might be a bit > more forgiving; we have some automated mesh repair tools built > into that feature which _may_ be able to reconstruct the intent of > the geometry described in your STL. > >  -Marius > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org > > > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email todiscuss-leave@lists.openscad.org
JB
Jon Bondy
Sat, Jul 13, 2024 10:26 AM

Why would one offer free on-line STL repair except to collect STL files?

On 7/13/2024 6:21 AM, Raymond West via Discuss wrote:

This free online repair often works
https://www.formware.co/onlinestlrepair

On 13/07/2024 03:11, Martin Axelsen via Discuss wrote:

Netfabb basic was once the free tool of choice for things such as stl
repairs.

A backup from before Autodesk screwed up that part can be found here:

https://github.com/3DprintFIT/netfabb-basic-download/releases

On Sat, Jul 13, 2024, 03:04 Marius Kintel via Discuss
discuss@lists.openscad.org wrote:

 On Jul 12, 2024, at 13:15, Richard Thomas via Discuss
 <discuss@lists.openscad.org> wrote:

 Wow, that is very hidden!  Where do I start in order to complete
 the repairs on this?
 I think your best bet would be to go back to the original source
 and try to figure out why it was wrong in the first place.

 Alternatively, if you download the latest development snapshot of
 OpenSCAD from https://openscad.org/downloads.html, launch it, and
 enable “manifold” under Preferences->Features, that might be a
 bit more forgiving; we have some automated mesh repair tools
 built into that feature which _may_ be able to reconstruct the
 intent of the geometry described in your STL.

  -Marius

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

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

--
This email has been checked for viruses by AVG antivirus software.
www.avg.com

Why would one offer free on-line STL repair except to collect STL files? On 7/13/2024 6:21 AM, Raymond West via Discuss wrote: > > This free online repair often works > https://www.formware.co/onlinestlrepair > > On 13/07/2024 03:11, Martin Axelsen via Discuss wrote: >> >> Netfabb basic was once the free tool of choice for things such as stl >> repairs. >> >> A backup from before Autodesk screwed up that part can be found here: >> >> https://github.com/3DprintFIT/netfabb-basic-download/releases >> >> >> On Sat, Jul 13, 2024, 03:04 Marius Kintel via Discuss >> <discuss@lists.openscad.org> wrote: >> >>> On Jul 12, 2024, at 13:15, Richard Thomas via Discuss >>> <discuss@lists.openscad.org> wrote: >>> >>> Wow, that is very hidden!  Where do I start in order to complete >>> the repairs on this? >>> >> I think your best bet would be to go back to the original source >> and try to figure out why it was wrong in the first place. >> >> Alternatively, if you download the latest development snapshot of >> OpenSCAD from https://openscad.org/downloads.html, launch it, and >> enable “manifold” under Preferences->Features, that might be a >> bit more forgiving; we have some automated mesh repair tools >> built into that feature which _may_ be able to reconstruct the >> intent of the geometry described in your STL. >> >>  -Marius >> >> _______________________________________________ >> OpenSCAD mailing list >> To unsubscribe send an email to discuss-leave@lists.openscad.org >> >> >> _______________________________________________ >> 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 -- This email has been checked for viruses by AVG antivirus software. www.avg.com
MM
Michael Möller
Sat, Jul 13, 2024 12:38 PM

You get the ASCII version of the STL, identify the points and modify/add
the missing triangles :-)

Or get better (expensive) software. Or design the model from scratch in
OpenSCAD. Or hope it 3D prints even with the faults.

Why does "everyone" always expect there is an easy and free solution? ;-)

The model looks like this key model came from some 3D scanner, where the
topmost edge wasn't scanned sufficiently, or was something that moved (the
keyring?)

You can make your own model from scratch with OpenScad and then just
"overlay" the two (using the #-operator) to gradually get an accurate model
by trial-n-error.

On Fri, 12 Jul 2024 at 19:16, Richard Thomas via Discuss <
discuss@lists.openscad.org> wrote:

Hi,

Wow, that is very hidden!  Where do I start in order to complete the
repairs on this?

Thanks,

Richard.

On Fri, 12 Jul 2024 at 17:05, Jordan Brown openscad@jordan.maileater.net
wrote:

I'm not an expert at diagnosing STLs, but this one isn't hard to find
problems with, using View/Thrown Together.

The un-fixed version has great gaping holes in the top and bottom, and
smaller problems elsewhere.  (Purple is bad.)

The "fixed" version is much better, but still has some - and all it takes
is one.  Here's a wide shot to establish context, and then a zoom-in on the
central pillar.  Note the tiny purple slices on the right.


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

You get the ASCII version of the STL, identify the points and modify/add the missing triangles :-) Or get better (expensive) software. Or design the model from scratch in OpenSCAD. Or hope it 3D prints even with the faults. Why does "everyone" always expect there is an easy and free solution? ;-) The model looks like this key model came from some 3D scanner, where the topmost edge wasn't scanned sufficiently, or was something that moved (the keyring?) You can make your own model from scratch with OpenScad and then just "overlay" the two (using the #-operator) to gradually get an accurate model by trial-n-error. On Fri, 12 Jul 2024 at 19:16, Richard Thomas via Discuss < discuss@lists.openscad.org> wrote: > Hi, > > Wow, that is very hidden! Where do I start in order to complete the > repairs on this? > > Thanks, > > Richard. > > On Fri, 12 Jul 2024 at 17:05, Jordan Brown <openscad@jordan.maileater.net> > wrote: > >> I'm not an expert at diagnosing STLs, but this one isn't hard to find >> problems with, using View/Thrown Together. >> >> The un-fixed version has great gaping holes in the top and bottom, and >> smaller problems elsewhere. (Purple is bad.) >> >> >> >> >> The "fixed" version is much better, but still has some - and all it takes >> is one. Here's a wide shot to establish context, and then a zoom-in on the >> central pillar. Note the tiny purple slices on the right. >> >> >> >> _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >