Skip to content
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

Holes after CSG subtract operation #21

Open
isaachadad opened this issue Sep 2, 2015 · 2 comments
Open

Holes after CSG subtract operation #21

isaachadad opened this issue Sep 2, 2015 · 2 comments

Comments

@isaachadad
Copy link

I have been using CSG for geometry manipulation and it's awesome.
However, it seems there is a problem with the polygon splitting and there are missing/wrong polygons.
I have checked it with latest threeCSG.js and three.js
Also used all previously mentioned suggestions including changing EPSILON.
I have checked it with netfabb.
Here's the original and the fixed geometry pictures:

csg_problem
csg_fixed

Here is a very simple code:
var boxG = new THREE.BoxGeometry(100, 100, 100, 1, 1, 1);
boxG.verticesNeedUpdate = true;
boxG.computeVertexNormals();
boxG.computeFaceNormals();
boxG.normalsNeedUpdate = true;
var holeG = new THREE.BoxGeometry(50, 50, 50, 1, 1, 1);
var holeM = new THREE.Mesh(holeG);
holeM.position.z = 50;
var holeG = new THREE.Geometry();
THREE.GeometryUtils.merge(holeG, holeM);
holeG.verticesNeedUpdate = true;
holeG.computeVertexNormals();
holeG.computeFaceNormals();
holeG.normalsNeedUpdate = true;
var boxBsp = new ThreeBSP(boxG);
var holeBsp = new ThreeBSP(holeG);
boxBsp = boxBsp.subtract(holeBsp);
var boxG = boxBsp.toGeometry();

Is this familiar and planed to be fixed?

@isaachadad
Copy link
Author

As you can see there are vertices that belong to one plane but not to another, which is regarded as holes and cannot be 3D printed (without fixing tools).
Can you please confirm if the problem is in the original CSG algorithm or the porting to three.js?
Thanks.

@schlaegerz
Copy link

I am having a similar problem, with a union on different set of models (a complex 2d drawing extruded up plus a box)

Did you ever find a solution to this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants