Hello !

Is it possible to have a method to know if a plane intersect a mesh without having to create a plane mesh ?

Something like:


Instead of:

const planeMesh = MeshBuilder.CreatePlane(
  { height: 10000, sourcePlane: plane, width: 10000 },
planeMesh.onAfterRenderObservable.addOnce(() => {
  const result = myMesh.intersectsMesh(planeMesh, true)

Thank you :wink:

Maybe instead of a plane mesh you can create a mathematical plane and use signedDistanceTo(), to design your own intersectsMesh:

Here to follow intersectsMesh of BabylonJS:

Edit: Another idea could be:

const min = Vector3(1,1,2); // minimum boundingbox of your plane
const max = ...
mesh.getBoundingInfo().boundingBox.intersectsMinMax(min, max);
1 Like

I finally found how to make it, for those who need it too:

import { Plane, Mesh, BoundingBox } from '@babylonjs/core'

// From:
export const doesPlanIntersectBbox = (plane: Plane, bbox: BoundingBox): boolean => {
  const e = bbox.maximum.subtract(
  const r = e.x * Math.abs(plane.normal.x) + e.y * Math.abs(plane.normal.y) + e.z * Math.abs(plane.normal.z)
  const s = plane.signedDistanceTo(
  return Math.abs(s) <= r

export const doesPlanIntersectMesh = (plane: Plane, mesh: Mesh): boolean =>
  doesPlanIntersectBbox(plane, mesh.getBoundingInfo().boundingBox)

export default { doesPlanIntersectBbox, doesPlanIntersectMesh }