csg
Constructive solid geometry operations on block models.
3 functions / 5 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 |
|---|---|
| BlockModel | Combines two block-model project nodes with CSG and returns a new project node ID. |
| BlockModelCsgConfig | Geometry settings for block-model CSG, shared by local and server execution. |
| BlockModelCsgOp | Selects which CSG operation UnsafeBlockModelCsg applies to its two inputs. |
| 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. |
BlockModel
RPC
BlockModel(request: csg.BlockModel) -> project.object.ProjectNodeCombines 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.
Service method: spatialengine.v1.csg.Csg.BlockModel.
Returns project.object.ProjectNode.
left : project.object.ProjectNode
The “base” node the operation is applied relative to. The result inherits its appearance.
right : project.object.ProjectNode
The node combined with left.
csg_op : csg.BlockModelCsgOp
The CSG operation to apply.
name : string
Name of the newly created result node.
GetConfig
RPC
GetConfig(request: csg.GetConfig) -> csg.BlockModelCsgConfigReturns the current project geometry settings, or the documented defaults if none were set.
Service method: spatialengine.v1.csg.Csg.GetConfig.
Returns csg.BlockModelCsgConfig.
SetConfig
RPC
SetConfig(request: csg.SetConfig) -> google.protobuf.EmptySets 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.
Service method: spatialengine.v1.csg.Csg.SetConfig.
Returns google.protobuf.Empty.
config : csg.BlockModelCsgConfig
Geometry settings for subsequent CSG operations in this project.
BlockModel
Message
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.
left : project.object.ProjectNode
The “base” node the operation is applied relative to. The result inherits its appearance.
right : project.object.ProjectNode
The node combined with left.
csg_op : csg.BlockModelCsgOp
The CSG operation to apply.
name : string
Name of the newly created result node.
BlockModelCsgConfig
Message
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 : double
Maximum distance for treating boundaries as coincident. Default: 0.001 model units. This controls overlap detection, coverage tests and merging adjacent faces.
min_block_size : double
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.
BLOCK_MODEL_CSG_OP_SUBTRACT = 0
Removes from left any geometric overlap with right.
BLOCK_MODEL_CSG_OP_REPLACE = 1
Keeps every block of right as-is, plus every part of left that doesn’t overlap right.
BLOCK_MODEL_CSG_OP_SELECT = 2
Keeps the subset of left’s blocks that overlap right (with left’s attributes only).
BLOCK_MODEL_CSG_OP_MERGE = 3
Keeps the parts of left and right that don’t overlap each other, plus their overlap.
BLOCK_MODEL_CSG_OP_INTERSECT = 4
Keeps the subset of left’s blocks that overlap right, with attributes combined.
GetConfig
Message
Returns the current project geometry settings, or the documented defaults if none were set.
SetConfig
Message
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.
config : csg.BlockModelCsgConfig
Geometry settings for subsequent CSG operations in this project.