Skip to main content

Volume and area

body.measure({ deflection? }) returns { volume, area, errorBound, areaErrorBound, deflection }, in the body’s own coordinates. A scale in the placement is not applied.
The values are approximate, with a stated bound:
  • |volume − exact| ≤ errorBound.
  • |area − exact| ≤ areaErrorBound.
  • A body with only flat faces measures exactly, within 1e-10 of its size.
  • A smaller deflection gives a smaller bound and a slower call. The default is 0.01.
  • A bound is Infinity when a triangle is too coarse to bound. JSON.stringify writes it as null.
A deflection that is not a positive finite number throws InvalidParameter. A mesh of more than 2 000 000 triangles throws LimitExceeded. The call does not change the document.

Validity

body.validity() returns { valid, closed, bodyType }, and error: { code, message } when the body is not valid.
A valid closed solid gives { valid: true, closed: true, bodyType: 'Solid' }. closed is true when every shell of a sheet or a solid is closed, and when every wire of a wire body is closed.

Point classification

body.classifyPoint([x, y, z]) says where a point is, in the body’s own coordinates: 'Inside', 'Outside', 'Boundary' or 'Unknown'.
  • A point within 1e-8 of the surface is 'Boundary'.
  • A body is 'Inside' if any of its solids holds the point.
  • A wire or a sheet throws InvalidOperand.
  • Known limit: on a cylinder, cone or frustum that was mirrored, a point outside the body can read 'Inside'.
  • For a world point, first call OpenGeometry.flush(), then body.worldToLocal(new THREE.Vector3(x, y, z)).

Other queries

To turn a normal into the world, call OpenGeometry.flush(), then use new THREE.Vector3(...normal).transformDirection(body.matrixWorld).
Last modified on November 10, 2026