|
OCCT-Light 0.1
C ABI and C++ veneer for multi-language CAD workflows
|
OCCT-Light: boolean operations module public API. More...


Go to the source code of this file.
Classes | |
| struct | occtl_bool_options |
Macros | |
| #define | OCCTL_BOOL_OPTIONS_VERSION_1 1u |
| #define | OCCTL_BOOL_OPTIONS_INIT {OCCTL_BOOL_OPTIONS_VERSION_1, NULL, 0.0, 0, 0, 1.0e-2, 1} |
Typedefs | |
| typedef struct occtl_bool_options | occtl_bool_options_t |
OCCT-Light: boolean operations module public API.
Five operations:
Every entry point takes a single occtl_graph_t* in which the inputs already live, runs the operation, and merges the result back into that same graph as a new topology root. The result root's NodeId is returned in out_root. Input NodeIds remain valid and continue to refer to the originating subgraph; the operation does not mutate them.
When opts->build_history is non-zero, per-input Modified / Generated / Deleted mappings are recorded on graph and queried with occtl_graph_history_modified, occtl_graph_history_generated, and occtl_graph_history_deleted_all.
| #define OCCTL_BOOL_OPTIONS_INIT {OCCTL_BOOL_OPTIONS_VERSION_1, NULL, 0.0, 0, 0, 1.0e-2, 1} |
Static initialiser for occtl_bool_options_t. Suitable for
| #define OCCTL_BOOL_OPTIONS_VERSION_1 1u |
Current options struct version. Bumped only on a binary-incompatible change. New fields are appended via p_next-chained extension structs.
| typedef struct occtl_bool_options occtl_bool_options_t |
Tunable parameters shared by all five boolean operations.
Defaults (see OCCTL_BOOL_OPTIONS_INIT and occtl_bool_options_init) are the conservative ones: no fuzzy tolerance override, single-threaded execution, no post-op simplification, history collection enabled.
| occtl_status_t occtl_bool_common | ( | occtl_graph_t * | graph, |
| const occtl_node_id_t * | objects, | ||
| size_t | n_objects, | ||
| const occtl_node_id_t * | tools, | ||
| size_t | n_tools, | ||
| const occtl_bool_options_t * | opts, | ||
| occtl_node_id_t * | out_root | ||
| ) |
Boolean Common (intersection) of two argument groups.
Arguments may have any dimension; the result has the minimum dimension among the inputs.
Parameters and return codes mirror occtl_bool_fuse.
| [in,out] | graph | See occtl_bool_fuse. |
| [in] | objects | See occtl_bool_fuse. |
| [in] | n_objects | See occtl_bool_fuse. |
| [in] | tools | See occtl_bool_fuse. |
| [in] | n_tools | See occtl_bool_fuse. |
| [in] | opts | See occtl_bool_fuse. |
| [out] | out_root | See occtl_bool_fuse. |
\par Thread Safety No.
| occtl_status_t occtl_bool_cut | ( | occtl_graph_t * | graph, |
| const occtl_node_id_t * | objects, | ||
| size_t | n_objects, | ||
| const occtl_node_id_t * | tools, | ||
| size_t | n_tools, | ||
| const occtl_bool_options_t * | opts, | ||
| occtl_node_id_t * | out_root | ||
| ) |
Boolean Cut (objects minus tools).
The result has the dimension of the objects: tools must have dimension not less than the maximum dimension of the objects.
Parameters and return codes mirror occtl_bool_fuse.
| [in,out] | graph | See occtl_bool_fuse. |
| [in] | objects | See occtl_bool_fuse. |
| [in] | n_objects | See occtl_bool_fuse. |
| [in] | tools | See occtl_bool_fuse. |
| [in] | n_tools | See occtl_bool_fuse. |
| [in] | opts | See occtl_bool_fuse. |
| [out] | out_root | See occtl_bool_fuse. |
\par Thread Safety No.
| occtl_status_t occtl_bool_fuse | ( | occtl_graph_t * | graph, |
| const occtl_node_id_t * | objects, | ||
| size_t | n_objects, | ||
| const occtl_node_id_t * | tools, | ||
| size_t | n_tools, | ||
| const occtl_bool_options_t * | opts, | ||
| occtl_node_id_t * | out_root | ||
| ) |
Boolean Fuse (union) of two argument groups.
Both groups must hold entities of equal dimension. The result is added to graph as a single new topology root.
| [in,out] | graph | Borrows it. Must be non-NULL. Mutated: receives the new topology merged in. |
| [in] | objects | Borrows it. Array of n_objects input NodeIds that already live in graph. Must be non-NULL when n_objects > 0. |
| [in] | n_objects | Number of object inputs. Must be >= 1. |
| [in] | tools | Borrows it. Array of n_tools input NodeIds. |
| [in] | n_tools | Number of tool inputs. Must be >= 1. |
| [in] | opts | Borrows it. Must be non-NULL with a recognised struct_version. |
| [out] | out_root | Borrows it. Must be non-NULL. On success receives the result topology root NodeId. |
| OCCTL_OK | Success. |
| OCCTL_INVALID_ARGUMENT | Required pointer is NULL; n_objects or n_tools is 0; options flags are not 0/1; opts->p_next is non-NULL; or numeric options are out of range / non-finite. |
| OCCTL_VERSION_MISMATCH | struct_version is unrecognised. |
| OCCTL_NOT_FOUND | An input NodeId is invalid or removed. |
| OCCTL_GEOMETRY_INVALID | The boolean algorithm failed to produce a valid result (e.g. the input dimensions were incompatible). |
| OCCTL_TOPOLOGY_INVALID | The result topology was rejected. |
| OCCTL_INTERNAL | An unexpected internal error occurred. |
\par Thread Safety No — mutates graph.
| void occtl_bool_options_init | ( | occtl_bool_options_t * | options | ) |
Runtime initialiser for occtl_bool_options_t.
Sets all fields to OCCTL_BOOL_OPTIONS_INIT.
| [out] | options | Borrows it. NULL-tolerant; no-op when NULL. |
\par Thread Safety Yes.
| occtl_status_t occtl_bool_section | ( | occtl_graph_t * | graph, |
| const occtl_node_id_t * | objects, | ||
| size_t | n_objects, | ||
| const occtl_node_id_t * | tools, | ||
| size_t | n_tools, | ||
| const occtl_bool_options_t * | opts, | ||
| occtl_node_id_t * | out_root | ||
| ) |
Boolean Section: the intersection edges and vertices of all arguments.
Arguments may be of any type. The result is typically a Compound of edges (and possibly vertices) added to graph as a single root.
Parameters and return codes mirror occtl_bool_fuse.
| [in,out] | graph | See occtl_bool_fuse. |
| [in] | objects | See occtl_bool_fuse. |
| [in] | n_objects | See occtl_bool_fuse. |
| [in] | tools | See occtl_bool_fuse. |
| [in] | n_tools | See occtl_bool_fuse. |
| [in] | opts | See occtl_bool_fuse. |
| [out] | out_root | See occtl_bool_fuse. |
\par Thread Safety No.
| occtl_status_t occtl_bool_split | ( | occtl_graph_t * | graph, |
| const occtl_node_id_t * | objects, | ||
| size_t | n_objects, | ||
| const occtl_node_id_t * | tools, | ||
| size_t | n_tools, | ||
| const occtl_bool_options_t * | opts, | ||
| occtl_node_id_t * | out_root | ||
| ) |
Boolean Split: split each object using the tools as cutters.
Tools contribute nothing to the result body; they merely partition the objects. The result is a Compound of the partitions, added as a single new topology root.
Parameters and return codes mirror occtl_bool_fuse.
| [in,out] | graph | See occtl_bool_fuse. |
| [in] | objects | See occtl_bool_fuse. |
| [in] | n_objects | See occtl_bool_fuse. |
| [in] | tools | See occtl_bool_fuse. |
| [in] | n_tools | See occtl_bool_fuse. |
| [in] | opts | See occtl_bool_fuse. |
| [out] | out_root | See occtl_bool_fuse. |
\par Thread Safety No.