discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Imported STL disappears at rendering

JT
jpm2nice-tech@yahoo.fr
Tue, Feb 20, 2024 10:58 AM

Hello, gentlemen,

As I need a nut on the part I am designing, I have imported an STL from the net.

The nut appears normally at first, but disappears when I trigger the rendering.

Could you tell me why and how I can solve that problem?

This is what I wrote:

import("bsw-1_4-nut-hex.stl",convexity=10);

Thanks a lot!

Hello, gentlemen, As I need a nut on the part I am designing, I have imported an STL from the net. The nut appears normally at first, but disappears when I trigger the rendering. Could you tell me why and how I can solve that problem? This is what I wrote: *import("bsw-1_4-nut-hex.stl",convexity=10);* Thanks a lot!
RW
Rogier Wolff
Tue, Feb 20, 2024 11:47 AM

On Tue, Feb 20, 2024 at 10:58:14AM +0000, jpm2nice-tech--- via Discuss wrote:

Hello, gentlemen,

As I need a nut on the part I am designing, I have imported an STL from the net.

The nut appears normally at first, but disappears when I trigger the rendering.

Could you tell me why and how I can solve that problem?

Openscad and the underlying libraries THINK there is a problem with
the underlying STL. Until recently I was convinced that was probably
correct. I have since then written an STL-parser-fixer to see what was
wrong with the STL I was working with and not much out of the ordinary
was found. A recommended program like meshlab was able to fix
thousands of issues and... no change. An online STL fixer was asked
to fix the STL and... no change.

In that discussion someone came along with an openscad generated STL
file which exhibited the same problem. So the problem is 100% in the
openscad ballpark. However I wasn't able to recreate the faulty STL in
openscad and so the problem remains "not reproducible" and "difficult
to fix" for the openscad developers. :-(

Part of the problem stems from the fact that openscad uses a
grid. This snaps vertices of the STL to the grid and THAT operation is
guaranteed to cause problems with imported STL files.

Roger. 

--
** R.E.Wolff@BitWizard.nl ** https://www.BitWizard.nl/ ** +31-15-2049110 **
**    Delftechpark 11 2628 XJ  Delft, The Netherlands.  KVK: 27239233    **
f equals m times a. When your f is steady, and your m is going down
your a is going up.  -- Chris Hadfield about flying up the space shuttle.

On Tue, Feb 20, 2024 at 10:58:14AM +0000, jpm2nice-tech--- via Discuss wrote: > Hello, gentlemen, > > As I need a nut on the part I am designing, I have imported an STL from the net. > > The nut appears normally at first, but disappears when I trigger the rendering. > > Could you tell me why and how I can solve that problem? Openscad and the underlying libraries THINK there is a problem with the underlying STL. Until recently I was convinced that was probably correct. I have since then written an STL-parser-fixer to see what was wrong with the STL I was working with and not much out of the ordinary was found. A recommended program like meshlab was able to fix thousands of issues and... no change. An online STL fixer was asked to fix the STL and... no change. In that discussion someone came along with an openscad generated STL file which exhibited the same problem. So the problem is 100% in the openscad ballpark. However I wasn't able to recreate the faulty STL in openscad and so the problem remains "not reproducible" and "difficult to fix" for the openscad developers. :-( Part of the problem stems from the fact that openscad uses a grid. This snaps vertices of the STL to the grid and THAT operation is guaranteed to cause problems with imported STL files. Roger. -- ** R.E.Wolff@BitWizard.nl ** https://www.BitWizard.nl/ ** +31-15-2049110 ** ** Delftechpark 11 2628 XJ Delft, The Netherlands. KVK: 27239233 ** f equals m times a. When your f is steady, and your m is going down your a is going up. -- Chris Hadfield about flying up the space shuttle.
RW
Rogier Wolff
Tue, Feb 20, 2024 12:19 PM

On Tue, Feb 20, 2024 at 12:47:54PM +0100, Rogier Wolff via Discuss wrote:

On Tue, Feb 20, 2024 at 10:58:14AM +0000, jpm2nice-tech--- via Discuss wrote:

Hello, gentlemen,

As I need a nut on the part I am designing, I have imported an STL from the net.

The nut appears normally at first, but disappears when I trigger the rendering.

Could you tell me why and how I can solve that problem?

Openscad and the underlying libraries THINK there is a problem with
the underlying STL. Until recently I was convinced that was probably
correct. I have since then written an STL-parser-fixer to see what was
wrong with the STL I was working with and not much out of the ordinary
was found. A recommended program like meshlab was able to fix
thousands of issues and... no change. An online STL fixer was asked
to fix the STL and... no change.

In my case I eventually found out that what I REALLY wanted to do was
to cut the object in half to be easily printable. Turns out that by
moving the object below the printbed I was able to achieve just that.

The disadvantage of doing it THAT way and not the way I wanted in
OpenScad has now become apparent. When I handed the printed object
over to my girlfriend as a present she admired it for a moment and
then dropped it. Broken! I have to reprint one of the halves. Now that
I have clicky-click rotated, scaled, translated it in the
slicer... the exact numbers have been lost. If I'd been able to do
this in openscad, then I would have been able to reload the broken
part, and reslice it (with different parameters to make it stronger
where it broke). (No need for tips on how to solve this: I'm currently
reprinting the existing gcode).

Roger.

--
** R.E.Wolff@BitWizard.nl ** https://www.BitWizard.nl/ ** +31-15-2049110 **
**    Delftechpark 11 2628 XJ  Delft, The Netherlands.  KVK: 27239233    **
f equals m times a. When your f is steady, and your m is going down
your a is going up.  -- Chris Hadfield about flying up the space shuttle.

On Tue, Feb 20, 2024 at 12:47:54PM +0100, Rogier Wolff via Discuss wrote: > On Tue, Feb 20, 2024 at 10:58:14AM +0000, jpm2nice-tech--- via Discuss wrote: > > Hello, gentlemen, > > > > As I need a nut on the part I am designing, I have imported an STL from the net. > > > > The nut appears normally at first, but disappears when I trigger the rendering. > > > > Could you tell me why and how I can solve that problem? > > Openscad and the underlying libraries THINK there is a problem with > the underlying STL. Until recently I was convinced that was probably > correct. I have since then written an STL-parser-fixer to see what was > wrong with the STL I was working with and not much out of the ordinary > was found. A recommended program like meshlab was able to fix > thousands of issues and... no change. An online STL fixer was asked > to fix the STL and... no change. In my case I eventually found out that what I REALLY wanted to do was to cut the object in half to be easily printable. Turns out that by moving the object below the printbed I was able to achieve just that. The disadvantage of doing it THAT way and not the way I wanted in OpenScad has now become apparent. When I handed the printed object over to my girlfriend as a present she admired it for a moment and then dropped it. Broken! I have to reprint one of the halves. Now that I have clicky-click rotated, scaled, translated it in the slicer... the exact numbers have been lost. If I'd been able to do this in openscad, then I would have been able to reload the broken part, and reslice it (with different parameters to make it stronger where it broke). (No need for tips on how to solve this: I'm currently reprinting the existing gcode). Roger. -- ** R.E.Wolff@BitWizard.nl ** https://www.BitWizard.nl/ ** +31-15-2049110 ** ** Delftechpark 11 2628 XJ Delft, The Netherlands. KVK: 27239233 ** f equals m times a. When your f is steady, and your m is going down your a is going up. -- Chris Hadfield about flying up the space shuttle.
CK
Chun Kit LAM
Tue, Feb 20, 2024 12:27 PM

What version are you using? The STL import issue is fixed a while ago:
https://github.com/openscad/openscad/pull/4855, as is available in
development snapshots after Dec. 2023. If you have something that
meshlab does not report any problem but still unable to import into
openscad using the latest development snapshot, feel free to open an
issue with your model to let us have a look at it.

On 20/2/2024 20:19, Rogier Wolff via Discuss wrote:

On Tue, Feb 20, 2024 at 12:47:54PM +0100, Rogier Wolff via Discuss wrote:

On Tue, Feb 20, 2024 at 10:58:14AM +0000, jpm2nice-tech--- via Discuss wrote:

Hello, gentlemen,

As I need a nut on the part I am designing, I have imported an STL from the net.

The nut appears normally at first, but disappears when I trigger the rendering.

Could you tell me why and how I can solve that problem?
Openscad and the underlying libraries THINK there is a problem with
the underlying STL. Until recently I was convinced that was probably
correct. I have since then written an STL-parser-fixer to see what was
wrong with the STL I was working with and not much out of the ordinary
was found. A recommended program like meshlab was able to fix
thousands of issues and... no change. An online STL fixer was asked
to fix the STL and... no change.
In my case I eventually found out that what I REALLY wanted to do was
to cut the object in half to be easily printable. Turns out that by
moving the object below the printbed I was able to achieve just that.

The disadvantage of doing it THAT way and not the way I wanted in
OpenScad has now become apparent. When I handed the printed object
over to my girlfriend as a present she admired it for a moment and
then dropped it. Broken! I have to reprint one of the halves. Now that
I have clicky-click rotated, scaled, translated it in the
slicer... the exact numbers have been lost. If I'd been able to do
this in openscad, then I would have been able to reload the broken
part, and reslice it (with different parameters to make it stronger
where it broke). (No need for tips on how to solve this: I'm currently
reprinting the existing gcode).

Roger.
What version are you using? The STL import issue is fixed a while ago: https://github.com/openscad/openscad/pull/4855, as is available in development snapshots after Dec. 2023. If you have something that meshlab does not report any problem but still unable to import into openscad using the latest development snapshot, feel free to open an issue with your model to let us have a look at it. On 20/2/2024 20:19, Rogier Wolff via Discuss wrote: > On Tue, Feb 20, 2024 at 12:47:54PM +0100, Rogier Wolff via Discuss wrote: >> On Tue, Feb 20, 2024 at 10:58:14AM +0000, jpm2nice-tech--- via Discuss wrote: >>> Hello, gentlemen, >>> >>> As I need a nut on the part I am designing, I have imported an STL from the net. >>> >>> The nut appears normally at first, but disappears when I trigger the rendering. >>> >>> Could you tell me why and how I can solve that problem? >> Openscad and the underlying libraries THINK there is a problem with >> the underlying STL. Until recently I was convinced that was probably >> correct. I have since then written an STL-parser-fixer to see what was >> wrong with the STL I was working with and not much out of the ordinary >> was found. A recommended program like meshlab was able to fix >> thousands of issues and... no change. An online STL fixer was asked >> to fix the STL and... no change. > In my case I eventually found out that what I REALLY wanted to do was > to cut the object in half to be easily printable. Turns out that by > moving the object below the printbed I was able to achieve just that. > > The disadvantage of doing it THAT way and not the way I wanted in > OpenScad has now become apparent. When I handed the printed object > over to my girlfriend as a present she admired it for a moment and > then dropped it. Broken! I have to reprint one of the halves. Now that > I have clicky-click rotated, scaled, translated it in the > slicer... the exact numbers have been lost. If I'd been able to do > this in openscad, then I would have been able to reload the broken > part, and reslice it (with different parameters to make it stronger > where it broke). (No need for tips on how to solve this: I'm currently > reprinting the existing gcode). > > Roger. >
GS
Guenther Sohler
Tue, Feb 20, 2024 12:29 PM

do you refer to the function:

std::unique_ptr<CGAL_Nef_polyhedron> createNefPolyhedronFromPolySet(const
PolySet& ps)
which prepares every Polyset for use with CGAL(similar exist for manifold)

it contains:

psq.quantizeVertices(&points3d);

Recently I learned that the purpose of this function is to prevent
coordinates from drifting around.
So my question is : would it be beneficial to have a limitted time user
option to disable that behaviour, to see if it improves that behaviour ?

On Tue, Feb 20, 2024 at 1:20 PM Rogier Wolff via Discuss <
discuss@lists.openscad.org> wrote:

On Tue, Feb 20, 2024 at 12:47:54PM +0100, Rogier Wolff via Discuss wrote:

On Tue, Feb 20, 2024 at 10:58:14AM +0000, jpm2nice-tech--- via Discuss

wrote:

Hello, gentlemen,

As I need a nut on the part I am designing, I have imported an STL

from the net.

The nut appears normally at first, but disappears when I trigger the

rendering.

Could you tell me why and how I can solve that problem?

Openscad and the underlying libraries THINK there is a problem with
the underlying STL. Until recently I was convinced that was probably
correct. I have since then written an STL-parser-fixer to see what was
wrong with the STL I was working with and not much out of the ordinary
was found. A recommended program like meshlab was able to fix
thousands of issues and... no change. An online STL fixer was asked
to fix the STL and... no change.

In my case I eventually found out that what I REALLY wanted to do was
to cut the object in half to be easily printable. Turns out that by
moving the object below the printbed I was able to achieve just that.

The disadvantage of doing it THAT way and not the way I wanted in
OpenScad has now become apparent. When I handed the printed object
over to my girlfriend as a present she admired it for a moment and
then dropped it. Broken! I have to reprint one of the halves. Now that
I have clicky-click rotated, scaled, translated it in the
slicer... the exact numbers have been lost. If I'd been able to do
this in openscad, then I would have been able to reload the broken
part, and reslice it (with different parameters to make it stronger
where it broke). (No need for tips on how to solve this: I'm currently
reprinting the existing gcode).

     Roger.

--
** R.E.Wolff@BitWizard.nl ** https://www.BitWizard.nl/ ** +31-15-2049110
**
**    Delftechpark 11 2628 XJ  Delft, The Netherlands.  KVK: 27239233    **
f equals m times a. When your f is steady, and your m is going down
your a is going up.  -- Chris Hadfield about flying up the space shuttle.


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

do you refer to the function: std::unique_ptr<CGAL_Nef_polyhedron> createNefPolyhedronFromPolySet(const PolySet& ps) which prepares every Polyset for use with CGAL(similar exist for manifold) it contains: psq.quantizeVertices(&points3d); Recently I learned that the purpose of this function is to prevent coordinates from drifting around. So my question is : would it be beneficial to have a limitted time user option to disable that behaviour, to see if it improves that behaviour ? On Tue, Feb 20, 2024 at 1:20 PM Rogier Wolff via Discuss < discuss@lists.openscad.org> wrote: > On Tue, Feb 20, 2024 at 12:47:54PM +0100, Rogier Wolff via Discuss wrote: > > On Tue, Feb 20, 2024 at 10:58:14AM +0000, jpm2nice-tech--- via Discuss > wrote: > > > Hello, gentlemen, > > > > > > As I need a nut on the part I am designing, I have imported an STL > from the net. > > > > > > The nut appears normally at first, but disappears when I trigger the > rendering. > > > > > > Could you tell me why and how I can solve that problem? > > > > Openscad and the underlying libraries THINK there is a problem with > > the underlying STL. Until recently I was convinced that was probably > > correct. I have since then written an STL-parser-fixer to see what was > > wrong with the STL I was working with and not much out of the ordinary > > was found. A recommended program like meshlab was able to fix > > thousands of issues and... no change. An online STL fixer was asked > > to fix the STL and... no change. > > In my case I eventually found out that what I REALLY wanted to do was > to cut the object in half to be easily printable. Turns out that by > moving the object below the printbed I was able to achieve just that. > > The disadvantage of doing it THAT way and not the way I wanted in > OpenScad has now become apparent. When I handed the printed object > over to my girlfriend as a present she admired it for a moment and > then dropped it. Broken! I have to reprint one of the halves. Now that > I have clicky-click rotated, scaled, translated it in the > slicer... the exact numbers have been lost. If I'd been able to do > this in openscad, then I would have been able to reload the broken > part, and reslice it (with different parameters to make it stronger > where it broke). (No need for tips on how to solve this: I'm currently > reprinting the existing gcode). > > Roger. > > -- > ** R.E.Wolff@BitWizard.nl ** https://www.BitWizard.nl/ ** +31-15-2049110 > ** > ** Delftechpark 11 2628 XJ Delft, The Netherlands. KVK: 27239233 ** > f equals m times a. When your f is steady, and your m is going down > your a is going up. -- Chris Hadfield about flying up the space shuttle. > _______________________________________________ > OpenSCAD mailing list > To unsubscribe send an email to discuss-leave@lists.openscad.org >
RW
Rogier Wolff
Tue, Feb 20, 2024 12:46 PM

On Tue, Feb 20, 2024 at 08:27:47PM +0800, Chun Kit LAM via Discuss wrote:

What version are you using? The STL import issue is fixed a while ago:
https://github.com/openscad/openscad/pull/4855, as is available in

Yeah. I'm using "old stuff".

I just tried compiling "master" and...
...
-- OpenCSG:
CMake Error at CMakeLists.txt:229 (if):
if given arguments:

"VERSION_LESS" "1.6.0"

Unknown arguments specified
...

OPENCSG_VERSION_STRING seems to be empty, and I don't see anywhere
where that would be defined. But I'm not good at reading cmakelist.txt
files. (and cmake pisses me off by trying to tell me something in an
unreadble color).

development snapshots after Dec. 2023. If you have something that meshlab
does not report any problem but still unable to import into openscad using
the latest development snapshot, feel free to open an issue with your model
to let us have a look at it.

You can download it here:

https://www.thingiverse.com/thing:6060750

My STL-parser found two zero-area triangles. Those are exactly inline
parallel to the Z axis. All edges are traversed exactly twice, once
in each direction.

Roger. 

--
** R.E.Wolff@BitWizard.nl ** https://www.BitWizard.nl/ ** +31-15-2049110 **
**    Delftechpark 11 2628 XJ  Delft, The Netherlands.  KVK: 27239233    **
f equals m times a. When your f is steady, and your m is going down
your a is going up.  -- Chris Hadfield about flying up the space shuttle.

On Tue, Feb 20, 2024 at 08:27:47PM +0800, Chun Kit LAM via Discuss wrote: > What version are you using? The STL import issue is fixed a while ago: > https://github.com/openscad/openscad/pull/4855, as is available in Yeah. I'm using "old stuff". I just tried compiling "master" and... ... -- OpenCSG: CMake Error at CMakeLists.txt:229 (if): if given arguments: "VERSION_LESS" "1.6.0" Unknown arguments specified ... OPENCSG_VERSION_STRING seems to be empty, and I don't see anywhere where that would be defined. But I'm not good at reading cmakelist.txt files. (and cmake pisses me off by trying to tell me something in an unreadble color). > development snapshots after Dec. 2023. If you have something that meshlab > does not report any problem but still unable to import into openscad using > the latest development snapshot, feel free to open an issue with your model > to let us have a look at it. You can download it here: https://www.thingiverse.com/thing:6060750 My STL-parser found two zero-area triangles. Those are exactly inline parallel to the Z axis. All edges are traversed exactly twice, once in each direction. Roger. -- ** R.E.Wolff@BitWizard.nl ** https://www.BitWizard.nl/ ** +31-15-2049110 ** ** Delftechpark 11 2628 XJ Delft, The Netherlands. KVK: 27239233 ** f equals m times a. When your f is steady, and your m is going down your a is going up. -- Chris Hadfield about flying up the space shuttle.
CK
Chun Kit LAM
Tue, Feb 20, 2024 12:52 PM

On 20/2/2024 20:46, Rogier Wolff wrote:

OPENCSG_VERSION_STRING seems to be empty, and I don't see anywhere
where that would be defined. But I'm not good at reading cmakelist.txt
files. (and cmake pisses me off by trying to tell me something in an
unreadble color).

You can try to set -DUSE_BUILTIN_OPENCSG=ON. It should fix the issue.
OPENCSG_VERSION_STRING is defined when OpenCSG is found by CMake, so
probably something went wrong and you can try to use the bundled one.

You can download it here:

https://www.thingiverse.com/thing:6060750

My STL-parser found two zero-area triangles. Those are exactly inline
parallel to the Z axis. All edges are traversed exactly twice, once
in each direction.

Just tried, it works well. Do note that you need to enable either
manifold or fastcsg.

Best,
John

On 20/2/2024 20:46, Rogier Wolff wrote: > OPENCSG_VERSION_STRING seems to be empty, and I don't see anywhere > where that would be defined. But I'm not good at reading cmakelist.txt > files. (and cmake pisses me off by trying to tell me something in an > unreadble color). You can try to set `-DUSE_BUILTIN_OPENCSG=ON`. It should fix the issue. OPENCSG_VERSION_STRING is defined when OpenCSG is found by CMake, so probably something went wrong and you can try to use the bundled one. > You can download it here: > > https://www.thingiverse.com/thing:6060750 > > My STL-parser found two zero-area triangles. Those are exactly inline > parallel to the Z axis. All edges are traversed exactly twice, once > in each direction. Just tried, it works well. Do note that you need to enable either manifold or fastcsg. Best, John