Skip to content

Edit

Non-create geometry edits. Accessed via snaptrude.design.edit.

Migrated from the removed tools.offset. Undoable.

Types

OffsetSplitOutcome

Result of offsetSplit.

PropertyTypeDescription
createdIdsComponentHandle[]Components the offset produced
deletedIdsComponentHandle[]Components a split-style offset removed
offsetValuenumberThe 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 offset
    • offsetDistance: 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:

CodeThrown byWhendetails
HANDLE_INVALIDoffsetSplitThe component or profilePickPoint handle cannot be resolved
OPERATION_FAILEDoffsetSplitThe 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