EdgeUse
A directed edge within a face loop, indicating which way the edge runs.
Faces in SketchUp are bounded by loops of edges. Each edge in a loop has a direction — it can be traversed forward (from its start vertex to its end vertex) or reversed (from end to start). EdgeUse captures this orientation.
You’ll encounter EdgeUse when inspecting face geometry via face.outerLoop
or face.holes. The reverse flag tells you whether the edge is being
used in its natural direction or backwards, and the start and end
properties give you the correctly oriented vertices.
Example
Section titled “Example”let model = await SketchUpApi.getActiveModel();
// Create a square face.await model.performOperation(op => { op.createFace(model, [ [0, 0, 0], [100, 0, 0], [100, 100, 0], [0, 100, 0], ]);}, 'Create square');
// Query it back and inspect its outer loop.let faces = await model.entities.get({ filterBy: { types: ['Face'] }});let face = faces[0];let edgeUse = face.outerLoop[0];
console.log(edgeUse.edge.id);// => 47 (the underlying edge's ID)console.log(edgeUse.reverse);// => false (this edge runs forward)console.log( edgeUse.start.x, edgeUse.start.y, edgeUse.start.z);// => 0 0 0 (start vertex of this EdgeUse)console.log( edgeUse.end.x, edgeUse.end.y, edgeUse.end.z);// => 100 0 0 (end vertex of this EdgeUse)Properties
Section titled “Properties”
readonlyedge:Edge
The underlying edge geometry this EdgeUse refers to. Multiple EdgeUse instances can reference the same edge if it’s shared by different faces or loops.
reverse
Section titled “reverse”
readonlyreverse:boolean
Whether this edge is traversed in reverse. When true, the edge runs
from its natural end vertex to its start vertex within this loop.
Accessors
Section titled “Accessors”Get Signature
Section titled “Get Signature”get end():
Vertex
The last vertex encountered when traversing this edge in the loop’s
direction. Accounts for the reverse flag — if the edge is reversed,
this returns the edge’s natural start vertex.
Returns
Section titled “Returns”Get Signature
Section titled “Get Signature”get start():
Vertex
The first vertex encountered when traversing this edge in the loop’s
direction. Accounts for the reverse flag — if the edge is reversed,
this returns the edge’s natural end vertex.
Returns
Section titled “Returns”Methods
Section titled “Methods”toString()
Section titled “toString()”toString():
string
Returns
Section titled “Returns”string