Skip to content

Strokes show extra lines #72

Description

@miao-liu

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)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions