gumyr/build123d

Basic operation results in invalid geometry

Opened this issue · 5 comments

p = Box(2,2,2) - Pos(-1.5) * Sphere(1)
Screenshot

This is an OCCT problem with how the Edge of the sphere is aligned. Consider this version:

s = Pos(-1.5) * Sphere(1).rotate(Axis.Y, 180)
p = Box(2, 2, 2) - s

image
Note how the Edge of the sphere is rotated away from the cube which allows the boolean operation to work as expected.

I've considered constructing a sphere from two hemispheres but an clean operation would fuse them together again which doesn't solve the problem. This really needs to be fixed at the OCCT level.

Another issue from this scenario: This creates valid geometry but the exported STEP file gives the union rather than subtraction.

p = Box(2,2,2) - Pos(0.7) * Sphere(0.7)
Screenshot Screenshot

I'm guessing the OCCT requires all Solids to have at least one Edge but it breaks so many things. I expect fixing it in OCCT would be difficult but I don't know.

OCCT fundamentally requires surfaces to be closed in their parametric space. Removing that requirement in OCCT would be a monumental effort, however, the geometries here should be able to comply within that limitation.

I believe it should be possible (it only needs to be closed in the 2d parametric space of the surface and you can create a circle with a single vertex and edge, so I imagine a clipped sphere shell is topologically equivalent) to create a parametrically closed sphere like the one below without any seams on the spherical surface but I have been unsuccessful so far. It would be useful in many scenarios to circumvent the seam issue.

Screenshot