ICuttingService
-
class
wvc.ICuttingService() Service interface for managing cutting operations in 3D models.
Extends the base IService and IResettableConfigurationService interfaces to provide comprehensive cutting plane and section management capabilities.
This interface defines methods for:
- Managing cutting sections (groups of cutting planes)
- Creating, modifying, and removing individual cutting planes
- Controlling visual properties (colors, opacity, visibility)
- Configuring capping geometry for cut surfaces
- Handling face selections for plane creation
ICuttingService
Index
Properties
Methods
addCuttingPlaneaddEventListenerclearCuttingSectiondispatchEventgetCappingFaceColorgetCappingGeometryVisibilitygetCappingLineColorgetCuttingPlanegetCuttingPlaneCountgetCuttingPlanesgetCuttingSectiongetCuttingSectionCountgetCuttingSectionsgetModelBoundinggetSelectedFaceremoveCuttingPlaneremoveEventListenerresetConfigurationsetCappingFaceColorsetCappingGeometryVisibilitysetCappingLineColorsetCuttingPlaneColorsetCuttingPlaneLineColorsetCuttingPlaneOpacitysetCuttingPlaneVisibilitysetCuttingSectionGeometryVisibilitysetCuttingSectionStatesetModelBoundingupdateCuttingPlane
Properties
-
wvc.ICuttingService.serviceName inherited
serviceName:ServiceName
Methods
-
wvc.ICuttingService.addCuttingPlane() - addCuttingPlane(sectionIndex: number, cuttingPlane:
CuttingPlane): PromiseAdds a cutting plane to a cutting section.
Parameters
sectionIndex: number
The index of the cutting section to add the plane tocuttingPlane:
CuttingPlaneThe cutting plane to addReturns: Promise
-
wvc.ICuttingService.addEventListener() inherited
addEventListener(type: string, callback: (None | EventListenerOrEventListenerObject), options: (boolean | AddEventListenerOptions)): voidAppends an event listener for events whose type attribute value is type. The callback argument sets the callback that will be invoked when the event is dispatched.
The options argument sets listener-specific options. For compatibility this can be a boolean, in which case the method behaves exactly as if the value was specified as options’s capture.
When set to true, options’s capture prevents callback from being invoked when the event’s eventPhase attribute value is BUBBLING_PHASE. When false (or not present), callback will not be invoked when event’s eventPhase attribute value is CAPTURING_PHASE. Either way, callback will be invoked if event’s eventPhase attribute value is AT_TARGET.
When set to true, options’s passive indicates that the callback will not cancel the event by invoking preventDefault(). This is used to enable performance optimizations described in § 2.8 Observing event listeners.
When set to true, options’s once indicates that the callback will only be invoked once after which the event listener will be removed.
If an AbortSignal is passed for options’s signal, then the event listener will be removed when signal is aborted.
The event listener is appended to target’s event listener list and is not appended if it has the same type, callback, and capture.
Parameters
type: string
callback: (None | EventListenerOrEventListenerObject)
options: (boolean | AddEventListenerOptions)
Returns: void
-
wvc.ICuttingService.clearCuttingSection() - clearCuttingSection(sectionIndex: number): Promise
Clears all cutting planes from a cutting section.
Parameters
sectionIndex: number
The index of the cutting section to clearReturns: Promise
-
wvc.ICuttingService.dispatchEvent() inherited
dispatchEvent(event: Event): booleanDispatches a synthetic event event to target and returns true if either event’s cancelable attribute value is false or its preventDefault() method was not invoked, and false otherwise.
Parameters
event: EventReturns: boolean
-
wvc.ICuttingService.getCappingFaceColor() - getCappingFaceColor(): (undefined | string)
Gets the current capping face color.
Returns: (undefined | string)
The capping face color as a hex string, or undefined if no color is set
-
wvc.ICuttingService.getCappingGeometryVisibility() - getCappingGeometryVisibility(): boolean
Gets the current capping geometry visibility state.
Returns: boolean
True if capping geometry is visible, false otherwise
-
wvc.ICuttingService.getCappingLineColor() - getCappingLineColor(): (undefined | string)
Gets the current capping line color.
Returns: (undefined | string)
The capping line color as a hex string, or undefined if no color is set
-
wvc.ICuttingService.getCuttingPlane() - getCuttingPlane(sectionIndex: number, planeIndex: number): (undefined |
CuttingPlane)Gets a specific cutting plane from a cutting section.
Parameters
sectionIndex: number
The index of the cutting sectionplaneIndex: number
The index of the cutting plane within the sectionReturns: (undefined |
CuttingPlane)The cutting plane at the specified indices, or undefined if not found
-
wvc.ICuttingService.getCuttingPlaneCount() - getCuttingPlaneCount(sectionIndex: number): number
Gets the number of cutting planes in a cutting section.
Parameters
sectionIndex: number
The index of the cutting sectionReturns: number
The number of cutting planes in the section
-
wvc.ICuttingService.getCuttingPlanes() - getCuttingPlanes(sectionIndex: number):
CuttingPlane[]Gets all cutting planes from a cutting section.
Parameters
sectionIndex: number
The index of the cutting sectionReturns:
CuttingPlane[]Array of cutting planes in the section
-
wvc.ICuttingService.getCuttingSection() - getCuttingSection(index: number): (undefined |
Section)Gets a specific cutting section by index.
Parameters
index: number
The index of the cutting section to retrieveReturns: (undefined |
Section)The cutting section at the specified index, or undefined if not found
-
wvc.ICuttingService.getCuttingSectionCount() - getCuttingSectionCount(): number
Gets the total number of cutting sections.
Returns: number
The number of cutting sections
-
wvc.ICuttingService.getCuttingSections() - getCuttingSections():
Section[]Gets all cutting sections.
Returns:
Section[]Array of all cutting sections
-
wvc.ICuttingService.getModelBounding() - getModelBounding(): Box
Gets the current model bounding box.
Returns: Box
The model’s bounding box for reference geometry sizing
-
wvc.ICuttingService.getSelectedFace() - getSelectedFace(): (undefined |
SelectedFace)Gets the currently selected face for cutting plane creation.
Returns: (undefined |
SelectedFace)The selected face data, or undefined if no face is selected
-
wvc.ICuttingService.removeCuttingPlane() - removeCuttingPlane(sectionIndex: number, planeIndex: number): Promise
Removes a cutting plane from a cutting section.
Parameters
sectionIndex: number
The index of the cutting section containing the planeplaneIndex: number
The index of the cutting plane to removeReturns: Promise
-
wvc.ICuttingService.removeEventListener() inherited
removeEventListener(type: string, callback: (None | EventListenerOrEventListenerObject), options: (boolean | EventListenerOptions)): voidRemoves the event listener in target’s event listener list with the same type, callback, and options.
Parameters
type: string
callback: (None | EventListenerOrEventListenerObject)
options: (boolean | EventListenerOptions)
Returns: void
-
wvc.ICuttingService.resetConfiguration() - resetConfiguration(obj: object): Promise
Resets the cutting service configuration to default values or provided configuration.
Parameters
obj: object
Optional configuration object to apply, or undefined to use default configurationReturns: Promise
Promise that resolves when the configuration is applied
-
wvc.ICuttingService.setCappingFaceColor() - setCappingFaceColor(color: string): Promise
Sets the capping face color.
Parameters
color: string
Optional hex color string (e.g., “#ff0000”), or undefined to clearReturns: Promise
Promise that resolves when the operation completes
-
wvc.ICuttingService.setCappingGeometryVisibility() - setCappingGeometryVisibility(cappingGeometryVisibility: boolean): Promise
Sets the capping geometry visibility state.
Parameters
cappingGeometryVisibility: boolean
True to show capping geometry, false to hideReturns: Promise
Promise that resolves when the operation completes
-
wvc.ICuttingService.setCappingLineColor() - setCappingLineColor(color: string): Promise
Sets the capping line color.
Parameters
color: string
Optional hex color string (e.g., “#000000”), or undefined to clearReturns: Promise
Promise that resolves when the operation completes
-
wvc.ICuttingService.setCuttingPlaneColor() - setCuttingPlaneColor(sectionIndex: number, planeIndex: number, color: IColor): void
Sets the face color of a specific cutting plane.
Parameters
sectionIndex: number
The index of the cutting section containing the planeplaneIndex: number
The index of the cutting plane to modifycolor: IColor
The new face color (RGB values between 0 and 1)Returns: void
-
wvc.ICuttingService.setCuttingPlaneLineColor() - setCuttingPlaneLineColor(sectionIndex: number, planeIndex: number, lineColor: IColor): void
Sets the line color of a specific cutting plane.
Parameters
sectionIndex: number
The index of the cutting section containing the planeplaneIndex: number
The index of the cutting plane to modifylineColor: IColor
The new line color (RGB values between 0 and 1)Returns: void
-
wvc.ICuttingService.setCuttingPlaneOpacity() - setCuttingPlaneOpacity(sectionIndex: number, planeIndex: number, opacity: number): void
Sets the opacity of a specific cutting plane.
Parameters
sectionIndex: number
The index of the cutting section containing the planeplaneIndex: number
The index of the cutting plane to modifyopacity: number
The new opacity value (between 0.0 and 1.0)Returns: void
-
wvc.ICuttingService.setCuttingPlaneVisibility() - setCuttingPlaneVisibility(sectionIndex: number, planeIndex: number, visible: boolean): Promise
Sets the visibility of reference geometry for a specific cutting plane.
Parameters
sectionIndex: number
The index of the cutting section containing the planeplaneIndex: number
The index of the cutting plane to modifyvisible: boolean
True to show reference geometry, false to hideReturns: Promise
-
wvc.ICuttingService.setCuttingSectionGeometryVisibility() - setCuttingSectionGeometryVisibility(sectionIndex: number, visible: boolean): Promise
Sets the reference geometry visibility for a cutting section.
Parameters
sectionIndex: number
The index of the cutting section to modifyvisible: boolean
True to show reference geometry, false to hideReturns: Promise
-
wvc.ICuttingService.setCuttingSectionState() - setCuttingSectionState(sectionIndex: number, active: boolean): Promise
Sets the active state of a cutting section.
Parameters
sectionIndex: number
The index of the cutting section to modifyactive: boolean
True to activate the section, false to deactivateReturns: Promise
-
wvc.ICuttingService.setModelBounding() - setModelBounding(modelBounding: Box): void
Sets the model bounding box.
Parameters
modelBounding: Box
The new model bounding boxReturns: void
-
wvc.ICuttingService.updateCuttingPlane() - updateCuttingPlane(sectionIndex: number, planeIndex: number, cuttingPlane: Partial): Promise
Updates properties of an existing cutting plane.
Parameters
sectionIndex: number
The index of the cutting section containing the planeplaneIndex: number
The index of the cutting plane to updatecuttingPlane: Partial
Partial cutting plane object with properties to updateReturns: Promise