New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BooleanOperation 'union' results in overlapping triangles which is an error #50
Comments
Note that this is only a problem for compatibility with other programs such as 3D printer slicers, or exporting to other editors. If you want to limit the usefulness of JSModeler only to visual displays in the browser then this is not an issue. It seems to me like the BSP algorithm is fundamentally flawed and a re-write will be required. (I think issue 2 is the most important).
Suggested algorithm: just a random comment: |
Thank you for the report. I know about the limitations of the BSP tree algorithm. It's in an experimental stage, and sometimes it fails, because it can create really small triangles and even overlapping ones. |
After performing a BooleanOperation "union" on 2 cubes, the resulting stl file is not correct, which results in overlapping triangles errors.
Overlapping triangles can cause other code to behave oddly. In particular slicer programs if the stl output is sent to a 3d printer. Different slicers respond to this error differently.
In the attached jpg, the blue arrows are pointing at triangles that have at least 1 side that has another vertex superimposed on top of the line, but not on a vertex.
To make these correct the indicated triangles need to be replaced with 2 triangles where the extra line is from the overlapping vertex to the vertex opposite it on the labelled big triangle.
I added the dashed line to show what is required.
I believe the fix has to be in csg.js in the function JSM.BooleanOperation
although possibly it needs to be fixed in JSM.ClipPolygonWithBSPTree
but I do not understand this code enough to suggest a solution.
The text was updated successfully, but these errors were encountered: