TR
Thomas Richter
Sun, Jan 12, 2025 11:36 PM
I had another idea and finally found it. It was indeed a problem with the polyhedron, a very rare edge case where two vertices of the same layer are very close and the number of vertices decreases in the next layer and the next vertex in the same layer is quite far away from the two other ones. I could only find it by analysing the generated faces with another script.
Thanks again for your help.
Am 12.01.2025 um 22:56 schrieb Thomas Richter tomselektropost@googlemail.com:
I give up. That's not a problem for my project since I don't need the boolean operation with the latest solution. I was just interested in the cause of the glitch.
There is absolutely no evidence that the polyhedron is invalid after fixing the face orientation issue you found. I have checked with meshlab, with a script I implemented by myself, as well as different slicers. Neither show any errors in the meshes that I can export from OpenSCAD nor in the object structures output with echo. The polyhedra are always created the same way in my code, no matter what model parameters I use. Thus it is very likely that the structure of the few polyhedra that cannot be rendered is also correct. Based on the tests with my own scripts it is.
I can create multiple polyhedra in the same scene. All points are unique by design but nonetheless, I have even checked that and found nothing.
The latest possibility I saw was in the (quite surprisingly unpredictable) way the polyhedron function handles faces with a large number of vertices that are not within one and the same plane. After replacing those with self-generated triangles, I have no further idea.
I never compare floating point values without considering possible precision issues.
The problem appears only for very few combinations of model parameters. My software engineering experience gives me a strong feeling towards floating point issues but I have no idea where they should come from.
Thank you all for your help.
Am 12.01.2025 um 20:29 schrieb Adrian Mariano via Discuss discuss@lists.openscad.org:
A polyhedron by itself never produces an error, even if it is invalid. If it fails when you union with a cube then that means your polyhedron is somehow invalid.
On Sun, Jan 12, 2025 at 1:49 PM Thomas Richter via Discuss discuss@lists.openscad.org wrote:
Thank you for this insight. I misunderstood the manual and oriented the side faces counterclockwise instead of clockwise. After fixing this the purple is all gone, the problem persists with boolean operations, goes away without boolean operations.
The render() was there because the misoriented side faces made the body appearing transparent. Unfortunately this didn't lead to any insight on my side :-(
I checked with a script that all points - copied from output with echo - are unique.
I have uploaded the version with the fixed faces:
https://github.com/trses/screw-nut-knobs/blob/boolean-glitch/analytical-solution.scad
I flushed the caches before every experiment and made the following observations when trying to render (not preview), see lines 167 - 179:
- difference with the polyhedron and a hollow sphere: problem persists
- union with the polyhedron and a cube someplace else: problem persists
- commenting out the difference / union rendering just the polyhedron: problem goes away.
What does this mean?
Am 12.01.2025 um 17:41 schrieb Adrian Mariano via Discuss discuss@lists.openscad.org:
He did post (a link to) the full code.
Actually I got fooled when I viewed the shape with "thrown together". He explicitly calls render() in his code, which bypasses the thrown-together process. I actually figured this out because the BOSL2 polyhedron validator produced a long list of errors like this:
ECHO: "ERROR REVERSAL (violet): Faces Reverse Across Edge at [[0.0319137, -16.3794, 18.4927], [-0.932485, -16.0686, 18.6187]] indices: [3217, 3216]"
ECHO: "ERROR REVERSAL (violet): Faces Reverse Across Edge at [[0.949081, -16.81, 18.2839], [0.0319137, -16.3794, 18.4927]] indices: [3218, 3217]"
ECHO: "ERROR REVERSAL (violet): Faces Reverse Across Edge at [[1.80419, -17.3535, 17.9945], [0.949081, -16.81, 18.2839]] indices: [3219, 3218]"
ECHO: "ERROR REVERSAL (violet): Faces Reverse Across Edge at [[2.1411, -17.6335, 17.8396], [1.80419, -17.3535, 17.9945]] indices: [3220, 3219]"
ECHO: "ERROR REVERSAL (violet): Faces Reverse Across Edge at [[2.4012, -17.281, 17.9945], [2.1411, -17.6335, 17.8396]] indices: [3221, 3220]"
ECHO: "ERROR REVERSAL (violet): Faces Reverse Across Edge at [[3.10139, -16.5486, 18.2839], [2.4012, -17.281, 17.9945]] indices: [3222, 3221]"
I am not sure why that render() call is there. It doesn't seem to do anything other than preventing the user from using preview and hiding errors. With render() removed, and thrown together enabled, the face reversal is obvious as seen below. So the conclusion is: the polyhedron has reversed faces, hence it is invalid.
<image.png>
On Sun, Jan 12, 2025 at 11:10 AM Raymond West via Discuss discuss@lists.openscad.org wrote:
It would help if you posted an image of what you're trying to create,
and possibly some code. I can't help if you are trying to use bos2l or
you refer to github/elsewhere.
I find in f5 render, a lot of my stuff breaks up. However, in manifold
rendering f6, generally works. You can check, as Jordan hinted, by
including a cube when you f6, do it as the object is evolved. If you get
just a cube, then you know where you've screwed up.
On 12/01/2025 08:08, Thomas Richter via Discuss wrote:
I create concave polyhedra of several thousand faces. For details about the purpose see https://lists.openscad.org/empathy/thread/LY26O7U4CLHPW3BGQIDLSAE6FRVVHEUG
My question is not about building the shape, that's solved, but about a strange error I experience with certain input values. An example causing the error can be found on Github:
https://github.com/trses/screw-nut-knobs/blob/boolean-glitch/analytical-solution.scad
When I render the shape I get this error:
WARNING: PolySet -> Manifold conversion failed: NotManifold
Trying to repair and reconstruct mesh..
ERROR: [manifold] Input mesh is not closed!
ERROR: [manifold] Surface_mesh -> Manifold conversion failed: NotManifold
This happens in very rare situations (e. g.: ARMS = 13, 1.97 <= _armPitch <= 2.17, _q = 182, _q = 208 and ARMS = 17, 1.93 <= _armPitch <= 2.18, _q = 204). Since the values are similar I believe there is a geometrical reason but I have no idea how I could debug this and figure out the actual cause.
If you comment out line 163 (subtract hollow sphere) it doesn't happen (though the shape will look strange then). The polyhedron itself is built correctly, I have checked it several times by hand.
My platform is an Apple Silicon M3 CPU.
I would like to know if others experience the same behavior (on other platforms) with the example provided and if so, what is the cause or at least what could I do to debug it. My impression is that it happens when the shape to subtract from is complex and very tiny faces are generated. Unfortunately, the error message is not very helpful.
Is this an already known glitch?
Second question related to this: In case this is a shortcoming of the rendering engine: Is there any chance to catch this error by means of the source code and handle it by, e. g., adjusting the _armPitch value?
If this question is assumed to be spam, please let me know how I should have brought this problem up. I have already asked the question in one of the last messages of the other thread but it seems that it got lost there.
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
I had another idea and finally found it. It was indeed a problem with the polyhedron, a very rare edge case where two vertices of the same layer are very close and the number of vertices decreases in the next layer and the next vertex in the same layer is quite far away from the two other ones. I could only find it by analysing the generated faces with another script.
Thanks again for your help.
> Am 12.01.2025 um 22:56 schrieb Thomas Richter <tomselektropost@googlemail.com>:
>
> I give up. That's not a problem for my project since I don't need the boolean operation with the latest solution. I was just interested in the cause of the glitch.
>
> There is absolutely no evidence that the polyhedron is invalid after fixing the face orientation issue you found. I have checked with meshlab, with a script I implemented by myself, as well as different slicers. Neither show any errors in the meshes that I can export from OpenSCAD nor in the object structures output with echo. The polyhedra are always created the same way in my code, no matter what model parameters I use. Thus it is very likely that the structure of the few polyhedra that cannot be rendered is also correct. Based on the tests with my own scripts it is.
>
> I can create multiple polyhedra in the same scene. All points are unique by design but nonetheless, I have even checked that and found nothing.
>
> The latest possibility I saw was in the (quite surprisingly unpredictable) way the polyhedron function handles faces with a large number of vertices that are not within one and the same plane. After replacing those with self-generated triangles, I have no further idea.
>
> I never compare floating point values without considering possible precision issues.
>
> The problem appears only for very few combinations of model parameters. My software engineering experience gives me a strong feeling towards floating point issues but I have no idea where they should come from.
>
> Thank you all for your help.
>
>
>> Am 12.01.2025 um 20:29 schrieb Adrian Mariano via Discuss <discuss@lists.openscad.org>:
>>
>> A polyhedron by itself never produces an error, even if it is invalid. If it fails when you union with a cube then that means your polyhedron is somehow invalid.
>>
>> On Sun, Jan 12, 2025 at 1:49 PM Thomas Richter via Discuss <discuss@lists.openscad.org> wrote:
>> Thank you for this insight. I misunderstood the manual and oriented the side faces counterclockwise instead of clockwise. After fixing this the purple is all gone, the problem persists with boolean operations, goes away without boolean operations.
>>
>> The render() was there because the misoriented side faces made the body appearing transparent. Unfortunately this didn't lead to any insight on my side :-(
>>
>> I checked with a script that all points - copied from output with echo - are unique.
>>
>> I have uploaded the version with the fixed faces:
>>
>> https://github.com/trses/screw-nut-knobs/blob/boolean-glitch/analytical-solution.scad
>>
>> I flushed the caches before every experiment and made the following observations when trying to render (not preview), see lines 167 - 179:
>>
>> - difference with the polyhedron and a hollow sphere: problem persists
>> - union with the polyhedron and a cube someplace else: problem persists
>> - commenting out the difference / union rendering just the polyhedron: problem goes away.
>>
>> What does this mean?
>>
>>
>>> Am 12.01.2025 um 17:41 schrieb Adrian Mariano via Discuss <discuss@lists.openscad.org>:
>>>
>>> He did post (a link to) the full code.
>>>
>>> Actually I got fooled when I viewed the shape with "thrown together". He explicitly calls render() in his code, which bypasses the thrown-together process. I actually figured this out because the BOSL2 polyhedron validator produced a long list of errors like this:
>>>
>>> ECHO: "ERROR REVERSAL (violet): Faces Reverse Across Edge at [[0.0319137, -16.3794, 18.4927], [-0.932485, -16.0686, 18.6187]] indices: [3217, 3216]"
>>> ECHO: "ERROR REVERSAL (violet): Faces Reverse Across Edge at [[0.949081, -16.81, 18.2839], [0.0319137, -16.3794, 18.4927]] indices: [3218, 3217]"
>>> ECHO: "ERROR REVERSAL (violet): Faces Reverse Across Edge at [[1.80419, -17.3535, 17.9945], [0.949081, -16.81, 18.2839]] indices: [3219, 3218]"
>>> ECHO: "ERROR REVERSAL (violet): Faces Reverse Across Edge at [[2.1411, -17.6335, 17.8396], [1.80419, -17.3535, 17.9945]] indices: [3220, 3219]"
>>> ECHO: "ERROR REVERSAL (violet): Faces Reverse Across Edge at [[2.4012, -17.281, 17.9945], [2.1411, -17.6335, 17.8396]] indices: [3221, 3220]"
>>> ECHO: "ERROR REVERSAL (violet): Faces Reverse Across Edge at [[3.10139, -16.5486, 18.2839], [2.4012, -17.281, 17.9945]] indices: [3222, 3221]"
>>>
>>> I am not sure why that render() call is there. It doesn't seem to do anything other than preventing the user from using preview and hiding errors. With render() removed, and thrown together enabled, the face reversal is obvious as seen below. So the conclusion is: the polyhedron has reversed faces, hence it is invalid.
>>>
>>>
>>> <image.png>
>>>
>>>
>>>
>>>
>>>
>>> On Sun, Jan 12, 2025 at 11:10 AM Raymond West via Discuss <discuss@lists.openscad.org> wrote:
>>> It would help if you posted an image of what you're trying to create,
>>> and possibly some code. I can't help if you are trying to use bos2l or
>>> you refer to github/elsewhere.
>>>
>>> I find in f5 render, a lot of my stuff breaks up. However, in manifold
>>> rendering f6, generally works. You can check, as Jordan hinted, by
>>> including a cube when you f6, do it as the object is evolved. If you get
>>> just a cube, then you know where you've screwed up.
>>>
>>> On 12/01/2025 08:08, Thomas Richter via Discuss wrote:
>>>> I create concave polyhedra of several thousand faces. For details about the purpose see https://lists.openscad.org/empathy/thread/LY26O7U4CLHPW3BGQIDLSAE6FRVVHEUG
>>>>
>>>> My question is not about building the shape, that's solved, but about a strange error I experience with certain input values. An example causing the error can be found on Github:
>>>>
>>>> https://github.com/trses/screw-nut-knobs/blob/boolean-glitch/analytical-solution.scad
>>>>
>>>> When I render the shape I get this error:
>>>>
>>>> WARNING: PolySet -> Manifold conversion failed: NotManifold
>>>> Trying to repair and reconstruct mesh..
>>>> ERROR: [manifold] Input mesh is not closed!
>>>> ERROR: [manifold] Surface_mesh -> Manifold conversion failed: NotManifold
>>>>
>>>> This happens in very rare situations (e. g.: ARMS = 13, 1.97 <= _armPitch <= 2.17, _q = 182, _q = 208 and ARMS = 17, 1.93 <= _armPitch <= 2.18, _q = 204). Since the values are similar I believe there is a geometrical reason but I have no idea how I could debug this and figure out the actual cause.
>>>>
>>>> If you comment out line 163 (subtract hollow sphere) it doesn't happen (though the shape will look strange then). The polyhedron itself is built correctly, I have checked it several times by hand.
>>>>
>>>> My platform is an Apple Silicon M3 CPU.
>>>>
>>>> I would like to know if others experience the same behavior (on other platforms) with the example provided and if so, what is the cause or at least what could I do to debug it. My impression is that it happens when the shape to subtract from is complex and very tiny faces are generated. Unfortunately, the error message is not very helpful.
>>>>
>>>> Is this an already known glitch?
>>>>
>>>> Second question related to this: In case this is a shortcoming of the rendering engine: Is there any chance to catch this error by means of the source code and handle it by, e. g., adjusting the _armPitch value?
>>>>
>>>> If this question is assumed to be spam, please let me know how I should have brought this problem up. I have already asked the question in one of the last messages of the other thread but it seems that it got lost there.
>>>> _______________________________________________
>>>> 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
>>> _______________________________________________
>>> 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
>> _______________________________________________
>> OpenSCAD mailing list
>> To unsubscribe send an email to discuss-leave@lists.openscad.org
>
AM
Adrian Mariano
Sun, Jan 12, 2025 11:44 PM
I was going to say I kicked off another run of vnf_validate() to check your
polyhedron and got messages like this below (so edges that don't have a
mate). This validation runs in OpenSCAD, though it's slow. It took 28
minutes on your polyhedron. But it sounds like you have solved the
problem, which is great.
ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[2.19157, -18.0656,
7.62068], [2.19371, -18.0668, 7.61989]] indices: [2824, 2825]"
ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[2.19371, -18.0668,
7.61989], [2.19549, -18.0651, 7.62068]] indices: [2825, 2826]"
ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[2.19371, -18.0668,
7.61989], [2.63126, -17.4745, 7.88479]] indices: [2825, 2827]"
ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[2.19549, -18.0651,
7.62068], [2.63126, -17.4745, 7.88479]] indices: [2826, 2827]"
ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[9.61822, -14.8247,
7.88479], [10.336, -14.9778, 7.62068]] indices: [2835, 2836]"
ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[9.61822, -14.8247,
7.88479], [10.3385, -14.9779, 7.61989]] indices: [2835, 2837]"
ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[10.336, -14.9778,
7.62068], [10.3385, -14.9779, 7.61989]] indices: [2836, 2837]"
ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[10.3385, -14.9779,
7.61989], [10.3393, -14.9755, 7.62068]] indices: [2837, 2838]"
ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[10.3385, -14.9779,
7.61989], [10.4507, -14.2501, 7.88479]] indices: [2837, 2839]"
ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[10.3393, -14.9755,
7.62068], [10.4507, -14.2501, 7.88479]] indices: [2838, 2839]"
ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[15.4059, -8.65681,
7.88479], [16.1126, -8.45879, 7.62068]] indices: [2847, 2848]"
ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[15.4059, -8.65681,
7.88479], [16.1149, -8.45775, 7.61989]] indices: [2847, 2849]"
ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[16.1126, -8.45879,
7.62068], [16.1149, -8.45775, 7.61989]] indices: [2848, 2849]"
ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[16.1149, -8.45775,
7.61989], [16.1145, -8.45529, 7.62068]] indices: [2849, 2850]"
ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[16.1149, -8.45775,
7.61989], [15.876, -7.76117, 7.88479]] indices: [2849, 2851]"
ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[16.1145, -8.45529,
7.62068], [15.876, -7.76117, 7.88479]] indices: [2850, 2851]"
On Sun, Jan 12, 2025 at 6:38 PM Thomas Richter via Discuss <
discuss@lists.openscad.org> wrote:
I had another idea and finally found it. It was indeed a problem with the
polyhedron, a very rare edge case where two vertices of the same layer are
very close and the number of vertices decreases in the next layer and the
next vertex in the same layer is quite far away from the two other ones. I
could only find it by analysing the generated faces with another script.
Thanks again for your help.
Am 12.01.2025 um 22:56 schrieb Thomas Richter <
I give up. That's not a problem for my project since I don't need the
boolean operation with the latest solution. I was just interested in the
cause of the glitch.
There is absolutely no evidence that the polyhedron is invalid after
fixing the face orientation issue you found. I have checked with meshlab,
with a script I implemented by myself, as well as different slicers.
Neither show any errors in the meshes that I can export from OpenSCAD nor
in the object structures output with echo. The polyhedra are always created
the same way in my code, no matter what model parameters I use. Thus it is
very likely that the structure of the few polyhedra that cannot be rendered
is also correct. Based on the tests with my own scripts it is.
I can create multiple polyhedra in the same scene. All points are unique
by design but nonetheless, I have even checked that and found nothing.
The latest possibility I saw was in the (quite surprisingly
unpredictable) way the polyhedron function handles faces with a large
number of vertices that are not within one and the same plane. After
replacing those with self-generated triangles, I have no further idea.
I never compare floating point values without considering possible
The problem appears only for very few combinations of model parameters.
My software engineering experience gives me a strong feeling towards
floating point issues but I have no idea where they should come from.
Thank you all for your help.
Am 12.01.2025 um 20:29 schrieb Adrian Mariano via Discuss <
A polyhedron by itself never produces an error, even if it is invalid.
If it fails when you union with a cube then that means your polyhedron is
somehow invalid.
On Sun, Jan 12, 2025 at 1:49 PM Thomas Richter via Discuss <
Thank you for this insight. I misunderstood the manual and oriented the
side faces counterclockwise instead of clockwise. After fixing this the
purple is all gone, the problem persists with boolean operations, goes away
without boolean operations.
The render() was there because the misoriented side faces made the body
appearing transparent. Unfortunately this didn't lead to any insight on my
side :-(
I checked with a script that all points - copied from output with echo
I have uploaded the version with the fixed faces:
I flushed the caches before every experiment and made the following
observations when trying to render (not preview), see lines 167 - 179:
- difference with the polyhedron and a hollow sphere: problem persists
- union with the polyhedron and a cube someplace else: problem persists
- commenting out the difference / union rendering just the polyhedron:
Am 12.01.2025 um 17:41 schrieb Adrian Mariano via Discuss <
He did post (a link to) the full code.
Actually I got fooled when I viewed the shape with "thrown together".
He explicitly calls render() in his code, which bypasses the
thrown-together process. I actually figured this out because the BOSL2
polyhedron validator produced a long list of errors like this:
ECHO: "ERROR REVERSAL (violet): Faces Reverse Across Edge at
[[0.0319137, -16.3794, 18.4927], [-0.932485, -16.0686, 18.6187]] indices:
[3217, 3216]"
ECHO: "ERROR REVERSAL (violet): Faces Reverse Across Edge at
[[0.949081, -16.81, 18.2839], [0.0319137, -16.3794, 18.4927]] indices:
[3218, 3217]"
ECHO: "ERROR REVERSAL (violet): Faces Reverse Across Edge at
[[1.80419, -17.3535, 17.9945], [0.949081, -16.81, 18.2839]] indices: [3219,
3218]"
ECHO: "ERROR REVERSAL (violet): Faces Reverse Across Edge at [[2.1411,
-17.6335, 17.8396], [1.80419, -17.3535, 17.9945]] indices: [3220, 3219]"
ECHO: "ERROR REVERSAL (violet): Faces Reverse Across Edge at [[2.4012,
-17.281, 17.9945], [2.1411, -17.6335, 17.8396]] indices: [3221, 3220]"
ECHO: "ERROR REVERSAL (violet): Faces Reverse Across Edge at
[[3.10139, -16.5486, 18.2839], [2.4012, -17.281, 17.9945]] indices: [3222,
3221]"
I am not sure why that render() call is there. It doesn't seem to do
anything other than preventing the user from using preview and hiding
errors. With render() removed, and thrown together enabled, the face
reversal is obvious as seen below. So the conclusion is: the polyhedron
has reversed faces, hence it is invalid.
<image.png>
On Sun, Jan 12, 2025 at 11:10 AM Raymond West via Discuss <
It would help if you posted an image of what you're trying to create,
and possibly some code. I can't help if you are trying to use bos2l or
you refer to github/elsewhere.
I find in f5 render, a lot of my stuff breaks up. However, in manifold
rendering f6, generally works. You can check, as Jordan hinted, by
including a cube when you f6, do it as the object is evolved. If you
just a cube, then you know where you've screwed up.
On 12/01/2025 08:08, Thomas Richter via Discuss wrote:
I create concave polyhedra of several thousand faces. For details
My question is not about building the shape, that's solved, but about
a strange error I experience with certain input values. An example causing
the error can be found on Github:
When I render the shape I get this error:
WARNING: PolySet -> Manifold conversion failed: NotManifold
Trying to repair and reconstruct mesh..
ERROR: [manifold] Input mesh is not closed!
ERROR: [manifold] Surface_mesh -> Manifold conversion failed:
This happens in very rare situations (e. g.: ARMS = 13, 1.97 <=
_armPitch <= 2.17, _q = 182, _q = 208 and ARMS = 17, 1.93 <= _armPitch <=
2.18, _q = 204). Since the values are similar I believe there is a
geometrical reason but I have no idea how I could debug this and figure out
the actual cause.
If you comment out line 163 (subtract hollow sphere) it doesn't
happen (though the shape will look strange then). The polyhedron itself is
built correctly, I have checked it several times by hand.
My platform is an Apple Silicon M3 CPU.
I would like to know if others experience the same behavior (on other
platforms) with the example provided and if so, what is the cause or at
least what could I do to debug it. My impression is that it happens when
the shape to subtract from is complex and very tiny faces are generated.
Unfortunately, the error message is not very helpful.
Is this an already known glitch?
Second question related to this: In case this is a shortcoming of the
rendering engine: Is there any chance to catch this error by means of the
source code and handle it by, e. g., adjusting the _armPitch value?
If this question is assumed to be spam, please let me know how I
should have brought this problem up. I have already asked the question in
one of the last messages of the other thread but it seems that it got lost
there.
I was going to say I kicked off another run of vnf_validate() to check your
polyhedron and got messages like this below (so edges that don't have a
mate). This validation runs in OpenSCAD, though it's slow. It took 28
minutes on your polyhedron. But it sounds like you have solved the
problem, which is great.
ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[2.19157, -18.0656,
7.62068], [2.19371, -18.0668, 7.61989]] indices: [2824, 2825]"
ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[2.19371, -18.0668,
7.61989], [2.19549, -18.0651, 7.62068]] indices: [2825, 2826]"
ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[2.19371, -18.0668,
7.61989], [2.63126, -17.4745, 7.88479]] indices: [2825, 2827]"
ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[2.19549, -18.0651,
7.62068], [2.63126, -17.4745, 7.88479]] indices: [2826, 2827]"
ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[9.61822, -14.8247,
7.88479], [10.336, -14.9778, 7.62068]] indices: [2835, 2836]"
ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[9.61822, -14.8247,
7.88479], [10.3385, -14.9779, 7.61989]] indices: [2835, 2837]"
ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[10.336, -14.9778,
7.62068], [10.3385, -14.9779, 7.61989]] indices: [2836, 2837]"
ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[10.3385, -14.9779,
7.61989], [10.3393, -14.9755, 7.62068]] indices: [2837, 2838]"
ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[10.3385, -14.9779,
7.61989], [10.4507, -14.2501, 7.88479]] indices: [2837, 2839]"
ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[10.3393, -14.9755,
7.62068], [10.4507, -14.2501, 7.88479]] indices: [2838, 2839]"
ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[15.4059, -8.65681,
7.88479], [16.1126, -8.45879, 7.62068]] indices: [2847, 2848]"
ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[15.4059, -8.65681,
7.88479], [16.1149, -8.45775, 7.61989]] indices: [2847, 2849]"
ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[16.1126, -8.45879,
7.62068], [16.1149, -8.45775, 7.61989]] indices: [2848, 2849]"
ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[16.1149, -8.45775,
7.61989], [16.1145, -8.45529, 7.62068]] indices: [2849, 2850]"
ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[16.1149, -8.45775,
7.61989], [15.876, -7.76117, 7.88479]] indices: [2849, 2851]"
ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[16.1145, -8.45529,
7.62068], [15.876, -7.76117, 7.88479]] indices: [2850, 2851]"
On Sun, Jan 12, 2025 at 6:38 PM Thomas Richter via Discuss <
discuss@lists.openscad.org> wrote:
> I had another idea and finally found it. It was indeed a problem with the
> polyhedron, a very rare edge case where two vertices of the same layer are
> very close and the number of vertices decreases in the next layer and the
> next vertex in the same layer is quite far away from the two other ones. I
> could only find it by analysing the generated faces with another script.
>
> Thanks again for your help.
>
>
> > Am 12.01.2025 um 22:56 schrieb Thomas Richter <
> tomselektropost@googlemail.com>:
> >
> > I give up. That's not a problem for my project since I don't need the
> boolean operation with the latest solution. I was just interested in the
> cause of the glitch.
> >
> > There is absolutely no evidence that the polyhedron is invalid after
> fixing the face orientation issue you found. I have checked with meshlab,
> with a script I implemented by myself, as well as different slicers.
> Neither show any errors in the meshes that I can export from OpenSCAD nor
> in the object structures output with echo. The polyhedra are always created
> the same way in my code, no matter what model parameters I use. Thus it is
> very likely that the structure of the few polyhedra that cannot be rendered
> is also correct. Based on the tests with my own scripts it is.
> >
> > I can create multiple polyhedra in the same scene. All points are unique
> by design but nonetheless, I have even checked that and found nothing.
> >
> > The latest possibility I saw was in the (quite surprisingly
> unpredictable) way the polyhedron function handles faces with a large
> number of vertices that are not within one and the same plane. After
> replacing those with self-generated triangles, I have no further idea.
> >
> > I never compare floating point values without considering possible
> precision issues.
> >
> > The problem appears only for very few combinations of model parameters.
> My software engineering experience gives me a strong feeling towards
> floating point issues but I have no idea where they should come from.
> >
> > Thank you all for your help.
> >
> >
> >> Am 12.01.2025 um 20:29 schrieb Adrian Mariano via Discuss <
> discuss@lists.openscad.org>:
> >>
> >> A polyhedron by itself never produces an error, even if it is invalid.
> If it fails when you union with a cube then that means your polyhedron is
> somehow invalid.
> >>
> >> On Sun, Jan 12, 2025 at 1:49 PM Thomas Richter via Discuss <
> discuss@lists.openscad.org> wrote:
> >> Thank you for this insight. I misunderstood the manual and oriented the
> side faces counterclockwise instead of clockwise. After fixing this the
> purple is all gone, the problem persists with boolean operations, goes away
> without boolean operations.
> >>
> >> The render() was there because the misoriented side faces made the body
> appearing transparent. Unfortunately this didn't lead to any insight on my
> side :-(
> >>
> >> I checked with a script that all points - copied from output with echo
> - are unique.
> >>
> >> I have uploaded the version with the fixed faces:
> >>
> >>
> https://github.com/trses/screw-nut-knobs/blob/boolean-glitch/analytical-solution.scad
> >>
> >> I flushed the caches before every experiment and made the following
> observations when trying to render (not preview), see lines 167 - 179:
> >>
> >> - difference with the polyhedron and a hollow sphere: problem persists
> >> - union with the polyhedron and a cube someplace else: problem persists
> >> - commenting out the difference / union rendering just the polyhedron:
> problem goes away.
> >>
> >> What does this mean?
> >>
> >>
> >>> Am 12.01.2025 um 17:41 schrieb Adrian Mariano via Discuss <
> discuss@lists.openscad.org>:
> >>>
> >>> He did post (a link to) the full code.
> >>>
> >>> Actually I got fooled when I viewed the shape with "thrown together".
> He explicitly calls render() in his code, which bypasses the
> thrown-together process. I actually figured this out because the BOSL2
> polyhedron validator produced a long list of errors like this:
> >>>
> >>> ECHO: "ERROR REVERSAL (violet): Faces Reverse Across Edge at
> [[0.0319137, -16.3794, 18.4927], [-0.932485, -16.0686, 18.6187]] indices:
> [3217, 3216]"
> >>> ECHO: "ERROR REVERSAL (violet): Faces Reverse Across Edge at
> [[0.949081, -16.81, 18.2839], [0.0319137, -16.3794, 18.4927]] indices:
> [3218, 3217]"
> >>> ECHO: "ERROR REVERSAL (violet): Faces Reverse Across Edge at
> [[1.80419, -17.3535, 17.9945], [0.949081, -16.81, 18.2839]] indices: [3219,
> 3218]"
> >>> ECHO: "ERROR REVERSAL (violet): Faces Reverse Across Edge at [[2.1411,
> -17.6335, 17.8396], [1.80419, -17.3535, 17.9945]] indices: [3220, 3219]"
> >>> ECHO: "ERROR REVERSAL (violet): Faces Reverse Across Edge at [[2.4012,
> -17.281, 17.9945], [2.1411, -17.6335, 17.8396]] indices: [3221, 3220]"
> >>> ECHO: "ERROR REVERSAL (violet): Faces Reverse Across Edge at
> [[3.10139, -16.5486, 18.2839], [2.4012, -17.281, 17.9945]] indices: [3222,
> 3221]"
> >>>
> >>> I am not sure why that render() call is there. It doesn't seem to do
> anything other than preventing the user from using preview and hiding
> errors. With render() removed, and thrown together enabled, the face
> reversal is obvious as seen below. So the conclusion is: the polyhedron
> has reversed faces, hence it is invalid.
> >>>
> >>>
> >>> <image.png>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>> On Sun, Jan 12, 2025 at 11:10 AM Raymond West via Discuss <
> discuss@lists.openscad.org> wrote:
> >>> It would help if you posted an image of what you're trying to create,
> >>> and possibly some code. I can't help if you are trying to use bos2l or
> >>> you refer to github/elsewhere.
> >>>
> >>> I find in f5 render, a lot of my stuff breaks up. However, in manifold
> >>> rendering f6, generally works. You can check, as Jordan hinted, by
> >>> including a cube when you f6, do it as the object is evolved. If you
> get
> >>> just a cube, then you know where you've screwed up.
> >>>
> >>> On 12/01/2025 08:08, Thomas Richter via Discuss wrote:
> >>>> I create concave polyhedra of several thousand faces. For details
> about the purpose see
> https://lists.openscad.org/empathy/thread/LY26O7U4CLHPW3BGQIDLSAE6FRVVHEUG
> >>>>
> >>>> My question is not about building the shape, that's solved, but about
> a strange error I experience with certain input values. An example causing
> the error can be found on Github:
> >>>>
> >>>>
> https://github.com/trses/screw-nut-knobs/blob/boolean-glitch/analytical-solution.scad
> >>>>
> >>>> When I render the shape I get this error:
> >>>>
> >>>> WARNING: PolySet -> Manifold conversion failed: NotManifold
> >>>> Trying to repair and reconstruct mesh..
> >>>> ERROR: [manifold] Input mesh is not closed!
> >>>> ERROR: [manifold] Surface_mesh -> Manifold conversion failed:
> NotManifold
> >>>>
> >>>> This happens in very rare situations (e. g.: ARMS = 13, 1.97 <=
> _armPitch <= 2.17, _q = 182, _q = 208 and ARMS = 17, 1.93 <= _armPitch <=
> 2.18, _q = 204). Since the values are similar I believe there is a
> geometrical reason but I have no idea how I could debug this and figure out
> the actual cause.
> >>>>
> >>>> If you comment out line 163 (subtract hollow sphere) it doesn't
> happen (though the shape will look strange then). The polyhedron itself is
> built correctly, I have checked it several times by hand.
> >>>>
> >>>> My platform is an Apple Silicon M3 CPU.
> >>>>
> >>>> I would like to know if others experience the same behavior (on other
> platforms) with the example provided and if so, what is the cause or at
> least what could I do to debug it. My impression is that it happens when
> the shape to subtract from is complex and very tiny faces are generated.
> Unfortunately, the error message is not very helpful.
> >>>>
> >>>> Is this an already known glitch?
> >>>>
> >>>> Second question related to this: In case this is a shortcoming of the
> rendering engine: Is there any chance to catch this error by means of the
> source code and handle it by, e. g., adjusting the _armPitch value?
> >>>>
> >>>> If this question is assumed to be spam, please let me know how I
> should have brought this problem up. I have already asked the question in
> one of the last messages of the other thread but it seems that it got lost
> there.
> >>>> _______________________________________________
> >>>> 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
> >>> _______________________________________________
> >>> 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
> >> _______________________________________________
> >> 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
>
TR
Thomas Richter
Sun, Jan 12, 2025 11:57 PM
I will have a look at vnf_validate to learn more about my options in cases like this one.
Am 13.01.2025 um 00:44 schrieb Adrian Mariano via Discuss discuss@lists.openscad.org:
I was going to say I kicked off another run of vnf_validate() to check your polyhedron and got messages like this below (so edges that don't have a mate). This validation runs in OpenSCAD, though it's slow. It took 28 minutes on your polyhedron. But it sounds like you have solved the problem, which is great.
ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[2.19157, -18.0656, 7.62068], [2.19371, -18.0668, 7.61989]] indices: [2824, 2825]"
ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[2.19371, -18.0668, 7.61989], [2.19549, -18.0651, 7.62068]] indices: [2825, 2826]"
ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[2.19371, -18.0668, 7.61989], [2.63126, -17.4745, 7.88479]] indices: [2825, 2827]"
ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[2.19549, -18.0651, 7.62068], [2.63126, -17.4745, 7.88479]] indices: [2826, 2827]"
ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[9.61822, -14.8247, 7.88479], [10.336, -14.9778, 7.62068]] indices: [2835, 2836]"
ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[9.61822, -14.8247, 7.88479], [10.3385, -14.9779, 7.61989]] indices: [2835, 2837]"
ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[10.336, -14.9778, 7.62068], [10.3385, -14.9779, 7.61989]] indices: [2836, 2837]"
ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[10.3385, -14.9779, 7.61989], [10.3393, -14.9755, 7.62068]] indices: [2837, 2838]"
ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[10.3385, -14.9779, 7.61989], [10.4507, -14.2501, 7.88479]] indices: [2837, 2839]"
ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[10.3393, -14.9755, 7.62068], [10.4507, -14.2501, 7.88479]] indices: [2838, 2839]"
ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[15.4059, -8.65681, 7.88479], [16.1126, -8.45879, 7.62068]] indices: [2847, 2848]"
ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[15.4059, -8.65681, 7.88479], [16.1149, -8.45775, 7.61989]] indices: [2847, 2849]"
ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[16.1126, -8.45879, 7.62068], [16.1149, -8.45775, 7.61989]] indices: [2848, 2849]"
ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[16.1149, -8.45775, 7.61989], [16.1145, -8.45529, 7.62068]] indices: [2849, 2850]"
ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[16.1149, -8.45775, 7.61989], [15.876, -7.76117, 7.88479]] indices: [2849, 2851]"
ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[16.1145, -8.45529, 7.62068], [15.876, -7.76117, 7.88479]] indices: [2850, 2851]"
On Sun, Jan 12, 2025 at 6:38 PM Thomas Richter via Discuss discuss@lists.openscad.org wrote:
I had another idea and finally found it. It was indeed a problem with the polyhedron, a very rare edge case where two vertices of the same layer are very close and the number of vertices decreases in the next layer and the next vertex in the same layer is quite far away from the two other ones. I could only find it by analysing the generated faces with another script.
Thanks again for your help.
Am 12.01.2025 um 22:56 schrieb Thomas Richter tomselektropost@googlemail.com:
I give up. That's not a problem for my project since I don't need the boolean operation with the latest solution. I was just interested in the cause of the glitch.
There is absolutely no evidence that the polyhedron is invalid after fixing the face orientation issue you found. I have checked with meshlab, with a script I implemented by myself, as well as different slicers. Neither show any errors in the meshes that I can export from OpenSCAD nor in the object structures output with echo. The polyhedra are always created the same way in my code, no matter what model parameters I use. Thus it is very likely that the structure of the few polyhedra that cannot be rendered is also correct. Based on the tests with my own scripts it is.
I can create multiple polyhedra in the same scene. All points are unique by design but nonetheless, I have even checked that and found nothing.
The latest possibility I saw was in the (quite surprisingly unpredictable) way the polyhedron function handles faces with a large number of vertices that are not within one and the same plane. After replacing those with self-generated triangles, I have no further idea.
I never compare floating point values without considering possible precision issues.
The problem appears only for very few combinations of model parameters. My software engineering experience gives me a strong feeling towards floating point issues but I have no idea where they should come from.
Thank you all for your help.
Am 12.01.2025 um 20:29 schrieb Adrian Mariano via Discuss discuss@lists.openscad.org:
A polyhedron by itself never produces an error, even if it is invalid. If it fails when you union with a cube then that means your polyhedron is somehow invalid.
On Sun, Jan 12, 2025 at 1:49 PM Thomas Richter via Discuss discuss@lists.openscad.org wrote:
Thank you for this insight. I misunderstood the manual and oriented the side faces counterclockwise instead of clockwise. After fixing this the purple is all gone, the problem persists with boolean operations, goes away without boolean operations.
The render() was there because the misoriented side faces made the body appearing transparent. Unfortunately this didn't lead to any insight on my side :-(
I checked with a script that all points - copied from output with echo - are unique.
I have uploaded the version with the fixed faces:
https://github.com/trses/screw-nut-knobs/blob/boolean-glitch/analytical-solution.scad
I flushed the caches before every experiment and made the following observations when trying to render (not preview), see lines 167 - 179:
- difference with the polyhedron and a hollow sphere: problem persists
- union with the polyhedron and a cube someplace else: problem persists
- commenting out the difference / union rendering just the polyhedron: problem goes away.
What does this mean?
Am 12.01.2025 um 17:41 schrieb Adrian Mariano via Discuss discuss@lists.openscad.org:
He did post (a link to) the full code.
Actually I got fooled when I viewed the shape with "thrown together". He explicitly calls render() in his code, which bypasses the thrown-together process. I actually figured this out because the BOSL2 polyhedron validator produced a long list of errors like this:
ECHO: "ERROR REVERSAL (violet): Faces Reverse Across Edge at [[0.0319137, -16.3794, 18.4927], [-0.932485, -16.0686, 18.6187]] indices: [3217, 3216]"
ECHO: "ERROR REVERSAL (violet): Faces Reverse Across Edge at [[0.949081, -16.81, 18.2839], [0.0319137, -16.3794, 18.4927]] indices: [3218, 3217]"
ECHO: "ERROR REVERSAL (violet): Faces Reverse Across Edge at [[1.80419, -17.3535, 17.9945], [0.949081, -16.81, 18.2839]] indices: [3219, 3218]"
ECHO: "ERROR REVERSAL (violet): Faces Reverse Across Edge at [[2.1411, -17.6335, 17.8396], [1.80419, -17.3535, 17.9945]] indices: [3220, 3219]"
ECHO: "ERROR REVERSAL (violet): Faces Reverse Across Edge at [[2.4012, -17.281, 17.9945], [2.1411, -17.6335, 17.8396]] indices: [3221, 3220]"
ECHO: "ERROR REVERSAL (violet): Faces Reverse Across Edge at [[3.10139, -16.5486, 18.2839], [2.4012, -17.281, 17.9945]] indices: [3222, 3221]"
I am not sure why that render() call is there. It doesn't seem to do anything other than preventing the user from using preview and hiding errors. With render() removed, and thrown together enabled, the face reversal is obvious as seen below. So the conclusion is: the polyhedron has reversed faces, hence it is invalid.
<image.png>
On Sun, Jan 12, 2025 at 11:10 AM Raymond West via Discuss discuss@lists.openscad.org wrote:
It would help if you posted an image of what you're trying to create,
and possibly some code. I can't help if you are trying to use bos2l or
you refer to github/elsewhere.
I find in f5 render, a lot of my stuff breaks up. However, in manifold
rendering f6, generally works. You can check, as Jordan hinted, by
including a cube when you f6, do it as the object is evolved. If you get
just a cube, then you know where you've screwed up.
On 12/01/2025 08:08, Thomas Richter via Discuss wrote:
I create concave polyhedra of several thousand faces. For details about the purpose see https://lists.openscad.org/empathy/thread/LY26O7U4CLHPW3BGQIDLSAE6FRVVHEUG
My question is not about building the shape, that's solved, but about a strange error I experience with certain input values. An example causing the error can be found on Github:
https://github.com/trses/screw-nut-knobs/blob/boolean-glitch/analytical-solution.scad
When I render the shape I get this error:
WARNING: PolySet -> Manifold conversion failed: NotManifold
Trying to repair and reconstruct mesh..
ERROR: [manifold] Input mesh is not closed!
ERROR: [manifold] Surface_mesh -> Manifold conversion failed: NotManifold
This happens in very rare situations (e. g.: ARMS = 13, 1.97 <= _armPitch <= 2.17, _q = 182, _q = 208 and ARMS = 17, 1.93 <= _armPitch <= 2.18, _q = 204). Since the values are similar I believe there is a geometrical reason but I have no idea how I could debug this and figure out the actual cause.
If you comment out line 163 (subtract hollow sphere) it doesn't happen (though the shape will look strange then). The polyhedron itself is built correctly, I have checked it several times by hand.
My platform is an Apple Silicon M3 CPU.
I would like to know if others experience the same behavior (on other platforms) with the example provided and if so, what is the cause or at least what could I do to debug it. My impression is that it happens when the shape to subtract from is complex and very tiny faces are generated. Unfortunately, the error message is not very helpful.
Is this an already known glitch?
Second question related to this: In case this is a shortcoming of the rendering engine: Is there any chance to catch this error by means of the source code and handle it by, e. g., adjusting the _armPitch value?
If this question is assumed to be spam, please let me know how I should have brought this problem up. I have already asked the question in one of the last messages of the other thread but it seems that it got lost there.
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
I will have a look at vnf_validate to learn more about my options in cases like this one.
> Am 13.01.2025 um 00:44 schrieb Adrian Mariano via Discuss <discuss@lists.openscad.org>:
>
> I was going to say I kicked off another run of vnf_validate() to check your polyhedron and got messages like this below (so edges that don't have a mate). This validation runs in OpenSCAD, though it's slow. It took 28 minutes on your polyhedron. But it sounds like you have solved the problem, which is great.
>
> ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[2.19157, -18.0656, 7.62068], [2.19371, -18.0668, 7.61989]] indices: [2824, 2825]"
> ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[2.19371, -18.0668, 7.61989], [2.19549, -18.0651, 7.62068]] indices: [2825, 2826]"
> ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[2.19371, -18.0668, 7.61989], [2.63126, -17.4745, 7.88479]] indices: [2825, 2827]"
> ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[2.19549, -18.0651, 7.62068], [2.63126, -17.4745, 7.88479]] indices: [2826, 2827]"
> ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[9.61822, -14.8247, 7.88479], [10.336, -14.9778, 7.62068]] indices: [2835, 2836]"
> ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[9.61822, -14.8247, 7.88479], [10.3385, -14.9779, 7.61989]] indices: [2835, 2837]"
> ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[10.336, -14.9778, 7.62068], [10.3385, -14.9779, 7.61989]] indices: [2836, 2837]"
> ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[10.3385, -14.9779, 7.61989], [10.3393, -14.9755, 7.62068]] indices: [2837, 2838]"
> ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[10.3385, -14.9779, 7.61989], [10.4507, -14.2501, 7.88479]] indices: [2837, 2839]"
> ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[10.3393, -14.9755, 7.62068], [10.4507, -14.2501, 7.88479]] indices: [2838, 2839]"
> ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[15.4059, -8.65681, 7.88479], [16.1126, -8.45879, 7.62068]] indices: [2847, 2848]"
> ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[15.4059, -8.65681, 7.88479], [16.1149, -8.45775, 7.61989]] indices: [2847, 2849]"
> ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[16.1126, -8.45879, 7.62068], [16.1149, -8.45775, 7.61989]] indices: [2848, 2849]"
> ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[16.1149, -8.45775, 7.61989], [16.1145, -8.45529, 7.62068]] indices: [2849, 2850]"
> ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[16.1149, -8.45775, 7.61989], [15.876, -7.76117, 7.88479]] indices: [2849, 2851]"
> ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[16.1145, -8.45529, 7.62068], [15.876, -7.76117, 7.88479]] indices: [2850, 2851]"
>
>
>
> On Sun, Jan 12, 2025 at 6:38 PM Thomas Richter via Discuss <discuss@lists.openscad.org> wrote:
> I had another idea and finally found it. It was indeed a problem with the polyhedron, a very rare edge case where two vertices of the same layer are very close and the number of vertices decreases in the next layer and the next vertex in the same layer is quite far away from the two other ones. I could only find it by analysing the generated faces with another script.
>
> Thanks again for your help.
>
>
> > Am 12.01.2025 um 22:56 schrieb Thomas Richter <tomselektropost@googlemail.com>:
> >
> > I give up. That's not a problem for my project since I don't need the boolean operation with the latest solution. I was just interested in the cause of the glitch.
> >
> > There is absolutely no evidence that the polyhedron is invalid after fixing the face orientation issue you found. I have checked with meshlab, with a script I implemented by myself, as well as different slicers. Neither show any errors in the meshes that I can export from OpenSCAD nor in the object structures output with echo. The polyhedra are always created the same way in my code, no matter what model parameters I use. Thus it is very likely that the structure of the few polyhedra that cannot be rendered is also correct. Based on the tests with my own scripts it is.
> >
> > I can create multiple polyhedra in the same scene. All points are unique by design but nonetheless, I have even checked that and found nothing.
> >
> > The latest possibility I saw was in the (quite surprisingly unpredictable) way the polyhedron function handles faces with a large number of vertices that are not within one and the same plane. After replacing those with self-generated triangles, I have no further idea.
> >
> > I never compare floating point values without considering possible precision issues.
> >
> > The problem appears only for very few combinations of model parameters. My software engineering experience gives me a strong feeling towards floating point issues but I have no idea where they should come from.
> >
> > Thank you all for your help.
> >
> >
> >> Am 12.01.2025 um 20:29 schrieb Adrian Mariano via Discuss <discuss@lists.openscad.org>:
> >>
> >> A polyhedron by itself never produces an error, even if it is invalid. If it fails when you union with a cube then that means your polyhedron is somehow invalid.
> >>
> >> On Sun, Jan 12, 2025 at 1:49 PM Thomas Richter via Discuss <discuss@lists.openscad.org> wrote:
> >> Thank you for this insight. I misunderstood the manual and oriented the side faces counterclockwise instead of clockwise. After fixing this the purple is all gone, the problem persists with boolean operations, goes away without boolean operations.
> >>
> >> The render() was there because the misoriented side faces made the body appearing transparent. Unfortunately this didn't lead to any insight on my side :-(
> >>
> >> I checked with a script that all points - copied from output with echo - are unique.
> >>
> >> I have uploaded the version with the fixed faces:
> >>
> >> https://github.com/trses/screw-nut-knobs/blob/boolean-glitch/analytical-solution.scad
> >>
> >> I flushed the caches before every experiment and made the following observations when trying to render (not preview), see lines 167 - 179:
> >>
> >> - difference with the polyhedron and a hollow sphere: problem persists
> >> - union with the polyhedron and a cube someplace else: problem persists
> >> - commenting out the difference / union rendering just the polyhedron: problem goes away.
> >>
> >> What does this mean?
> >>
> >>
> >>> Am 12.01.2025 um 17:41 schrieb Adrian Mariano via Discuss <discuss@lists.openscad.org>:
> >>>
> >>> He did post (a link to) the full code.
> >>>
> >>> Actually I got fooled when I viewed the shape with "thrown together". He explicitly calls render() in his code, which bypasses the thrown-together process. I actually figured this out because the BOSL2 polyhedron validator produced a long list of errors like this:
> >>>
> >>> ECHO: "ERROR REVERSAL (violet): Faces Reverse Across Edge at [[0.0319137, -16.3794, 18.4927], [-0.932485, -16.0686, 18.6187]] indices: [3217, 3216]"
> >>> ECHO: "ERROR REVERSAL (violet): Faces Reverse Across Edge at [[0.949081, -16.81, 18.2839], [0.0319137, -16.3794, 18.4927]] indices: [3218, 3217]"
> >>> ECHO: "ERROR REVERSAL (violet): Faces Reverse Across Edge at [[1.80419, -17.3535, 17.9945], [0.949081, -16.81, 18.2839]] indices: [3219, 3218]"
> >>> ECHO: "ERROR REVERSAL (violet): Faces Reverse Across Edge at [[2.1411, -17.6335, 17.8396], [1.80419, -17.3535, 17.9945]] indices: [3220, 3219]"
> >>> ECHO: "ERROR REVERSAL (violet): Faces Reverse Across Edge at [[2.4012, -17.281, 17.9945], [2.1411, -17.6335, 17.8396]] indices: [3221, 3220]"
> >>> ECHO: "ERROR REVERSAL (violet): Faces Reverse Across Edge at [[3.10139, -16.5486, 18.2839], [2.4012, -17.281, 17.9945]] indices: [3222, 3221]"
> >>>
> >>> I am not sure why that render() call is there. It doesn't seem to do anything other than preventing the user from using preview and hiding errors. With render() removed, and thrown together enabled, the face reversal is obvious as seen below. So the conclusion is: the polyhedron has reversed faces, hence it is invalid.
> >>>
> >>>
> >>> <image.png>
> >>>
> >>>
> >>>
> >>>
> >>>
> >>> On Sun, Jan 12, 2025 at 11:10 AM Raymond West via Discuss <discuss@lists.openscad.org> wrote:
> >>> It would help if you posted an image of what you're trying to create,
> >>> and possibly some code. I can't help if you are trying to use bos2l or
> >>> you refer to github/elsewhere.
> >>>
> >>> I find in f5 render, a lot of my stuff breaks up. However, in manifold
> >>> rendering f6, generally works. You can check, as Jordan hinted, by
> >>> including a cube when you f6, do it as the object is evolved. If you get
> >>> just a cube, then you know where you've screwed up.
> >>>
> >>> On 12/01/2025 08:08, Thomas Richter via Discuss wrote:
> >>>> I create concave polyhedra of several thousand faces. For details about the purpose see https://lists.openscad.org/empathy/thread/LY26O7U4CLHPW3BGQIDLSAE6FRVVHEUG
> >>>>
> >>>> My question is not about building the shape, that's solved, but about a strange error I experience with certain input values. An example causing the error can be found on Github:
> >>>>
> >>>> https://github.com/trses/screw-nut-knobs/blob/boolean-glitch/analytical-solution.scad
> >>>>
> >>>> When I render the shape I get this error:
> >>>>
> >>>> WARNING: PolySet -> Manifold conversion failed: NotManifold
> >>>> Trying to repair and reconstruct mesh..
> >>>> ERROR: [manifold] Input mesh is not closed!
> >>>> ERROR: [manifold] Surface_mesh -> Manifold conversion failed: NotManifold
> >>>>
> >>>> This happens in very rare situations (e. g.: ARMS = 13, 1.97 <= _armPitch <= 2.17, _q = 182, _q = 208 and ARMS = 17, 1.93 <= _armPitch <= 2.18, _q = 204). Since the values are similar I believe there is a geometrical reason but I have no idea how I could debug this and figure out the actual cause.
> >>>>
> >>>> If you comment out line 163 (subtract hollow sphere) it doesn't happen (though the shape will look strange then). The polyhedron itself is built correctly, I have checked it several times by hand.
> >>>>
> >>>> My platform is an Apple Silicon M3 CPU.
> >>>>
> >>>> I would like to know if others experience the same behavior (on other platforms) with the example provided and if so, what is the cause or at least what could I do to debug it. My impression is that it happens when the shape to subtract from is complex and very tiny faces are generated. Unfortunately, the error message is not very helpful.
> >>>>
> >>>> Is this an already known glitch?
> >>>>
> >>>> Second question related to this: In case this is a shortcoming of the rendering engine: Is there any chance to catch this error by means of the source code and handle it by, e. g., adjusting the _armPitch value?
> >>>>
> >>>> If this question is assumed to be spam, please let me know how I should have brought this problem up. I have already asked the question in one of the last messages of the other thread but it seems that it got lost there.
> >>>> _______________________________________________
> >>>> 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
> >>> _______________________________________________
> >>> 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
> >> _______________________________________________
> >> 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
> _______________________________________________
> OpenSCAD mailing list
> To unsubscribe send an email to discuss-leave@lists.openscad.org
AM
Adrian Mariano
Mon, Jan 13, 2025 12:10 AM
You said that it's "not a problem...since [you] don't need the boolean
operation". I should maybe point out also that just because you don't get
an error when you have the polyhedron alone doesn't mean that things are
OK. Your polyhedron is still invalid. It's just that OpenSCAD doesn't
notice and it blithely writes out that invalid polyhedron as an STL file.
So if you do this you have to hope that whatever is downstream in your
processing chain is willing and able to take the invalid input and fix it
or handle it the way you want. Personally I prefer to avoid generating
invalid output.
The vnf_validate module is documented here:
https://github.com/BelfrySCAD/BOSL2/wiki/vnf.scad#module-vnf_validate
On Sun, Jan 12, 2025 at 6:58 PM Thomas Richter via Discuss <
discuss@lists.openscad.org> wrote:
I will have a look at vnf_validate to learn more about my options in cases
like this one.
Am 13.01.2025 um 00:44 schrieb Adrian Mariano via Discuss <
I was going to say I kicked off another run of vnf_validate() to check
your polyhedron and got messages like this below (so edges that don't have
a mate). This validation runs in OpenSCAD, though it's slow. It took 28
minutes on your polyhedron. But it sounds like you have solved the
problem, which is great.
ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[2.19157, -18.0656,
7.62068], [2.19371, -18.0668, 7.61989]] indices: [2824, 2825]"
ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[2.19371, -18.0668,
7.61989], [2.19549, -18.0651, 7.62068]] indices: [2825, 2826]"
ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[2.19371, -18.0668,
7.61989], [2.63126, -17.4745, 7.88479]] indices: [2825, 2827]"
ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[2.19549, -18.0651,
7.62068], [2.63126, -17.4745, 7.88479]] indices: [2826, 2827]"
ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[9.61822, -14.8247,
7.88479], [10.336, -14.9778, 7.62068]] indices: [2835, 2836]"
ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[9.61822, -14.8247,
7.88479], [10.3385, -14.9779, 7.61989]] indices: [2835, 2837]"
ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[10.336, -14.9778,
7.62068], [10.3385, -14.9779, 7.61989]] indices: [2836, 2837]"
ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[10.3385, -14.9779,
7.61989], [10.3393, -14.9755, 7.62068]] indices: [2837, 2838]"
ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[10.3385, -14.9779,
7.61989], [10.4507, -14.2501, 7.88479]] indices: [2837, 2839]"
ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[10.3393, -14.9755,
7.62068], [10.4507, -14.2501, 7.88479]] indices: [2838, 2839]"
ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[15.4059, -8.65681,
7.88479], [16.1126, -8.45879, 7.62068]] indices: [2847, 2848]"
ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[15.4059, -8.65681,
7.88479], [16.1149, -8.45775, 7.61989]] indices: [2847, 2849]"
ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[16.1126, -8.45879,
7.62068], [16.1149, -8.45775, 7.61989]] indices: [2848, 2849]"
ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[16.1149, -8.45775,
7.61989], [16.1145, -8.45529, 7.62068]] indices: [2849, 2850]"
ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[16.1149, -8.45775,
7.61989], [15.876, -7.76117, 7.88479]] indices: [2849, 2851]"
ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[16.1145, -8.45529,
7.62068], [15.876, -7.76117, 7.88479]] indices: [2850, 2851]"
On Sun, Jan 12, 2025 at 6:38 PM Thomas Richter via Discuss <
I had another idea and finally found it. It was indeed a problem with
the polyhedron, a very rare edge case where two vertices of the same layer
are very close and the number of vertices decreases in the next layer and
the next vertex in the same layer is quite far away from the two other
ones. I could only find it by analysing the generated faces with another
script.
Thanks again for your help.
Am 12.01.2025 um 22:56 schrieb Thomas Richter <
I give up. That's not a problem for my project since I don't need the
boolean operation with the latest solution. I was just interested in the
cause of the glitch.
There is absolutely no evidence that the polyhedron is invalid after
fixing the face orientation issue you found. I have checked with meshlab,
with a script I implemented by myself, as well as different slicers.
Neither show any errors in the meshes that I can export from OpenSCAD nor
in the object structures output with echo. The polyhedra are always created
the same way in my code, no matter what model parameters I use. Thus it is
very likely that the structure of the few polyhedra that cannot be rendered
is also correct. Based on the tests with my own scripts it is.
I can create multiple polyhedra in the same scene. All points are
unique by design but nonetheless, I have even checked that and found
nothing.
The latest possibility I saw was in the (quite surprisingly
unpredictable) way the polyhedron function handles faces with a large
number of vertices that are not within one and the same plane. After
replacing those with self-generated triangles, I have no further idea.
I never compare floating point values without considering possible
The problem appears only for very few combinations of model
parameters. My software engineering experience gives me a strong feeling
towards floating point issues but I have no idea where they should come
from.
Thank you all for your help.
Am 12.01.2025 um 20:29 schrieb Adrian Mariano via Discuss <
A polyhedron by itself never produces an error, even if it is
invalid. If it fails when you union with a cube then that means your
polyhedron is somehow invalid.
On Sun, Jan 12, 2025 at 1:49 PM Thomas Richter via Discuss <
Thank you for this insight. I misunderstood the manual and oriented
the side faces counterclockwise instead of clockwise. After fixing this the
purple is all gone, the problem persists with boolean operations, goes away
without boolean operations.
The render() was there because the misoriented side faces made the
body appearing transparent. Unfortunately this didn't lead to any insight
on my side :-(
I checked with a script that all points - copied from output with
I have uploaded the version with the fixed faces:
I flushed the caches before every experiment and made the following
observations when trying to render (not preview), see lines 167 - 179:
- difference with the polyhedron and a hollow sphere: problem persists
- union with the polyhedron and a cube someplace else: problem
- commenting out the difference / union rendering just the
polyhedron: problem goes away.
Am 12.01.2025 um 17:41 schrieb Adrian Mariano via Discuss <
He did post (a link to) the full code.
Actually I got fooled when I viewed the shape with "thrown
together". He explicitly calls render() in his code, which bypasses the
thrown-together process. I actually figured this out because the BOSL2
polyhedron validator produced a long list of errors like this:
ECHO: "ERROR REVERSAL (violet): Faces Reverse Across Edge at
[[0.0319137, -16.3794, 18.4927], [-0.932485, -16.0686, 18.6187]] indices:
[3217, 3216]"
ECHO: "ERROR REVERSAL (violet): Faces Reverse Across Edge at
[[0.949081, -16.81, 18.2839], [0.0319137, -16.3794, 18.4927]] indices:
[3218, 3217]"
ECHO: "ERROR REVERSAL (violet): Faces Reverse Across Edge at
[[1.80419, -17.3535, 17.9945], [0.949081, -16.81, 18.2839]] indices: [3219,
3218]"
ECHO: "ERROR REVERSAL (violet): Faces Reverse Across Edge at
[[2.1411, -17.6335, 17.8396], [1.80419, -17.3535, 17.9945]] indices: [3220,
3219]"
ECHO: "ERROR REVERSAL (violet): Faces Reverse Across Edge at
[[2.4012, -17.281, 17.9945], [2.1411, -17.6335, 17.8396]] indices: [3221,
3220]"
ECHO: "ERROR REVERSAL (violet): Faces Reverse Across Edge at
[[3.10139, -16.5486, 18.2839], [2.4012, -17.281, 17.9945]] indices: [3222,
3221]"
I am not sure why that render() call is there. It doesn't seem to
do anything other than preventing the user from using preview and hiding
errors. With render() removed, and thrown together enabled, the face
reversal is obvious as seen below. So the conclusion is: the polyhedron
has reversed faces, hence it is invalid.
<image.png>
On Sun, Jan 12, 2025 at 11:10 AM Raymond West via Discuss <
It would help if you posted an image of what you're trying to
and possibly some code. I can't help if you are trying to use bos2l
you refer to github/elsewhere.
I find in f5 render, a lot of my stuff breaks up. However, in
rendering f6, generally works. You can check, as Jordan hinted, by
including a cube when you f6, do it as the object is evolved. If you
just a cube, then you know where you've screwed up.
On 12/01/2025 08:08, Thomas Richter via Discuss wrote:
I create concave polyhedra of several thousand faces. For details
My question is not about building the shape, that's solved, but
about a strange error I experience with certain input values. An example
causing the error can be found on Github:
When I render the shape I get this error:
WARNING: PolySet -> Manifold conversion failed: NotManifold
Trying to repair and reconstruct mesh..
ERROR: [manifold] Input mesh is not closed!
ERROR: [manifold] Surface_mesh -> Manifold conversion failed:
This happens in very rare situations (e. g.: ARMS = 13, 1.97 <=
_armPitch <= 2.17, _q = 182, _q = 208 and ARMS = 17, 1.93 <= _armPitch <=
2.18, _q = 204). Since the values are similar I believe there is a
geometrical reason but I have no idea how I could debug this and figure out
the actual cause.
If you comment out line 163 (subtract hollow sphere) it doesn't
happen (though the shape will look strange then). The polyhedron itself is
built correctly, I have checked it several times by hand.
My platform is an Apple Silicon M3 CPU.
I would like to know if others experience the same behavior (on
other platforms) with the example provided and if so, what is the cause or
at least what could I do to debug it. My impression is that it happens when
the shape to subtract from is complex and very tiny faces are generated.
Unfortunately, the error message is not very helpful.
Is this an already known glitch?
Second question related to this: In case this is a shortcoming of
the rendering engine: Is there any chance to catch this error by means of
the source code and handle it by, e. g., adjusting the _armPitch value?
If this question is assumed to be spam, please let me know how I
should have brought this problem up. I have already asked the question in
one of the last messages of the other thread but it seems that it got lost
there.
You said that it's "not a problem...since [you] don't need the boolean
operation". I should maybe point out also that just because you don't get
an error when you have the polyhedron alone doesn't mean that things are
OK. Your polyhedron is still invalid. It's just that OpenSCAD doesn't
notice and it blithely writes out that invalid polyhedron as an STL file.
So if you do this you have to hope that whatever is downstream in your
processing chain is willing and able to take the invalid input and fix it
or handle it the way you want. Personally I prefer to avoid generating
invalid output.
The vnf_validate module is documented here:
https://github.com/BelfrySCAD/BOSL2/wiki/vnf.scad#module-vnf_validate
On Sun, Jan 12, 2025 at 6:58 PM Thomas Richter via Discuss <
discuss@lists.openscad.org> wrote:
> I will have a look at vnf_validate to learn more about my options in cases
> like this one.
>
>
> > Am 13.01.2025 um 00:44 schrieb Adrian Mariano via Discuss <
> discuss@lists.openscad.org>:
> >
> > I was going to say I kicked off another run of vnf_validate() to check
> your polyhedron and got messages like this below (so edges that don't have
> a mate). This validation runs in OpenSCAD, though it's slow. It took 28
> minutes on your polyhedron. But it sounds like you have solved the
> problem, which is great.
> >
> > ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[2.19157, -18.0656,
> 7.62068], [2.19371, -18.0668, 7.61989]] indices: [2824, 2825]"
> > ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[2.19371, -18.0668,
> 7.61989], [2.19549, -18.0651, 7.62068]] indices: [2825, 2826]"
> > ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[2.19371, -18.0668,
> 7.61989], [2.63126, -17.4745, 7.88479]] indices: [2825, 2827]"
> > ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[2.19549, -18.0651,
> 7.62068], [2.63126, -17.4745, 7.88479]] indices: [2826, 2827]"
> > ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[9.61822, -14.8247,
> 7.88479], [10.336, -14.9778, 7.62068]] indices: [2835, 2836]"
> > ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[9.61822, -14.8247,
> 7.88479], [10.3385, -14.9779, 7.61989]] indices: [2835, 2837]"
> > ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[10.336, -14.9778,
> 7.62068], [10.3385, -14.9779, 7.61989]] indices: [2836, 2837]"
> > ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[10.3385, -14.9779,
> 7.61989], [10.3393, -14.9755, 7.62068]] indices: [2837, 2838]"
> > ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[10.3385, -14.9779,
> 7.61989], [10.4507, -14.2501, 7.88479]] indices: [2837, 2839]"
> > ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[10.3393, -14.9755,
> 7.62068], [10.4507, -14.2501, 7.88479]] indices: [2838, 2839]"
> > ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[15.4059, -8.65681,
> 7.88479], [16.1126, -8.45879, 7.62068]] indices: [2847, 2848]"
> > ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[15.4059, -8.65681,
> 7.88479], [16.1149, -8.45775, 7.61989]] indices: [2847, 2849]"
> > ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[16.1126, -8.45879,
> 7.62068], [16.1149, -8.45775, 7.61989]] indices: [2848, 2849]"
> > ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[16.1149, -8.45775,
> 7.61989], [16.1145, -8.45529, 7.62068]] indices: [2849, 2850]"
> > ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[16.1149, -8.45775,
> 7.61989], [15.876, -7.76117, 7.88479]] indices: [2849, 2851]"
> > ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[16.1145, -8.45529,
> 7.62068], [15.876, -7.76117, 7.88479]] indices: [2850, 2851]"
> >
> >
> >
> > On Sun, Jan 12, 2025 at 6:38 PM Thomas Richter via Discuss <
> discuss@lists.openscad.org> wrote:
> > I had another idea and finally found it. It was indeed a problem with
> the polyhedron, a very rare edge case where two vertices of the same layer
> are very close and the number of vertices decreases in the next layer and
> the next vertex in the same layer is quite far away from the two other
> ones. I could only find it by analysing the generated faces with another
> script.
> >
> > Thanks again for your help.
> >
> >
> > > Am 12.01.2025 um 22:56 schrieb Thomas Richter <
> tomselektropost@googlemail.com>:
> > >
> > > I give up. That's not a problem for my project since I don't need the
> boolean operation with the latest solution. I was just interested in the
> cause of the glitch.
> > >
> > > There is absolutely no evidence that the polyhedron is invalid after
> fixing the face orientation issue you found. I have checked with meshlab,
> with a script I implemented by myself, as well as different slicers.
> Neither show any errors in the meshes that I can export from OpenSCAD nor
> in the object structures output with echo. The polyhedra are always created
> the same way in my code, no matter what model parameters I use. Thus it is
> very likely that the structure of the few polyhedra that cannot be rendered
> is also correct. Based on the tests with my own scripts it is.
> > >
> > > I can create multiple polyhedra in the same scene. All points are
> unique by design but nonetheless, I have even checked that and found
> nothing.
> > >
> > > The latest possibility I saw was in the (quite surprisingly
> unpredictable) way the polyhedron function handles faces with a large
> number of vertices that are not within one and the same plane. After
> replacing those with self-generated triangles, I have no further idea.
> > >
> > > I never compare floating point values without considering possible
> precision issues.
> > >
> > > The problem appears only for very few combinations of model
> parameters. My software engineering experience gives me a strong feeling
> towards floating point issues but I have no idea where they should come
> from.
> > >
> > > Thank you all for your help.
> > >
> > >
> > >> Am 12.01.2025 um 20:29 schrieb Adrian Mariano via Discuss <
> discuss@lists.openscad.org>:
> > >>
> > >> A polyhedron by itself never produces an error, even if it is
> invalid. If it fails when you union with a cube then that means your
> polyhedron is somehow invalid.
> > >>
> > >> On Sun, Jan 12, 2025 at 1:49 PM Thomas Richter via Discuss <
> discuss@lists.openscad.org> wrote:
> > >> Thank you for this insight. I misunderstood the manual and oriented
> the side faces counterclockwise instead of clockwise. After fixing this the
> purple is all gone, the problem persists with boolean operations, goes away
> without boolean operations.
> > >>
> > >> The render() was there because the misoriented side faces made the
> body appearing transparent. Unfortunately this didn't lead to any insight
> on my side :-(
> > >>
> > >> I checked with a script that all points - copied from output with
> echo - are unique.
> > >>
> > >> I have uploaded the version with the fixed faces:
> > >>
> > >>
> https://github.com/trses/screw-nut-knobs/blob/boolean-glitch/analytical-solution.scad
> > >>
> > >> I flushed the caches before every experiment and made the following
> observations when trying to render (not preview), see lines 167 - 179:
> > >>
> > >> - difference with the polyhedron and a hollow sphere: problem persists
> > >> - union with the polyhedron and a cube someplace else: problem
> persists
> > >> - commenting out the difference / union rendering just the
> polyhedron: problem goes away.
> > >>
> > >> What does this mean?
> > >>
> > >>
> > >>> Am 12.01.2025 um 17:41 schrieb Adrian Mariano via Discuss <
> discuss@lists.openscad.org>:
> > >>>
> > >>> He did post (a link to) the full code.
> > >>>
> > >>> Actually I got fooled when I viewed the shape with "thrown
> together". He explicitly calls render() in his code, which bypasses the
> thrown-together process. I actually figured this out because the BOSL2
> polyhedron validator produced a long list of errors like this:
> > >>>
> > >>> ECHO: "ERROR REVERSAL (violet): Faces Reverse Across Edge at
> [[0.0319137, -16.3794, 18.4927], [-0.932485, -16.0686, 18.6187]] indices:
> [3217, 3216]"
> > >>> ECHO: "ERROR REVERSAL (violet): Faces Reverse Across Edge at
> [[0.949081, -16.81, 18.2839], [0.0319137, -16.3794, 18.4927]] indices:
> [3218, 3217]"
> > >>> ECHO: "ERROR REVERSAL (violet): Faces Reverse Across Edge at
> [[1.80419, -17.3535, 17.9945], [0.949081, -16.81, 18.2839]] indices: [3219,
> 3218]"
> > >>> ECHO: "ERROR REVERSAL (violet): Faces Reverse Across Edge at
> [[2.1411, -17.6335, 17.8396], [1.80419, -17.3535, 17.9945]] indices: [3220,
> 3219]"
> > >>> ECHO: "ERROR REVERSAL (violet): Faces Reverse Across Edge at
> [[2.4012, -17.281, 17.9945], [2.1411, -17.6335, 17.8396]] indices: [3221,
> 3220]"
> > >>> ECHO: "ERROR REVERSAL (violet): Faces Reverse Across Edge at
> [[3.10139, -16.5486, 18.2839], [2.4012, -17.281, 17.9945]] indices: [3222,
> 3221]"
> > >>>
> > >>> I am not sure why that render() call is there. It doesn't seem to
> do anything other than preventing the user from using preview and hiding
> errors. With render() removed, and thrown together enabled, the face
> reversal is obvious as seen below. So the conclusion is: the polyhedron
> has reversed faces, hence it is invalid.
> > >>>
> > >>>
> > >>> <image.png>
> > >>>
> > >>>
> > >>>
> > >>>
> > >>>
> > >>> On Sun, Jan 12, 2025 at 11:10 AM Raymond West via Discuss <
> discuss@lists.openscad.org> wrote:
> > >>> It would help if you posted an image of what you're trying to
> create,
> > >>> and possibly some code. I can't help if you are trying to use bos2l
> or
> > >>> you refer to github/elsewhere.
> > >>>
> > >>> I find in f5 render, a lot of my stuff breaks up. However, in
> manifold
> > >>> rendering f6, generally works. You can check, as Jordan hinted, by
> > >>> including a cube when you f6, do it as the object is evolved. If you
> get
> > >>> just a cube, then you know where you've screwed up.
> > >>>
> > >>> On 12/01/2025 08:08, Thomas Richter via Discuss wrote:
> > >>>> I create concave polyhedra of several thousand faces. For details
> about the purpose see
> https://lists.openscad.org/empathy/thread/LY26O7U4CLHPW3BGQIDLSAE6FRVVHEUG
> > >>>>
> > >>>> My question is not about building the shape, that's solved, but
> about a strange error I experience with certain input values. An example
> causing the error can be found on Github:
> > >>>>
> > >>>>
> https://github.com/trses/screw-nut-knobs/blob/boolean-glitch/analytical-solution.scad
> > >>>>
> > >>>> When I render the shape I get this error:
> > >>>>
> > >>>> WARNING: PolySet -> Manifold conversion failed: NotManifold
> > >>>> Trying to repair and reconstruct mesh..
> > >>>> ERROR: [manifold] Input mesh is not closed!
> > >>>> ERROR: [manifold] Surface_mesh -> Manifold conversion failed:
> NotManifold
> > >>>>
> > >>>> This happens in very rare situations (e. g.: ARMS = 13, 1.97 <=
> _armPitch <= 2.17, _q = 182, _q = 208 and ARMS = 17, 1.93 <= _armPitch <=
> 2.18, _q = 204). Since the values are similar I believe there is a
> geometrical reason but I have no idea how I could debug this and figure out
> the actual cause.
> > >>>>
> > >>>> If you comment out line 163 (subtract hollow sphere) it doesn't
> happen (though the shape will look strange then). The polyhedron itself is
> built correctly, I have checked it several times by hand.
> > >>>>
> > >>>> My platform is an Apple Silicon M3 CPU.
> > >>>>
> > >>>> I would like to know if others experience the same behavior (on
> other platforms) with the example provided and if so, what is the cause or
> at least what could I do to debug it. My impression is that it happens when
> the shape to subtract from is complex and very tiny faces are generated.
> Unfortunately, the error message is not very helpful.
> > >>>>
> > >>>> Is this an already known glitch?
> > >>>>
> > >>>> Second question related to this: In case this is a shortcoming of
> the rendering engine: Is there any chance to catch this error by means of
> the source code and handle it by, e. g., adjusting the _armPitch value?
> > >>>>
> > >>>> If this question is assumed to be spam, please let me know how I
> should have brought this problem up. I have already asked the question in
> one of the last messages of the other thread but it seems that it got lost
> there.
> > >>>> _______________________________________________
> > >>>> 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
> > >>> _______________________________________________
> > >>> 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
> > >> _______________________________________________
> > >> 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
> > _______________________________________________
> > 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
>
TR
Thomas Richter
Mon, Jan 13, 2025 5:54 AM
Of course, you are right. That was written when I still thought there is some problem with the difference since the error never showed up when building the same shape with the fully analytical solution. Furthermore the model parameters that make this error happen are quite unusual for the use case, so it wouldn't have been that hard, especially when building a configurator application that could have omitted those values.
Nonetheless, it's fixed now.
Am 13.01.2025 um 01:10 schrieb Adrian Mariano via Discuss discuss@lists.openscad.org:
You said that it's "not a problem...since [you] don't need the boolean operation". I should maybe point out also that just because you don't get an error when you have the polyhedron alone doesn't mean that things are OK. Your polyhedron is still invalid. It's just that OpenSCAD doesn't notice and it blithely writes out that invalid polyhedron as an STL file. So if you do this you have to hope that whatever is downstream in your processing chain is willing and able to take the invalid input and fix it or handle it the way you want. Personally I prefer to avoid generating invalid output.
The vnf_validate module is documented here:
https://github.com/BelfrySCAD/BOSL2/wiki/vnf.scad#module-vnf_validate
On Sun, Jan 12, 2025 at 6:58 PM Thomas Richter via Discuss discuss@lists.openscad.org wrote:
I will have a look at vnf_validate to learn more about my options in cases like this one.
Am 13.01.2025 um 00:44 schrieb Adrian Mariano via Discuss discuss@lists.openscad.org:
I was going to say I kicked off another run of vnf_validate() to check your polyhedron and got messages like this below (so edges that don't have a mate). This validation runs in OpenSCAD, though it's slow. It took 28 minutes on your polyhedron. But it sounds like you have solved the problem, which is great.
ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[2.19157, -18.0656, 7.62068], [2.19371, -18.0668, 7.61989]] indices: [2824, 2825]"
ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[2.19371, -18.0668, 7.61989], [2.19549, -18.0651, 7.62068]] indices: [2825, 2826]"
ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[2.19371, -18.0668, 7.61989], [2.63126, -17.4745, 7.88479]] indices: [2825, 2827]"
ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[2.19549, -18.0651, 7.62068], [2.63126, -17.4745, 7.88479]] indices: [2826, 2827]"
ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[9.61822, -14.8247, 7.88479], [10.336, -14.9778, 7.62068]] indices: [2835, 2836]"
ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[9.61822, -14.8247, 7.88479], [10.3385, -14.9779, 7.61989]] indices: [2835, 2837]"
ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[10.336, -14.9778, 7.62068], [10.3385, -14.9779, 7.61989]] indices: [2836, 2837]"
ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[10.3385, -14.9779, 7.61989], [10.3393, -14.9755, 7.62068]] indices: [2837, 2838]"
ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[10.3385, -14.9779, 7.61989], [10.4507, -14.2501, 7.88479]] indices: [2837, 2839]"
ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[10.3393, -14.9755, 7.62068], [10.4507, -14.2501, 7.88479]] indices: [2838, 2839]"
ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[15.4059, -8.65681, 7.88479], [16.1126, -8.45879, 7.62068]] indices: [2847, 2848]"
ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[15.4059, -8.65681, 7.88479], [16.1149, -8.45775, 7.61989]] indices: [2847, 2849]"
ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[16.1126, -8.45879, 7.62068], [16.1149, -8.45775, 7.61989]] indices: [2848, 2849]"
ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[16.1149, -8.45775, 7.61989], [16.1145, -8.45529, 7.62068]] indices: [2849, 2850]"
ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[16.1149, -8.45775, 7.61989], [15.876, -7.76117, 7.88479]] indices: [2849, 2851]"
ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[16.1145, -8.45529, 7.62068], [15.876, -7.76117, 7.88479]] indices: [2850, 2851]"
On Sun, Jan 12, 2025 at 6:38 PM Thomas Richter via Discuss discuss@lists.openscad.org wrote:
I had another idea and finally found it. It was indeed a problem with the polyhedron, a very rare edge case where two vertices of the same layer are very close and the number of vertices decreases in the next layer and the next vertex in the same layer is quite far away from the two other ones. I could only find it by analysing the generated faces with another script.
Thanks again for your help.
Am 12.01.2025 um 22:56 schrieb Thomas Richter tomselektropost@googlemail.com:
I give up. That's not a problem for my project since I don't need the boolean operation with the latest solution. I was just interested in the cause of the glitch.
There is absolutely no evidence that the polyhedron is invalid after fixing the face orientation issue you found. I have checked with meshlab, with a script I implemented by myself, as well as different slicers. Neither show any errors in the meshes that I can export from OpenSCAD nor in the object structures output with echo. The polyhedra are always created the same way in my code, no matter what model parameters I use. Thus it is very likely that the structure of the few polyhedra that cannot be rendered is also correct. Based on the tests with my own scripts it is.
I can create multiple polyhedra in the same scene. All points are unique by design but nonetheless, I have even checked that and found nothing.
The latest possibility I saw was in the (quite surprisingly unpredictable) way the polyhedron function handles faces with a large number of vertices that are not within one and the same plane. After replacing those with self-generated triangles, I have no further idea.
I never compare floating point values without considering possible precision issues.
The problem appears only for very few combinations of model parameters. My software engineering experience gives me a strong feeling towards floating point issues but I have no idea where they should come from.
Thank you all for your help.
Am 12.01.2025 um 20:29 schrieb Adrian Mariano via Discuss discuss@lists.openscad.org:
A polyhedron by itself never produces an error, even if it is invalid. If it fails when you union with a cube then that means your polyhedron is somehow invalid.
On Sun, Jan 12, 2025 at 1:49 PM Thomas Richter via Discuss discuss@lists.openscad.org wrote:
Thank you for this insight. I misunderstood the manual and oriented the side faces counterclockwise instead of clockwise. After fixing this the purple is all gone, the problem persists with boolean operations, goes away without boolean operations.
The render() was there because the misoriented side faces made the body appearing transparent. Unfortunately this didn't lead to any insight on my side :-(
I checked with a script that all points - copied from output with echo - are unique.
I have uploaded the version with the fixed faces:
https://github.com/trses/screw-nut-knobs/blob/boolean-glitch/analytical-solution.scad
I flushed the caches before every experiment and made the following observations when trying to render (not preview), see lines 167 - 179:
- difference with the polyhedron and a hollow sphere: problem persists
- union with the polyhedron and a cube someplace else: problem persists
- commenting out the difference / union rendering just the polyhedron: problem goes away.
What does this mean?
Am 12.01.2025 um 17:41 schrieb Adrian Mariano via Discuss discuss@lists.openscad.org:
He did post (a link to) the full code.
Actually I got fooled when I viewed the shape with "thrown together". He explicitly calls render() in his code, which bypasses the thrown-together process. I actually figured this out because the BOSL2 polyhedron validator produced a long list of errors like this:
ECHO: "ERROR REVERSAL (violet): Faces Reverse Across Edge at [[0.0319137, -16.3794, 18.4927], [-0.932485, -16.0686, 18.6187]] indices: [3217, 3216]"
ECHO: "ERROR REVERSAL (violet): Faces Reverse Across Edge at [[0.949081, -16.81, 18.2839], [0.0319137, -16.3794, 18.4927]] indices: [3218, 3217]"
ECHO: "ERROR REVERSAL (violet): Faces Reverse Across Edge at [[1.80419, -17.3535, 17.9945], [0.949081, -16.81, 18.2839]] indices: [3219, 3218]"
ECHO: "ERROR REVERSAL (violet): Faces Reverse Across Edge at [[2.1411, -17.6335, 17.8396], [1.80419, -17.3535, 17.9945]] indices: [3220, 3219]"
ECHO: "ERROR REVERSAL (violet): Faces Reverse Across Edge at [[2.4012, -17.281, 17.9945], [2.1411, -17.6335, 17.8396]] indices: [3221, 3220]"
ECHO: "ERROR REVERSAL (violet): Faces Reverse Across Edge at [[3.10139, -16.5486, 18.2839], [2.4012, -17.281, 17.9945]] indices: [3222, 3221]"
I am not sure why that render() call is there. It doesn't seem to do anything other than preventing the user from using preview and hiding errors. With render() removed, and thrown together enabled, the face reversal is obvious as seen below. So the conclusion is: the polyhedron has reversed faces, hence it is invalid.
<image.png>
On Sun, Jan 12, 2025 at 11:10 AM Raymond West via Discuss discuss@lists.openscad.org wrote:
It would help if you posted an image of what you're trying to create,
and possibly some code. I can't help if you are trying to use bos2l or
you refer to github/elsewhere.
I find in f5 render, a lot of my stuff breaks up. However, in manifold
rendering f6, generally works. You can check, as Jordan hinted, by
including a cube when you f6, do it as the object is evolved. If you get
just a cube, then you know where you've screwed up.
On 12/01/2025 08:08, Thomas Richter via Discuss wrote:
I create concave polyhedra of several thousand faces. For details about the purpose see https://lists.openscad.org/empathy/thread/LY26O7U4CLHPW3BGQIDLSAE6FRVVHEUG
My question is not about building the shape, that's solved, but about a strange error I experience with certain input values. An example causing the error can be found on Github:
https://github.com/trses/screw-nut-knobs/blob/boolean-glitch/analytical-solution.scad
When I render the shape I get this error:
WARNING: PolySet -> Manifold conversion failed: NotManifold
Trying to repair and reconstruct mesh..
ERROR: [manifold] Input mesh is not closed!
ERROR: [manifold] Surface_mesh -> Manifold conversion failed: NotManifold
This happens in very rare situations (e. g.: ARMS = 13, 1.97 <= _armPitch <= 2.17, _q = 182, _q = 208 and ARMS = 17, 1.93 <= _armPitch <= 2.18, _q = 204). Since the values are similar I believe there is a geometrical reason but I have no idea how I could debug this and figure out the actual cause.
If you comment out line 163 (subtract hollow sphere) it doesn't happen (though the shape will look strange then). The polyhedron itself is built correctly, I have checked it several times by hand.
My platform is an Apple Silicon M3 CPU.
I would like to know if others experience the same behavior (on other platforms) with the example provided and if so, what is the cause or at least what could I do to debug it. My impression is that it happens when the shape to subtract from is complex and very tiny faces are generated. Unfortunately, the error message is not very helpful.
Is this an already known glitch?
Second question related to this: In case this is a shortcoming of the rendering engine: Is there any chance to catch this error by means of the source code and handle it by, e. g., adjusting the _armPitch value?
If this question is assumed to be spam, please let me know how I should have brought this problem up. I have already asked the question in one of the last messages of the other thread but it seems that it got lost there.
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
Of course, you are right. That was written when I still thought there is some problem with the difference since the error never showed up when building the same shape with the fully analytical solution. Furthermore the model parameters that make this error happen are quite unusual for the use case, so it wouldn't have been that hard, especially when building a configurator application that could have omitted those values.
Nonetheless, it's fixed now.
> Am 13.01.2025 um 01:10 schrieb Adrian Mariano via Discuss <discuss@lists.openscad.org>:
>
> You said that it's "not a problem...since [you] don't need the boolean operation". I should maybe point out also that just because you don't get an error when you have the polyhedron alone doesn't mean that things are OK. Your polyhedron is still invalid. It's just that OpenSCAD doesn't notice and it blithely writes out that invalid polyhedron as an STL file. So if you do this you have to hope that whatever is downstream in your processing chain is willing and able to take the invalid input and fix it or handle it the way you want. Personally I prefer to avoid generating invalid output.
>
> The vnf_validate module is documented here:
> https://github.com/BelfrySCAD/BOSL2/wiki/vnf.scad#module-vnf_validate
>
> On Sun, Jan 12, 2025 at 6:58 PM Thomas Richter via Discuss <discuss@lists.openscad.org> wrote:
> I will have a look at vnf_validate to learn more about my options in cases like this one.
>
>
> > Am 13.01.2025 um 00:44 schrieb Adrian Mariano via Discuss <discuss@lists.openscad.org>:
> >
> > I was going to say I kicked off another run of vnf_validate() to check your polyhedron and got messages like this below (so edges that don't have a mate). This validation runs in OpenSCAD, though it's slow. It took 28 minutes on your polyhedron. But it sounds like you have solved the problem, which is great.
> >
> > ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[2.19157, -18.0656, 7.62068], [2.19371, -18.0668, 7.61989]] indices: [2824, 2825]"
> > ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[2.19371, -18.0668, 7.61989], [2.19549, -18.0651, 7.62068]] indices: [2825, 2826]"
> > ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[2.19371, -18.0668, 7.61989], [2.63126, -17.4745, 7.88479]] indices: [2825, 2827]"
> > ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[2.19549, -18.0651, 7.62068], [2.63126, -17.4745, 7.88479]] indices: [2826, 2827]"
> > ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[9.61822, -14.8247, 7.88479], [10.336, -14.9778, 7.62068]] indices: [2835, 2836]"
> > ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[9.61822, -14.8247, 7.88479], [10.3385, -14.9779, 7.61989]] indices: [2835, 2837]"
> > ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[10.336, -14.9778, 7.62068], [10.3385, -14.9779, 7.61989]] indices: [2836, 2837]"
> > ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[10.3385, -14.9779, 7.61989], [10.3393, -14.9755, 7.62068]] indices: [2837, 2838]"
> > ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[10.3385, -14.9779, 7.61989], [10.4507, -14.2501, 7.88479]] indices: [2837, 2839]"
> > ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[10.3393, -14.9755, 7.62068], [10.4507, -14.2501, 7.88479]] indices: [2838, 2839]"
> > ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[15.4059, -8.65681, 7.88479], [16.1126, -8.45879, 7.62068]] indices: [2847, 2848]"
> > ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[15.4059, -8.65681, 7.88479], [16.1149, -8.45775, 7.61989]] indices: [2847, 2849]"
> > ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[16.1126, -8.45879, 7.62068], [16.1149, -8.45775, 7.61989]] indices: [2848, 2849]"
> > ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[16.1149, -8.45775, 7.61989], [16.1145, -8.45529, 7.62068]] indices: [2849, 2850]"
> > ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[16.1149, -8.45775, 7.61989], [15.876, -7.76117, 7.88479]] indices: [2849, 2851]"
> > ECHO: "ERROR HOLE_EDGE (red): Edge bounds Hole at [[16.1145, -8.45529, 7.62068], [15.876, -7.76117, 7.88479]] indices: [2850, 2851]"
> >
> >
> >
> > On Sun, Jan 12, 2025 at 6:38 PM Thomas Richter via Discuss <discuss@lists.openscad.org> wrote:
> > I had another idea and finally found it. It was indeed a problem with the polyhedron, a very rare edge case where two vertices of the same layer are very close and the number of vertices decreases in the next layer and the next vertex in the same layer is quite far away from the two other ones. I could only find it by analysing the generated faces with another script.
> >
> > Thanks again for your help.
> >
> >
> > > Am 12.01.2025 um 22:56 schrieb Thomas Richter <tomselektropost@googlemail.com>:
> > >
> > > I give up. That's not a problem for my project since I don't need the boolean operation with the latest solution. I was just interested in the cause of the glitch.
> > >
> > > There is absolutely no evidence that the polyhedron is invalid after fixing the face orientation issue you found. I have checked with meshlab, with a script I implemented by myself, as well as different slicers. Neither show any errors in the meshes that I can export from OpenSCAD nor in the object structures output with echo. The polyhedra are always created the same way in my code, no matter what model parameters I use. Thus it is very likely that the structure of the few polyhedra that cannot be rendered is also correct. Based on the tests with my own scripts it is.
> > >
> > > I can create multiple polyhedra in the same scene. All points are unique by design but nonetheless, I have even checked that and found nothing.
> > >
> > > The latest possibility I saw was in the (quite surprisingly unpredictable) way the polyhedron function handles faces with a large number of vertices that are not within one and the same plane. After replacing those with self-generated triangles, I have no further idea.
> > >
> > > I never compare floating point values without considering possible precision issues.
> > >
> > > The problem appears only for very few combinations of model parameters. My software engineering experience gives me a strong feeling towards floating point issues but I have no idea where they should come from.
> > >
> > > Thank you all for your help.
> > >
> > >
> > >> Am 12.01.2025 um 20:29 schrieb Adrian Mariano via Discuss <discuss@lists.openscad.org>:
> > >>
> > >> A polyhedron by itself never produces an error, even if it is invalid. If it fails when you union with a cube then that means your polyhedron is somehow invalid.
> > >>
> > >> On Sun, Jan 12, 2025 at 1:49 PM Thomas Richter via Discuss <discuss@lists.openscad.org> wrote:
> > >> Thank you for this insight. I misunderstood the manual and oriented the side faces counterclockwise instead of clockwise. After fixing this the purple is all gone, the problem persists with boolean operations, goes away without boolean operations.
> > >>
> > >> The render() was there because the misoriented side faces made the body appearing transparent. Unfortunately this didn't lead to any insight on my side :-(
> > >>
> > >> I checked with a script that all points - copied from output with echo - are unique.
> > >>
> > >> I have uploaded the version with the fixed faces:
> > >>
> > >> https://github.com/trses/screw-nut-knobs/blob/boolean-glitch/analytical-solution.scad
> > >>
> > >> I flushed the caches before every experiment and made the following observations when trying to render (not preview), see lines 167 - 179:
> > >>
> > >> - difference with the polyhedron and a hollow sphere: problem persists
> > >> - union with the polyhedron and a cube someplace else: problem persists
> > >> - commenting out the difference / union rendering just the polyhedron: problem goes away.
> > >>
> > >> What does this mean?
> > >>
> > >>
> > >>> Am 12.01.2025 um 17:41 schrieb Adrian Mariano via Discuss <discuss@lists.openscad.org>:
> > >>>
> > >>> He did post (a link to) the full code.
> > >>>
> > >>> Actually I got fooled when I viewed the shape with "thrown together". He explicitly calls render() in his code, which bypasses the thrown-together process. I actually figured this out because the BOSL2 polyhedron validator produced a long list of errors like this:
> > >>>
> > >>> ECHO: "ERROR REVERSAL (violet): Faces Reverse Across Edge at [[0.0319137, -16.3794, 18.4927], [-0.932485, -16.0686, 18.6187]] indices: [3217, 3216]"
> > >>> ECHO: "ERROR REVERSAL (violet): Faces Reverse Across Edge at [[0.949081, -16.81, 18.2839], [0.0319137, -16.3794, 18.4927]] indices: [3218, 3217]"
> > >>> ECHO: "ERROR REVERSAL (violet): Faces Reverse Across Edge at [[1.80419, -17.3535, 17.9945], [0.949081, -16.81, 18.2839]] indices: [3219, 3218]"
> > >>> ECHO: "ERROR REVERSAL (violet): Faces Reverse Across Edge at [[2.1411, -17.6335, 17.8396], [1.80419, -17.3535, 17.9945]] indices: [3220, 3219]"
> > >>> ECHO: "ERROR REVERSAL (violet): Faces Reverse Across Edge at [[2.4012, -17.281, 17.9945], [2.1411, -17.6335, 17.8396]] indices: [3221, 3220]"
> > >>> ECHO: "ERROR REVERSAL (violet): Faces Reverse Across Edge at [[3.10139, -16.5486, 18.2839], [2.4012, -17.281, 17.9945]] indices: [3222, 3221]"
> > >>>
> > >>> I am not sure why that render() call is there. It doesn't seem to do anything other than preventing the user from using preview and hiding errors. With render() removed, and thrown together enabled, the face reversal is obvious as seen below. So the conclusion is: the polyhedron has reversed faces, hence it is invalid.
> > >>>
> > >>>
> > >>> <image.png>
> > >>>
> > >>>
> > >>>
> > >>>
> > >>>
> > >>> On Sun, Jan 12, 2025 at 11:10 AM Raymond West via Discuss <discuss@lists.openscad.org> wrote:
> > >>> It would help if you posted an image of what you're trying to create,
> > >>> and possibly some code. I can't help if you are trying to use bos2l or
> > >>> you refer to github/elsewhere.
> > >>>
> > >>> I find in f5 render, a lot of my stuff breaks up. However, in manifold
> > >>> rendering f6, generally works. You can check, as Jordan hinted, by
> > >>> including a cube when you f6, do it as the object is evolved. If you get
> > >>> just a cube, then you know where you've screwed up.
> > >>>
> > >>> On 12/01/2025 08:08, Thomas Richter via Discuss wrote:
> > >>>> I create concave polyhedra of several thousand faces. For details about the purpose see https://lists.openscad.org/empathy/thread/LY26O7U4CLHPW3BGQIDLSAE6FRVVHEUG
> > >>>>
> > >>>> My question is not about building the shape, that's solved, but about a strange error I experience with certain input values. An example causing the error can be found on Github:
> > >>>>
> > >>>> https://github.com/trses/screw-nut-knobs/blob/boolean-glitch/analytical-solution.scad
> > >>>>
> > >>>> When I render the shape I get this error:
> > >>>>
> > >>>> WARNING: PolySet -> Manifold conversion failed: NotManifold
> > >>>> Trying to repair and reconstruct mesh..
> > >>>> ERROR: [manifold] Input mesh is not closed!
> > >>>> ERROR: [manifold] Surface_mesh -> Manifold conversion failed: NotManifold
> > >>>>
> > >>>> This happens in very rare situations (e. g.: ARMS = 13, 1.97 <= _armPitch <= 2.17, _q = 182, _q = 208 and ARMS = 17, 1.93 <= _armPitch <= 2.18, _q = 204). Since the values are similar I believe there is a geometrical reason but I have no idea how I could debug this and figure out the actual cause.
> > >>>>
> > >>>> If you comment out line 163 (subtract hollow sphere) it doesn't happen (though the shape will look strange then). The polyhedron itself is built correctly, I have checked it several times by hand.
> > >>>>
> > >>>> My platform is an Apple Silicon M3 CPU.
> > >>>>
> > >>>> I would like to know if others experience the same behavior (on other platforms) with the example provided and if so, what is the cause or at least what could I do to debug it. My impression is that it happens when the shape to subtract from is complex and very tiny faces are generated. Unfortunately, the error message is not very helpful.
> > >>>>
> > >>>> Is this an already known glitch?
> > >>>>
> > >>>> Second question related to this: In case this is a shortcoming of the rendering engine: Is there any chance to catch this error by means of the source code and handle it by, e. g., adjusting the _armPitch value?
> > >>>>
> > >>>> If this question is assumed to be spam, please let me know how I should have brought this problem up. I have already asked the question in one of the last messages of the other thread but it seems that it got lost there.
> > >>>> _______________________________________________
> > >>>> 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
> > >>> _______________________________________________
> > >>> 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
> > >> _______________________________________________
> > >> 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
> > _______________________________________________
> > 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
> _______________________________________________
> OpenSCAD mailing list
> To unsubscribe send an email to discuss-leave@lists.openscad.org
RW
Raymond West
Mon, Jan 13, 2025 5:19 PM
the following may help -
module badprism(){
polyhedron(
points=[ [10,10,0],[10,-10,0],[-10,-10,0],[-10,10,0], // the four
points at base
[0,0,10] ], // the apex point
faces=[ [0,1,4],[1,2,4],[2,3,4],[3,0,4], // each
triangle side
[2,1,3] ] //should be two
triangles for square base
);
}
badprism();
//translate([25,0,0]) badprism();
//translate([40,0,0]) cube(10);
/////////////////////////
As it is, badprism() on its own, will f6 render, and allow it to be
exported as an stl, uncomment the last two lines, and it will f5 render,
and then it can appear to f6 render, (the completion 'gong' sounds in my
case, but you get warning messages). However, when you try to save it as
an stl, or move the cursor in the view screen, it disappears.
On 12/01/2025 19:16, Raymond West via Discuss wrote:
On 12/01/2025 18:48, Thomas Richter via Discuss wrote:
difference with the polyhedron and a hollow sphere: problem persists
- union with the polyhedron and a cube someplace else: problem persists
- commenting out the difference / union rendering just the
polyhedron: problem goes away.
Create another copy of your 'working' polyhedra, so you have two on
the screen. You will probably get none! If you are 3d printing, the
slicer may say it is not watertight. If you understand MeshLab, that
may help - it's useful for reducing the number of facets. However,
there is a problem still with the polyhedra you have created, in that
case, (In language I understand ), it does not know which points
should connect to others, in union or difference. If it is that sort
of scalloped knob you are concerned with, look at it to build it from
shapes you know work, at the simplest level (even then you can get
problems) so, build stuff from squares/circles, mostly extrude works,
as does rotate, translate and scale, the basic stuff. No need to use
bosl2, whatever. Minkowski is slow, but render at $fn=50, say, to see
if it is OK, then go for 150, or 100.
However, it is possible to fail in trying to difference two cylinders
at slight angles, But don't ask me to replicate it sod's law is
paramount..
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
the following may help -
module badprism(){
polyhedron(
points=[ [10,10,0],[10,-10,0],[-10,-10,0],[-10,10,0], // the four
points at base
[0,0,10] ], // the apex point
faces=[ [0,1,4],[1,2,4],[2,3,4],[3,0,4], // each
triangle side
[2,1,3] ] //should be two
triangles for square base
);
}
badprism();
//translate([25,0,0]) badprism();
//translate([40,0,0]) cube(10);
/////////////////////////
As it is, badprism() on its own, will f6 render, and allow it to be
exported as an stl, uncomment the last two lines, and it will f5 render,
and then it can appear to f6 render, (the completion 'gong' sounds in my
case, but you get warning messages). However, when you try to save it as
an stl, or move the cursor in the view screen, it disappears.
On 12/01/2025 19:16, Raymond West via Discuss wrote:
>
> On 12/01/2025 18:48, Thomas Richter via Discuss wrote:
>> difference with the polyhedron and a hollow sphere: problem persists
>> - union with the polyhedron and a cube someplace else: problem persists
>> - commenting out the difference / union rendering just the
>> polyhedron: problem goes away.
>
> Create another copy of your 'working' polyhedra, so you have two on
> the screen. You will probably get none! If you are 3d printing, the
> slicer may say it is not watertight. If you understand MeshLab, that
> may help - it's useful for reducing the number of facets. However,
> there is a problem still with the polyhedra you have created, in that
> case, (In language I understand ), it does not know which points
> should connect to others, in union or difference. If it is that sort
> of scalloped knob you are concerned with, look at it to build it from
> shapes you know work, at the simplest level (even then you can get
> problems) so, build stuff from squares/circles, mostly extrude works,
> as does rotate, translate and scale, the basic stuff. No need to use
> bosl2, whatever. Minkowski is slow, but render at $fn=50, say, to see
> if it is OK, then go for 150, or 100.
>
> However, it is possible to fail in trying to difference two cylinders
> at slight angles, But don't ask me to replicate it sod's law is
> paramount..
> _______________________________________________
> OpenSCAD mailing list
> To unsubscribe send an email to discuss-leave@lists.openscad.org