zalo / CascadeStudio

A Full Live-Scripted CAD Kernel in the Browser
https://zalo.github.io/CascadeStudio/
MIT License
998 stars 122 forks source link

Union of similar size shapes causes ReferenceError: ___cxa_is_pointer_type is not defined #134

Open ArenM opened 2 years ago

ArenM commented 2 years ago

Sometimes when performing operations on similar size shapes, such as Union, or Difference ReferenceError: ___cxa_is_pointer_type is not defined is produced.

This is the simplest example of this I've found:

Union([
    Cylinder(2.5, 15),
    Box(5, 4.9, 10, true)
])
raydeleu commented 2 years ago

Booleans with shapes that have the same dimensions and hence aligned intersections are difficult for any 3d kernel. If we look at the open source 3d kernels they all struggle with this issue and even in the high end commercial 3d kernels you might encounter issues. The easiest solution is to tweak the input parameters to make the boolean work, for example increase the size of your box slightly. In your example it can make the difference between having an intersection between the cylinder and the box that is just a circle on top of the face or having a difficult intersection that splits the box into 4 separate parts. You would say that for a Union this makes no difference, but determining the intersection between shapes is generally what makes the booleans work.