Editing Section Plane Process
Below we will consider the process that allows to create and edit a section plane.
Features
EditSectionPlaneProcess type (TypeScript):
export type EditSectionPlaneProcess = {
name: "EditSectionPlane"
id?: number
options: EditSectionPlaneOptions
events: {
onUpdate?: (a: number, b: number, c: number) => void
onInvert?: (value: "front" | "back") => void
onCtrlOriginChanged?: (centered: boolean) => void
}
}
In addition to the options
, this process has an optional property id
.
If specified, it allows editing section planes already added by the command.
Note
It’s possible to add a new section plane (if the limit in 6 planes is not exceeded) by editing a section plane with an empty id parameter.
New in version 1.8.0: Increased the number of planes, simultaneously in a scene, from 4 to 6. Added the controller to transform the placement of plane interactively.
Interactive Transforming
The process also gives an opportunity to interactively transform the placement of plane by using the so-called controller (created automatically after the process is run). This represents some kind of a Vision object which is added to a scene. The controller provides the following types of transformation:
linear movement along the Z axis;
planar movement along the XY plane;
rotation along the X, and Y axes.
Options
Section Plane Options type (Typescript):
export type EditSectionPlaneOptions = {
placement?: {
a: number,
b: number,
c: number
}
colors?: {
lines: C3DViewRGB,
rect: C3DViewRGB,
transparent: number
}
direction?: "front" | "back"
centering?: boolean
}
Name |
Description |
---|---|
|
Section plane defined by two angles and offset (more details). The default is |
|
RGB outline plane color. The default is |
|
RGB plane filling color. The default is |
|
Transparency of section plane rect. The default is |
|
Section plane splits a model into two parts. This option defines which of them is shown (the other one is hidden). The default is |
|
Whether the process aligns the controller by the center (origin) of section plane. The default is |
Note
All options can be changed while the process is run via the updating command.
New in version 1.8.0: Added the option centering to center the controller.
Callbacks
Available events:
onUpdate(a, b, c) is emitted when a plane is changed (via the update process command).
onInvert(direction) is emitted when a direction of a plane is changed.
onCtrlOriginChanged(centered) is emitted when the controller origin becomes different from the plane one (centered is
false
) or equal to it (centered istrue
).
New in version 1.8.0: Added the event onCtrlOriginChanged.
Running
Example of running the process (TypeScript):
view.runCommand({
name: "RunProcessCommand",
process: {
name: "EditSectionPlane",
id: 1,
options: {
placement: {
a: 3,
b: 1,
c: 100
}
},
events: {}
}
})
Updating
Any changes in a section plane available only via the updating command.
Common type of the updating command (TypeScript):
type UpdateProcess = {
name: "UpdateProcessCommand"
options: {
name: "EditSectionPlane"
placement?: {
a: number
b: number
c: number
}
colors?: {
lines: C3DViewRGB
rect: C3DViewRGB
transparent: number
}
direction?: "front"|"back"
}
}
Example of command to update a plane definition (TypeScript):
view.runCommand({
name: "UpdateProcessCommand",
options: {
name: "EditSectionPlane",
placement: {
a: 3,
b: 2,
c: 100
}
}
})