csg
Constructive solid geometry operations on block models.
3 functions / 2 types
Modules
| Module |
|---|
csg.unsafe |
Index
| Function | Description |
|---|---|
| blockModel | Combines two block-model project nodes with CSG and returns a new project node ID. |
| getConfig | Returns the current project geometry settings, or the documented defaults if none were set. |
| setConfig | Sets geometry settings for subsequent block-model CSG in this project. |
| Type | Description |
|---|---|
| BlockModelCsgConfig | Geometry settings for block-model CSG, shared by local and server execution. |
| BlockModelCsgOp | Selects which CSG operation UnsafeBlockModelCsg applies to its two inputs. |
blockModel
blockModel(args: { csgOp: CsgBlockModelCsgOp; left: ProjectObjectProjectNode; name: string; right: ProjectObjectProjectNode }, transactionId?: string): Promise<ProjectObjectProjectNode>Combines two block-model project nodes with CSG and returns a new project node ID.
Native-only. Reads the inputs’ current world transforms, hides both input nodes, and creates the result with the left node’s appearance. The input models remain in the model store. The result ID is a node ID, not a stored model handle or runtime scene ID.
The operation returns after its project writes are applied, before scene synchronization. Wait for scene synchronization before reading the result’s model info or inspecting rendering. To clear the result as one undoable change, delete its node and restore both input visibilities in one committed transaction. Browser CSG uses the low-level model-handle task with remote execution instead of this node-level operation.
Returns: The ID of a ProjectNode.
Returns Promise<ProjectObjectProjectNode>.
csgOp : CsgBlockModelCsgOp
The CSG operation to apply.
left : ProjectObjectProjectNode
The “base” node the operation is applied relative to. The result inherits its appearance.
name : string
Name of the newly created result node.
right : ProjectObjectProjectNode
The node combined with left.
transactionId optional : string
getConfig
getConfig(transactionId?: string): Promise<CsgBlockModelCsgConfig>Returns the current project geometry settings, or the documented defaults if none were set.
Returns: Geometry settings for block-model CSG, shared by local and server execution.
Returns Promise<CsgBlockModelCsgConfig>.
transactionId optional : string
setConfig
setConfig(args: { config: CsgBlockModelCsgConfig }, transactionId?: string): Promise<void>Sets geometry settings for subsequent block-model CSG in this project.
Applies to local and server runs. Each queued operation captures these values. Existing results
are unchanged. Read std.csg.get_config and preserve its other field when changing one value.
Both supplied distances must be finite and non-negative. If the minimum block size is non-zero, epsilon must be smaller. Invalid settings are rejected before the current configuration changes. Zero disables the corresponding tolerance. This setting is not undone with the transaction.
Returns Promise<void>.
config : CsgBlockModelCsgConfig
Geometry settings for subsequent CSG operations in this project.
transactionId optional : string
BlockModelCsgConfig
Geometry settings for block-model CSG, shared by local and server execution.
For models in meters, the defaults mean 1 mm boundary precision and a 1 cm minimum generated side length. Server execution requires a service version that supports configured CSG operations.
Both values are distances in the models’ common coordinate units (meters for meter-based models). Zero disables the corresponding tolerance. Values must be finite and non-negative; epsilon must be smaller than a non-zero minimum block size.
epsilon : number
Maximum distance for treating boundaries as coincident. Default: 0.001 model units. This controls overlap detection, coverage tests and merging adjacent faces.
minBlockSize : number
Minimum full side length along every axis of a generated block. Default: 0.01 model units. Blocks exactly this size are retained. Reused input geometry and point/ball samples are exempt. Every emitted DAG block is checked, including copied input blocks. Increasing this value does not increase the face-merging distance.
BlockModelCsgOp
Enum
Selects which CSG operation UnsafeBlockModelCsg applies to its two inputs.
Intersect = 4
Keeps the subset of left’s blocks that overlap right, with attributes combined.
Merge = 3
Keeps the parts of left and right that don’t overlap each other, plus their overlap.
Replace = 1
Keeps every block of right as-is, plus every part of left that doesn’t overlap right.
Select = 2
Keeps the subset of left’s blocks that overlap right (with left’s attributes only).
Subtract = 0
Removes from left any geometric overlap with right.