Appearance
Query: Arc
Arc-specific geometry queries — read circular-arc properties as plain values. Accessed via snaptrude.core.geom.query.arc.
Every method takes an opaque ArcHandle and returns plain values (numbers or Vec3Components), never a handle. Use these to inspect the radius, centre, axis, sweep angle, and validity of an arc handle obtained from snaptrude.core.geom.arc or another query.
Types
Vec3Components
Plain-value record returned by point/vector reads (see Handles).
| Property | Type | Description |
|---|---|---|
x | number | X component |
y | number | Y component |
z | number | Z component |
Functions
getRadius(arc)
Read the radius of an arc.
- Parameters:
arc:ArcHandle— The arc to query
- Returns:
number— The arc radius, in Snaptrude units (convert withsnaptrude.core.units.convert(value, from, to)) - Throws:
HandleInvalidError(codeHANDLE_INVALID) ifarcis not a validArcHandle
ts
const { arc: arcQuery } = snaptrude.core.geom.query;
// `arc` is an ArcHandle obtained from snaptrude.core.geom.arc
const radius = await arcQuery.getRadius(arc);
const centre = await arcQuery.getCentre(arc); // { x, y, z }getCentre(arc)
Read the centre point of an arc.
- Parameters:
arc:ArcHandle— The arc to query
- Returns:
Vec3Components— The arc centre as{ x, y, z }, in Snaptrude units - Throws:
HandleInvalidError(codeHANDLE_INVALID) ifarcis not a validArcHandle
getAxis(arc)
Read the rotation axis of an arc.
- Parameters:
arc:ArcHandle— The arc to query
- Returns:
Vec3Components— The arc axis as{ x, y, z } - Throws:
HandleInvalidError(codeHANDLE_INVALID) ifarcis not a validArcHandle
getSweepAngle(arc)
Read the sweep angle of an arc (the angle subtended at its centre).
- Parameters:
arc:ArcHandle— The arc to query
- Returns:
number— The sweep angle in radians - Throws:
HandleInvalidError(codeHANDLE_INVALID) ifarcis not a validArcHandle
isValid(arc)
Check whether an arc is geometrically valid.
- Parameters:
arc:ArcHandle— The arc to query
- Returns:
boolean—trueif the arc is valid - Throws:
HandleInvalidError(codeHANDLE_INVALID) ifarcis not a validArcHandle
ts
const valid = await snaptrude.core.geom.query.arc.isValid(arc);Errors
Failed calls reject with a typed PluginError — see Error Handling. Conditions specific to this namespace:
| Code | Thrown by | When | details |
|---|---|---|---|
HANDLE_INVALID | all methods | The arc handle is invalid, stale, or foreign | — |
Beyond handle resolution these reads are total — they never throw for a resolvable arc; use isValid to test degenerate geometry.