Appearance
Edit
Non-create geometry edits. Accessed via snaptrude.design.edit.
Migrated from the removed tools.offset. Undoable.
Types
OffsetSplitOutcome
Result of offsetSplit.
| Property | Type | Description |
|---|---|---|
createdIds | ComponentHandle[] | Components the offset produced |
deletedIds | ComponentHandle[] | Components a split-style offset removed |
offsetValue | number | The engine's POST-clamp / post-sign applied distance (the removed tools.offset dropped this value) |
Functions
offsetSplit(component, offsetDistance, options?)
Offset-and-split the top profile of ONE component. Positive = outward, negative = inward; a split-style offset may remove components. Single-component only — the engine rejects batches.
- Parameters:
component:ComponentHandle— The component to offsetoffsetDistance:number— Signed distance (positive = outward, negative = inward)options:object(optional) —profilePickPoint?: Vec3Handle— choose which top contour profile to offset (defaults to the outer top profile)
- Returns:
OffsetSplitOutcome - Throws: for an unknown/forged handle, a below-minimum distance, a non-offsettable component type, or when the geometry cannot be offset
ts
const out = await snaptrude.design.edit.offsetSplit("space-id", 0.5);
console.log(out.createdIds.length, out.offsetValue);Errors
Failed calls reject with a typed PluginError — see Error Handling. Conditions specific to this namespace:
| Code | Thrown by | When | details |
|---|---|---|---|
HANDLE_INVALID | offsetSplit | The component or profilePickPoint handle cannot be resolved | — |
OPERATION_FAILED | offsetSplit | The engine cannot perform the offset — below-minimum distance, a non-offsettable component type, or geometry that cannot be offset. The engine reports a plain message, so the message carries the reason (no structured engineCode) | handles — the component |