Skip to content

PlaneLike

PlaneLike = [number, number, number, number] | Plane | [Point3Like, Vector3Like]

Any value that can be interpreted as a plane.

Many API methods accept a PlaneLike so you can pass whichever representation is most convenient:

  • [a, b, c, d] — the four coefficients of the plane equation ax + by + cz + d = 0
  • [point, normal] — a point on the plane and its normal vector (each as a Point3Like / Vector3Like)
  • A Plane instance directly
let { Plane } = SketchUpApi;
// From coefficients (ground plane, z = 0)
let p1 = Plane.fromPlaneLike([0, 0, 1, 0]);
console.log(p1.normal.toArray());
// => [0, 0, 1]
// From point + normal
let p2 = Plane.fromPlaneLike(
[[0, 0, 5], [0, 0, 1]]
);
console.log(p2.d);
// => -5 (plane at z = 5)