discuss@lists.openscad.org

OpenSCAD general discussion Mailing-list

View all threads

Can't find what's wrong here (use import stl and difference)

JJ
Johan Jonker
Tue, Nov 15, 2016 9:58 PM

engelvleugel_v9mid.stl
http://forum.openscad.org/file/n19123/engelvleugel_v9mid.stl
engelvleugel_v9.stl
http://forum.openscad.org/file/n19123/engelvleugel_v9.stl
I tried a lot a different ways to substract two objects. But not one of them
seems to work.
The meshes are OK in meshlab.
What is wrong then?
http://forum.openscad.org/file/n19123/Naamloos.jpg

This is the code:

--
View this message in context: http://forum.openscad.org/Can-t-find-what-s-wrong-here-use-import-stl-and-difference-tp19123.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

engelvleugel_v9mid.stl <http://forum.openscad.org/file/n19123/engelvleugel_v9mid.stl> engelvleugel_v9.stl <http://forum.openscad.org/file/n19123/engelvleugel_v9.stl> I tried a lot a different ways to substract two objects. But not one of them seems to work. The meshes are OK in meshlab. What is wrong then? <http://forum.openscad.org/file/n19123/Naamloos.jpg> This is the code: -- View this message in context: http://forum.openscad.org/Can-t-find-what-s-wrong-here-use-import-stl-and-difference-tp19123.html Sent from the OpenSCAD mailing list archive at Nabble.com.
P
Parkinbot
Tue, Nov 15, 2016 10:50 PM
<http://forum.openscad.org/file/n19125/Johan4.png> -- View this message in context: http://forum.openscad.org/Can-t-find-what-s-wrong-here-use-import-stl-and-difference-tp19123p19125.html Sent from the OpenSCAD mailing list archive at Nabble.com.
JJ
Johan Jonker
Wed, Nov 16, 2016 11:00 AM

Oh sorry. I could have seen that myself. Meshlab and Nettfab are not strict
enough.

I fixed it and that solves 50% of my problem

I make several parts of this thing with the sweep function. And each time
there are problems in combining them. So I did some test to find out the
cause.

Test 1: The object in its entirety

Output:

Test 2 The same object in two parts (overlapping 0.1mm)

Output:

Test 3: same as 2 but not overlapping

Output:

test 4: same as 3 but the second part is the beginning of another shape and
so another sweep

test 5: same as 4 but a larger part of the second sweep is added:

Code:

Output:

http://forum.openscad.org/file/n19140/Naamloos.jpg
http://forum.openscad.org/file/n19140/Naamloos2.jpg

Is the problem caused by the large amount of non-planar faces?

--
View this message in context: http://forum.openscad.org/Can-t-find-what-s-wrong-here-use-import-stl-and-difference-tp19123p19140.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

Oh sorry. I could have seen that myself. Meshlab and Nettfab are not strict enough. I fixed it and that solves 50% of my problem I make several parts of this thing with the sweep function. And each time there are problems in combining them. So I did some test to find out the cause. *Test 1:* The object in its entirety Output: *Test 2* The same object in two parts (overlapping 0.1mm) Output: Test 3: same as 2 but not overlapping Output: test 4: same as 3 but the second part is the beginning of another shape and so another sweep test 5: same as 4 but a larger part of the second sweep is added: Code: Output: <http://forum.openscad.org/file/n19140/Naamloos.jpg> <http://forum.openscad.org/file/n19140/Naamloos2.jpg> Is the problem caused by the large amount of non-planar faces? -- View this message in context: http://forum.openscad.org/Can-t-find-what-s-wrong-here-use-import-stl-and-difference-tp19123p19140.html Sent from the OpenSCAD mailing list archive at Nabble.com.
JJ
Johan Jonker
Wed, Nov 16, 2016 11:04 AM

Is there a possibility to force sweep to make triangles?

--
View this message in context: http://forum.openscad.org/Can-t-find-what-s-wrong-here-use-import-stl-and-difference-tp19123p19141.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

Is there a possibility to force sweep to make triangles? -- View this message in context: http://forum.openscad.org/Can-t-find-what-s-wrong-here-use-import-stl-and-difference-tp19123p19141.html Sent from the OpenSCAD mailing list archive at Nabble.com.
P
Parkinbot
Wed, Nov 16, 2016 1:38 PM

You can go into sweep, but poking around in its knitting routine is not very
delightful. (I can say that, because I just went into it yesterday to allow
also for designs that need closing like toric stuff.)

Anyway, I doubt that it is the knitting. In 99% the cause of purple
triangles is self-intersection or non-simple polygons. So better have a look
at your polygons and the extrusion path they describe (i.e. how you
transform them from 2D to 3D).
For the rest: There is some possiblity that vertices get somehow too close
and the export/import via STL runs into numerical problems. We have seen
this kind of faults being discussed here many times. In this case, you could
try to scale your design up before export and down after import. But first
try, whether the difference works without an STL involved at all.

--
View this message in context: http://forum.openscad.org/Can-t-find-what-s-wrong-here-use-import-stl-and-difference-tp19123p19144.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

You can go into sweep, but poking around in its knitting routine is not very delightful. (I can say that, because I just went into it yesterday to allow also for designs that need closing like toric stuff.) Anyway, I doubt that it is the knitting. In 99% the cause of purple triangles is self-intersection or non-simple polygons. So better have a look at your polygons and the extrusion path they describe (i.e. how you transform them from 2D to 3D). For the rest: There is some possiblity that vertices get somehow too close and the export/import via STL runs into numerical problems. We have seen this kind of faults being discussed here many times. In this case, you could try to scale your design up before export and down after import. But first try, whether the difference works without an STL involved at all. -- View this message in context: http://forum.openscad.org/Can-t-find-what-s-wrong-here-use-import-stl-and-difference-tp19123p19144.html Sent from the OpenSCAD mailing list archive at Nabble.com.
RP
Ronaldo Persiano
Wed, Nov 16, 2016 2:17 PM

2016-11-16 11:38 GMT-02:00 Parkinbot rudolf@parkinbot.com:

You can go into sweep, but poking around in its knitting routine is not
very
delightful. (I can say that, because I just went into it yesterday to allow
also for designs that need closing like toric stuff.)

Rudolf,

CGAL works with very strict testings. But it collapses vertices that are
equal or very very near. So, for things like a torus, I define the form as
a bi-dimensional matrix of points where the first column equals the last
one and the first line equal the last one. To define the vertex list of the
polyhedron I just flatten the matrix. This vertex list will have
repetitions. The face definitions ignores all that and just scan the quads.
So, a border quad in the extreme left of the matrix will refer to vertex
indices different from the extreme right quad of the same line but some of
those indexed vertices will have the same coordinates. This way, the vertex
definitions and the knitting of faces is much more simple even in more
complex cases.

Johan,

I have a simple polygon check function for planar polygons. If you need I
can provide the code.

2016-11-16 11:38 GMT-02:00 Parkinbot <rudolf@parkinbot.com>: > You can go into sweep, but poking around in its knitting routine is not > very > delightful. (I can say that, because I just went into it yesterday to allow > also for designs that need closing like toric stuff.) > Rudolf, CGAL works with very strict testings. But it collapses vertices that are equal or very very near. So, for things like a torus, I define the form as a bi-dimensional matrix of points where the first column equals the last one and the first line equal the last one. To define the vertex list of the polyhedron I just flatten the matrix. This vertex list will have repetitions. The face definitions ignores all that and just scan the quads. So, a border quad in the extreme left of the matrix will refer to vertex indices different from the extreme right quad of the same line but some of those indexed vertices will have the same coordinates. This way, the vertex definitions and the knitting of faces is much more simple even in more complex cases. Johan, I have a simple polygon check function for planar polygons. If you need I can provide the code.
JJ
Johan Jonker
Wed, Nov 16, 2016 3:17 PM

@parkinbot

I can imagine that going into sweep is not easy

I have an object without purple triangels. See the last wireframe I put in
the message.
Of this part I am quite sure that it has non planar faces. I think all the
quads in the curved sides are non planar.
I am also quite sure that the vertices are not very close.
The distance between the layers is .2 mm.
The curved corner makes has a radius of 1.25 mm and steps of 5 degrees.
But I can try to scale the design by a factor 100 and see what happens.

@ronaldo

The function to check for non planar polygons is interesting to use, but the
question is what to do when the object has non planar polygons. I have one
now. Is there a way to prevent them?

--
View this message in context: http://forum.openscad.org/Can-t-find-what-s-wrong-here-use-import-stl-and-difference-tp19123p19148.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

@parkinbot I can imagine that going into sweep is not easy I have an object without purple triangels. See the last wireframe I put in the message. Of this part I am quite sure that it has non planar faces. I think all the quads in the curved sides are non planar. I am also quite sure that the vertices are not very close. The distance between the layers is .2 mm. The curved corner makes has a radius of 1.25 mm and steps of 5 degrees. But I can try to scale the design by a factor 100 and see what happens. @ronaldo The function to check for non planar polygons is interesting to use, but the question is what to do when the object has non planar polygons. I have one now. Is there a way to prevent them? -- View this message in context: http://forum.openscad.org/Can-t-find-what-s-wrong-here-use-import-stl-and-difference-tp19123p19148.html Sent from the OpenSCAD mailing list archive at Nabble.com.
RP
Ronaldo Persiano
Wed, Nov 16, 2016 3:48 PM

My library contains functions to project non-planar polygons in a fitting
plane, check if they are simple polygons and triangulate them if you need.

2016-11-16 13:17 GMT-02:00 Johan Jonker johangjonker@zonnet.nl:

@ronaldo

The function to check for non planar polygons is interesting to use, but
the
question is what to do when the object has non planar polygons. I have one
now. Is there a way to prevent them?

My library contains functions to project non-planar polygons in a fitting plane, check if they are simple polygons and triangulate them if you need. 2016-11-16 13:17 GMT-02:00 Johan Jonker <johangjonker@zonnet.nl>: > > @ronaldo > > The function to check for non planar polygons is interesting to use, but > the > question is what to do when the object has non planar polygons. I have one > now. Is there a way to prevent them? > >
RP
Ronaldo Persiano
Wed, Nov 16, 2016 3:53 PM

If your polygons are not "too much non-planar", sweep should work fine.
Problems arise if the polygon are not simple.

If your polygons are not "too much non-planar", sweep should work fine. Problems arise if the polygon are not simple.
JJ
Johan Jonker
Wed, Nov 16, 2016 4:09 PM

I am very interested to try that!

--
View this message in context: http://forum.openscad.org/Can-t-find-what-s-wrong-here-use-import-stl-and-difference-tp19123p19152.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

I am very interested to try that! -- View this message in context: http://forum.openscad.org/Can-t-find-what-s-wrong-here-use-import-stl-and-difference-tp19123p19152.html Sent from the OpenSCAD mailing list archive at Nabble.com.