Skip to main content
Raycast your scene with Three.js as usual. Then pass the hit to OpenGeometry.resolveHit:
resolveHit returns { ogId, shapeRevision, faceId?, edgeId? }, or undefined when the hit is not on a body.
  • faceId is set for a hit on the surface. Find the face with body.getBrep().topology.faces.
  • edgeId is set for a hit on the outline.
  • shapeRevision tells you which revision of the shape was hit. After an edit, the ids can refer to other faces.

Outlines

A raycast hits a body’s outline only when pickOutline is on. It is on for wires and off for sheets and solids. Turn it on with body.setAppearance({ pickOutline: true }). Set raycaster.params.Line.threshold to the pick width that you want.

Copies of the display

body.clone() makes a display copy for Three.js only. It is not a body, so resolveHit returns undefined for a hit on it. Call its dispose() when you take it out of the scene.
Last modified on November 10, 2026