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

Strokes show extra lines #72

Open
miao-liu opened this issue Jul 10, 2022 · 0 comments
Open

Strokes show extra lines #72

miao-liu opened this issue Jul 10, 2022 · 0 comments

Comments

@miao-liu
Copy link

hi,I want to ask a question.
When I stroke the mesh obtained after the operation, it shows the lines I don't want, how should I combine csg to solve this problem.
Screen Shot 2022-07-10 at 7 37 58 PM

  const material = new MeshBasicMaterial( {color: 0x00ff00} );
  const box = new Mesh(new BoxBufferGeometry(1, 1, 0.1), material);
  box.position.set(0, 0, 0);

  const hole = new Mesh(new BoxBufferGeometry(0.2, 0.2, 1), material);
  hole.position.set(0.1, 0.1, 0);
  

  const csg = new CSG();

  csg.subtract([box, hole]);

  const resultMesh = csg.toMesh();


  const edges = new EdgesGeometry(resultMesh.geometry, 45);
  const wideEdges = new LineSegmentsGeometry().fromEdgesGeometry(edges);
  const mt = new LineMaterial({
    color: 0xff0000,
    linewidth: 2
  });
  mt.resolution.set(window.innerWidth, window.innerHeight);
  const line = new LineSegments2(wideEdges, mt);

  scene.add(line)
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

1 participant