Open AliceDreaming opened 7 years ago
Yes, I know about this behavior. This is how boolean operations work. The object is cutted with all the polygon planes of the other object. I have a plan in my mind to merge the connecting faces, but I haven't found a fast solution yet.
I have searched the github a bit and found that the JSClipper can do the polygon union. Here is the github repository. https://github.com/Delapouite/JsClipper I played with their demo for a while to union two rectangles. Sounds like the result is as expected. Do you think this library can help us to the polygon union? http://delapouite.github.io/JsClipper/demo.html PS: I found the demos only have x and y coordinates, no z coordinates. Sounds like we need to convert betweeb 2D and 3D coordinates.
Yes, it could work, but wouldn't be very efficient to convert 3D polygons to 2D polygons, calculate the union, then convert back to 3D and connect to the original vertices. There can be a lot of polygons if you calculate the difference with a sphere: http://jsfiddle.net/8xcjv6m9/1/
I think the correct solution should work based on the information calculated during the boolean operation (we know the original polygon index for every new polygon). I will investigate the possibilities.
So you mean that the polygons should be merged based on their original polygons? I got from the code that the polygon only remembers the index of its immediate ancestor. Sounds like after a few boolean operation, the merge will become difficult.
I think it should be done after every operation separately, so the next operation will run on the merged model. I see no problem with chained operations is the merge happens after each operation.
I am doing a "Differnce" boolean operation with two cubes. Each has 6 faces(polygons). After the boolean, I found some faces has more than one polygons on them. It looks like a single face has been cut into serveral pieces after the boolean. Do you have plan to merge the polygons after the boolean?