Skip to content

FacePointClassification

Describes where a 3D point sits relative to a face.

When you call face.classifyPoint(point), SketchUp tests whether the point is inside the face boundary, on one of its edges, on a vertex, completely outside, or not even on the face’s plane. The returned enum value tells you exactly which case applies — useful for hit-testing, snapping logic, or validating that a point lies on a surface before projecting.

let model = await SketchUpApi.getActiveModel();
let Classification =
SketchUpApi.FacePointClassification;
// Create a 100x100 face on the ground plane
await model.performOperation(async op => {
op.createFace(model, [
[0, 0, 0], [100, 0, 0],
[100, 100, 0], [0, 100, 0]
]);
}, 'Create face');
let faces = await model.entities.get(
{ filterBy: { types: ['Face'] } }
);
let face = faces[0];
let inside = face.classifyPoint([50, 50, 0]);
console.log(inside === Classification.PointInside);
// => true
let above = face.classifyPoint([50, 50, 10]);
console.log(above === Classification.PointNotOnPlane);
// => true
let outside = face.classifyPoint([200, 200, 0]);
console.log(outside === Classification.PointOutside);
// => true

Face.classifyPoint

SDK 2.25.0

PointInside: 1

The point is inside the face boundary.


PointNotOnPlane: 32

The point is not on the face’s plane at all.


PointOnEdge: 4

The point lies on one of the face’s edges.


PointOnVertex: 2

The point coincides with one of the face’s vertices.


PointOutside: 16

The point is on the face’s plane but outside its boundary.


PointUnknown: 0

Classification could not be determined.