Creates a new jig instance for the specified view.
Sets up the jig loop and connects update event handling.
The view this jig will operate in
Starts the interactive jig operation.
This method initiates both the jig loop and the sampling process. It returns a promise that resolves when the jig operation completes or rejects if an error occurs.
Promise that resolves when the jig operation completes
Rejects the jig operation with an error.
This method should be called when the jig operation fails or is cancelled. It cleans up event listeners and rejects the underlying promise.
The reason for the rejection
Resolves the jig operation with the specified result.
This method should be called when the jig operation completes successfully. It cleans up event listeners and resolves the underlying promise.
The result to return from the jig operation
Abstract method for handling jig input sampling.
This method should be overridden by subclasses to implement the specific input handling logic for the jig. It typically:
The sampler runs concurrently with the jig loop and should
call resolve()
or reject()
when the operation completes.
Called during each update cycle to refresh the jig display.
This method should be overridden by subclasses to implement the visual update logic. It's called automatically by the jig loop whenever the display needs to be refreshed (typically on mouse movement).
Common update operations include:
Base class for interactive drawing operations (jigs) in the CAD editor.
A jig is an interactive operation that allows users to dynamically preview and modify geometric elements during creation. Common examples include:
The jig system provides:
Example