Face
A flat surface bounded by edges, the fundamental geometry for 3D modeling.
Faces are what make SketchUp models appear solid — they define the surfaces that the user sees and paints. Every face has an outer boundary loop of edges and may contain inner loops (holes). Faces also have a normal vector that determines which side is “front” vs. “back” — materials can be applied separately to each side.
You’ll encounter faces when querying geometry, measuring areas, or applying materials. Faces can also have components or images glued to them.
Example
Section titled “Example”let model = await SketchUpApi.getActiveModel();
// Create a rectangular face.await model.performOperation(op => { op.createFace(model, [ [0, 0, 0], [100, 0, 0], [100, 100, 0], [0, 100, 0], ]);}, 'Create rectangle');
// Query it back and inspect its properties.let faces = await model.entities.get({ filterBy: { types: ['Face'] }});let face = faces[0];
console.log(face.normal.toArray());// => [0, 0, -1]console.log(face.area());// => 10000 (100 * 100 square inches)console.log(face.edges.length);// => 4console.log(face.outerLoop.length);// => 4Extends
Section titled “Extends”BaseDrawingElement
Properties
Section titled “Properties”attributes
Section titled “attributes”
readonlyattributes:Attributes
The attribute dictionaries attached to this element. Attributes store custom key-value metadata that extensions can read and write.
Inherited from
Section titled “Inherited from”BaseDrawingElement.attributes
backMaterialRef
Section titled “backMaterialRef”
readonlybackMaterialRef:MaterialRef|undefined
A reference to the material applied to the back side of this face, if any. Call Model.findEntity with this ref to fetch the full material object.
backTextureInfo
Section titled “backTextureInfo”
readonlybackTextureInfo: {positioned:boolean;projection:Vector3d|undefined; } |undefined
Texture projection information for the back material. Includes the projection vector and whether the texture has been positioned by the user. Undefined if no textured material is applied to the back.
castsShadows
Section titled “castsShadows”
readonlycastsShadows:boolean
Whether this element casts shadows onto other geometry.
Inherited from
Section titled “Inherited from”BaseDrawingElement.castsShadows
frontTextureInfo
Section titled “frontTextureInfo”
readonlyfrontTextureInfo: {positioned:boolean;projection:Vector3d|undefined; } |undefined
Texture projection information for the front material. Includes the projection vector and whether the texture has been positioned by the user. Undefined if no textured material is applied to the front.
gluedInstanceCount
Section titled “gluedInstanceCount”
readonlygluedInstanceCount:number
How many component instances are glued to this face (e.g.
windows or doors that cut openings). When greater than zero,
the local area() method may overestimate because it doesn’t
subtract the cut openings — use getArea() instead for the
true visible area.
SDK 2.25.0
hidden
Section titled “hidden”
readonlyhidden:boolean
Whether this element is hidden. Hidden elements don’t appear in the viewport unless the user enables “View > Hidden Geometry.”
Inherited from
Section titled “Inherited from”BaseDrawingElement.hidden
readonlyholes: readonly readonlyEdgeUse[][]
Inner loops cut out from this face. Each hole is a closed loop of EdgeUse objects representing edges that bound a void.
readonlyid:number
The persistent ID that uniquely identifies this face.
materialRef
Section titled “materialRef”
readonlymaterialRef:MaterialRef|undefined
A reference to the material applied to this element, if any. Call
getMaterial() to fetch the full Material object with color and texture data.
Inherited from
Section titled “Inherited from”BaseDrawingElement.materialRef
outerLoop
Section titled “outerLoop”
readonlyouterLoop: readonlyEdgeUse[]
The boundary edges of this face, ordered counterclockwise when viewed from the front. Each EdgeUse indicates whether the edge is traversed forward or reversed.
receivesShadows
Section titled “receivesShadows”
readonlyreceivesShadows:boolean
Whether this element receives shadows cast by other geometry.
Inherited from
Section titled “Inherited from”BaseDrawingElement.receivesShadows
tagRef
Section titled “tagRef”
readonlytagRef:TagRef|undefined
A reference to the tag (formerly “layer”) assigned to this element. Call
getTag() to fetch the full Tag object.
Inherited from
Section titled “Inherited from”BaseDrawingElement.tagRef
readonlytype:Face=EntityType.Face
Accessors
Section titled “Accessors”boundingBox
Section titled “boundingBox”Get Signature
Section titled “Get Signature”get boundingBox():
BoundingBox
The axis-aligned bounding box enclosing this face’s outer loop vertices — useful for quick overlap checks.
SDK 2.25.0
Returns
Section titled “Returns”closedVertexLoops
Section titled “closedVertexLoops”Get Signature
Section titled “Get Signature”get closedVertexLoops():
Vertex[][]
The vertices of this face organized into closed loops. The first loop is the outer boundary, followed by any holes. Each loop’s last vertex matches its first vertex to form a closed polygon.
Returns
Section titled “Returns”Vertex[][]
Get Signature
Section titled “Get Signature”get edges():
Edge[]
All edges bounding this face, including both the outer loop and any holes. The edges are in the order they appear in the loops.
Returns
Section titled “Returns”Edge[]
normal
Section titled “normal”Get Signature
Section titled “Get Signature”get normal():
Vector3d
A unit vector pointing outward from the front side of this face. Use it to determine which way the surface is facing.
SDK 2.25.0
Returns
Section titled “Returns”Get Signature
Section titled “Get Signature”get plane():
Plane
The infinite plane this face lies on, computed from the
outer loop vertices. Use plane.normal for the face
direction or plane.distance(point) to measure how far a
point is from the surface.
SDK 2.25.0
Returns
Section titled “Returns”sketchupId
Section titled “sketchupId”Get Signature
Section titled “Get Signature”get sketchupId():
SketchupId
JS API identifier for this face. Pass it to API methods that accept a sketchupId.
Returns
Section titled “Returns”Overrides
Section titled “Overrides”BaseDrawingElement.sketchupId
typeName
Section titled “typeName”Get Signature
Section titled “Get Signature”get typeName():
string
Returns a named variant of the type field.
SDK 2.35.0
Returns
Section titled “Returns”string
Methods
Section titled “Methods”area()
Section titled “area()”area(
transformLike?):number
Calculates the face area in square inches from the local
geometry snapshot. Does not subtract cut openings from glued
instances — if gluedInstanceCount > 0, use
getArea instead for the true visible area.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
|
|
optional transformation to apply |
Returns
Section titled “Returns”number
area in square inches
SDK 2.25.0
classifyPoint()
Section titled “classifyPoint()”classifyPoint(
point):FacePointClassification
Classifies where a point lies relative to this face — on the plane, inside the boundary, on an edge, at a vertex, or outside. Useful for hit testing, proximity checks, or determining if a point is within a face’s bounds.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
|
|
The 3D point to classify. |
Returns
Section titled “Returns”A classification enum indicating the point’s relationship to the face.
SDK 2.25.0
coplanarWith()
Section titled “coplanarWith()”coplanarWith(
other):boolean
Checks whether another face lies in the same plane as this one. Coplanar faces share the same infinite plane even if they don’t overlap. Useful for detecting faces that could be merged or for analyzing geometry alignment.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
|
|
|
The face to compare against. |
Returns
Section titled “Returns”boolean
True if both faces lie in the same plane.
SDK 2.25.0
getAllConnected()
Section titled “getAllConnected()”getAllConnected<
Filter>(options?):Promise<EntityTypeForFilter<Filter,DrawingElement>[]>
Traverses the edge graph to find all geometry topologically connected to this face through shared edges — like flood-filling across the mesh. Returns faces, edges, and other drawing elements in the connected component (includes this face itself). Optionally filter by entity type.
Type Parameters
Section titled “Type Parameters”| Type Parameter |
|---|
|
|
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
|
|
|
optional entity type filter |
Returns
Section titled “Returns”Promise<EntityTypeForFilter<Filter, DrawingElement>[]>
SDK 2.25.0 Protocol 1.22.0
getArea()
Section titled “getArea()”getArea(
transformLike?):Promise<number>
Fetches the area of this face from SketchUp, accounting for glued instances that cut openings (like windows or doors). Unlike area, which calculates from the geometry snapshot, this queries SketchUp for the rendered area including all cut-opening effects.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
|
|
Optional transformation to apply before measuring. |
Returns
Section titled “Returns”Promise<number>
The area in square inches.
SDK 2.25.0 Protocol 1.22.0
getBounds()
Section titled “getBounds()”getBounds():
Promise<BoundingBox>
Fetches the axis-aligned bounding box for this element from SketchUp.
Returns
Section titled “Returns”Promise<BoundingBox>
Example
Section titled “Example”let model = await SketchUpApi.getActiveModel();let all = await model.entities.get();let element = all[0];let box = await element.getBounds();console.log(box.min.x, box.min.y, box.min.z);console.log(box.max.x, box.max.y, box.max.z);SDK 2.30.0
Inherited from
Section titled “Inherited from”BaseDrawingElement.getBounds
getGluedInstances()
Section titled “getGluedInstances()”getGluedInstances<
Filter>(options?):Promise<EntityTypeForFilter<Filter,CanBeGlued>[]>
Fetches component instances, groups, and images that are glued (attached) to this face’s surface. Glued instances move and rotate with the face — common for windows glued to walls or decals on surfaces.
Type Parameters
Section titled “Type Parameters”| Type Parameter | Default type |
|---|---|
|
|
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
|
|
|
optional entity type filter |
Returns
Section titled “Returns”Promise<EntityTypeForFilter<Filter, CanBeGlued>[]>
SDK 2.21.0 Protocol 1.18.0
getMaterial()
Section titled “getMaterial()”getMaterial():
Promise<Material|undefined>
Fetches the material applied to this element. Returns undefined if the
element uses the default material.
Returns
Section titled “Returns”Promise<Material | undefined>
Example
Section titled “Example”let model = await SketchUpApi.getActiveModel();let all = await model.entities.get();let element = all[0];let mat = await element.getMaterial();if (mat) { console.log(mat.name, mat.color.toHex());}SDK 2.30.0
Inherited from
Section titled “Inherited from”BaseDrawingElement.getMaterial
getTag()
Section titled “getTag()”getTag():
Promise<Tag|undefined>
Fetches the tag assigned to this element. Most elements have a tag — even
those on the default “Untagged” tag. Returns undefined only if the tag
reference is missing.
Returns
Section titled “Returns”Promise<Tag | undefined>
Example
Section titled “Example”let model = await SketchUpApi.getActiveModel();let all = await model.entities.get();let element = all[0];let tag = await element.getTag();if (tag) { console.log(tag.name);}SDK 2.30.0
Inherited from
Section titled “Inherited from”BaseDrawingElement.getTag
getUVs()
Section titled “getUVs()”getUVs(
uvRequest):Promise<UVResponse>
Computes UV texture coordinates for 3D points on this face. UVs map a 2D texture image onto the face’s 3D surface. You can request coordinates for points on the front side, back side, or both.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
|
|
Object specifying |
Returns
Section titled “Returns”Promise<UVResponse>
UV coordinates for each requested point.
SDK 2.25.0 Protocol 1.22.0
getUVTiles()
Section titled “getUVTiles()”getUVTiles(
uvRequest):Promise<UVTileResponse>
Computes UV tile indices for 3D points on this face. Tiles are discrete regions of a repeating texture — this method returns which tile each point falls into, useful for texture atlases or tiled material effects.
Parameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
|
|
Object specifying |
Returns
Section titled “Returns”Promise<UVTileResponse>
Tile indices for each requested point.
SDK 2.25.0 Protocol 1.22.0
refresh()
Section titled “refresh()”refresh():
Promise<Face>
Re-fetches this face from SketchUp to get its current state. Because Face
is a snapshot, it can become stale if the model changes. Call refresh()
to get an up-to-date copy.
Returns
Section titled “Returns”Promise<Face>
A new Face reflecting the current model state. Throws if the face has been deleted.
Example
Section titled “Example”let model = await SketchUpApi.getActiveModel();let faces = await model.entities.get({ filterBy: { types: ['Face'] },});// Then later if you suspect the user changed it...let fresh = await faces[0].refresh();console.log(fresh.area());toString()
Section titled “toString()”toString():
string
Returns a string representation of an object.
Returns
Section titled “Returns”string
Deprecated
Section titled “Deprecated”backMaterialId
Section titled “backMaterialId”
readonlybackMaterialId:number|undefined
The persistent id of the material
materialId
Section titled “materialId”
readonlymaterialId:number|undefined
Inherited from
Section titled “Inherited from”BaseDrawingElement.materialId
readonlytagId:number|undefined
Inherited from
Section titled “Inherited from”BaseDrawingElement.tagId
bounds
Section titled “bounds”Get Signature
Section titled “Get Signature”get bounds():
Promise<BoundingBox>
Returns
Section titled “Returns”Promise<BoundingBox>
Inherited from
Section titled “Inherited from”BaseDrawingElement.bounds
Get Signature
Section titled “Get Signature”get tag():
Promise<Readonly<Tag> |undefined>
Returns
Section titled “Returns”Promise<Readonly<Tag> | undefined>
Inherited from
Section titled “Inherited from”BaseDrawingElement.tag