跳到主要内容

union

类型: 函数
领域: 建模与几何
推荐导入: from cadflow import union

签名

def union(*solids: 'Union[Solid, Sequence[Solid]]', clean: 'bool' = True, glue: 'bool' = False, tol: 'Optional[float]' = None, tracking_policy: 'TrackingPolicy | str' = <TrackingPolicy.FULL: 'full'>) -> 'Solid'

功能说明

union 是 CadFlow 建模与几何领域的公共函数。

原始 API 说明

Compute the boolean union and return one manifold solid.

Face-area contact and positive-volume overlap can produce one solid without artificial embedding. Edge-only, vertex-only, and point/curve tangencies are non-manifold connections and cannot satisfy the one-Solid contract.

glue is an OCC optimization for compatible touching or coincident topology, not a geometry repair switch. If the optimized pass does not return one solid, CadFlow automatically retries the normal fuse algorithm.

其他公共导入路径

  • from cadflow import union_rsolid

参数

名称类型必需默认值源码说明
solids'Union[Solid, Sequence[Solid]]'-One or more Solid objects or sequences of Solid. Nested sequences are flattened before processing.
clean'bool'TrueUnify same-domain faces and remove splitter edges when possible.
glue'bool'FalseTry OCC glue optimization first, then fall back to normal fuse if necessary. Defaults to False.
tol'Optional[float]'NoneOptional finite non-negative fuzzy-boolean tolerance used by OCC. It may intentionally bridge a small gap but cannot make a non-manifold point or edge contact into a valid solid.
tracking_policy'TrackingPolicy | str'&lt;TrackingPolicy.FULL: 'full'&gt;FULL computes topology history and lineage. GRAPH keeps the replayable operation node without computing a TopoDelta.

返回值

类型: 'Solid'

Solid: The merged union result.

Usage: Accepts standalone Solid objects, lists of Solid, and nested sequences, but always returns exactly one Solid. If the kernel cannot produce exactly one solid result, the API raises a clear error instead of returning multiple pieces.

异常

源码 Docstring 未声明更窄的异常契约。类型、数值、所有权、路径或后端状态无效时,仍可能抛出相应公共异常。

行为与约束

  • 以下契约由当前公共运行时签名生成;所有权与工作流限制见对应领域说明。

导入检查

from cadflow import union

相关内容