Too perfect parents? (for a boolean...)

Developers
Pete
2016-09-05
2016-10-02
  • Pete

    Pete - 2016-09-05

    Hi!

    A while ago I made a rather 'serious' boolean object with over 40 individual boolean operations in it. It seemed to work perfectly except for a couple of short lived glitches with rendering and the export to .stl was flawless.

    So this finding of the last couple of days was somewhat unexpected to me:

    When I make an hour glass kind of a thing by subtracting the inner volume from the outer one, the process fails for a strange reason: When I make the parents of the boolean with 'engineering precision' -- that is to say edit the original forms (curves) numerically to perfection -- the boolean sees the objects as if they were the same size. Only a few surface triangles appear as double layered. Still, when I open the booelan in the boolean editor, I see two objects in their correct sizes.

    For comparison I 'freehanded' another one. That one works as expected. Then I tried to produce inaccuracy to the engineered boolean by editing the inner part of it, but that made no difference. To me this would seem to suggest that something goes wrong in some of the very first steps of creating the boolean mesh, when the parents are 'too perfect', and the boolean will not recover from that.

    I have not looked at the code of the boolean, but I would have expected this case to be easy as the surfaces never intersect.

    An example file attached.

    BR

    -P-

     
    Last edit: Pete 2016-09-05
  • Pete

    Pete - 2016-09-06

    So, the parents were too perfect....The boolean creator does not like absolutely coplanar triangles.... Small modifications to make sure there wouldn't be any and the thing works.

     
  • Luke S

    Luke S - 2016-09-24

    Finally got a bit of a look at this, and it is odd...

    The triangles that you refer to are not really coplanar, which would legitimately cause issues. they look, however, like they are lying in parallel planes. Not sure what to make of that.

     
    Last edit: Luke S 2016-09-24
  • Pete

    Pete - 2016-09-28

    Yes, I did not look closely enough at first. What happens is that only a few triangles of the inner surface are displayed. If the original lathed curves are made with precision high enough they are parallel to thr corresponding triangle on the outer surface.

    I managed to modify one boolean so that the inner surface is diplayed in whole but then I tried to repeat the process on a different computer I did not get that to happen though I tried a few different things. (Stretching the mesh, rotating, tilting....)

    I also had a quick look at the code but there seems to be quite a bit of it and it'd require a pretty thorough stydy of me to understand how it works...

     
  • Luke S

    Luke S - 2016-09-29

    Yes, the Boolean code is rather long. It is also not well commented. Studying it to modify or improve would be a fairly large project, I think.

     
  • Peter Eastman

    Peter Eastman - 2016-09-29

    It's also just a really complicated algorithm with tons of special cases for particular situations.

     
  • Pete

    Pete - 2016-10-01

    That makes me think, that it must be one of the special cases that has some minor glitch...

    I tried to create a more simple test case. I couldn't reproduce the bug by cylinders or spheres. It took lathed spline meshes. So far it seems, that if the parents of the boolean were (in this case) in 0,0,0 orientation, the inner surface was diplayed, but if I just tilted them both 0.5 degrees around Z, then the inner surface disappeared.

    Interestingly, when I (accidentally at first) stretched one of the booleans, the inner surface started to disappear, reappear and redisappear in sequences ....

    I guess the next thing would be to try to create a test case with only a few triangles in rendering and then have the CSGModeller write to System.out, what parts of it are used in each case and then what happens, where ever the differences between the displayed or omitted inner surface is decided...

    Pffwephhh...

    EDIT: I was not expecting that a boolean could be stretched, but a boolean of two lathed meshes seems to react to stretching somehow. What exactly happens, does not always make too much sense but it seems to depend on the Interactive Surface Error.

     
    Last edit: Pete 2016-10-01
  • Luke S

    Luke S - 2016-10-02

    That does make some sense. The boolean object actually operates on a detailed mesh version of each component object.

    If you change the interactive surface error, you change the detailed structure of those meshes, so whatever quirks come up will appear in different locations.

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks