|
OCCT-Light 0.1
C ABI and C++ veneer for multi-language CAD workflows
|
OCCT-Light: Topology builders, mutations, and property setters. More...
#include <stddef.h>#include <stdint.h>#include "occtl_core.h"#include "occtl_curves.h"#include "occtl_geom.h"#include "occtl_surfaces.h"#include "occtl_topo_relation.h"#include "occtl_topo_types.h"

Go to the source code of this file.
Classes | |
| struct | occtl_topo_make_vertex_info |
| struct | occtl_topo_make_edge_info |
| struct | occtl_topo_make_wire_info |
| struct | occtl_topo_edges_to_wires_options |
| struct | occtl_topo_wire_offset_2d_options |
| struct | occtl_topo_wire_fix_degenerate_edges_options |
| struct | occtl_topo_face_chamfer_2d_options |
| struct | occtl_topo_wire_chamfer_2d_options |
| struct | occtl_topo_make_face_info |
| struct | occtl_topo_make_face_from_wires_auto_options |
| struct | occtl_topo_make_shell_info |
| struct | occtl_topo_make_solid_info |
| struct | occtl_topo_make_compound_info |
| struct | occtl_topo_make_compsolid_info |
| struct | occtl_color_rgba |
| struct | occtl_material_info |
| struct | occtl_joint_info |
| struct | occtl_metadata_key_view |
| struct | occtl_tag_view |
| struct | occtl_select_bbox |
| struct | occtl_graph_obb |
| struct | occtl_graph_uv_bounds |
| struct | occtl_graph_mass_properties |
| struct | occtl_select_options |
| struct | occtl_select_metadata_filter |
| struct | occtl_select_distance_to_node_sort |
| struct | occtl_select_group_options |
| struct | occtl_select_group_view |
Macros | |
| #define | OCCTL_TOPO_MAKE_VERTEX_INFO_VERSION_1 1u |
| #define | OCCTL_TOPO_MAKE_VERTEX_INFO_INIT {OCCTL_TOPO_MAKE_VERTEX_INFO_VERSION_1, NULL, {0.0, 0.0, 0.0}, 0.0} |
| #define | OCCTL_TOPO_MAKE_EDGE_INFO_VERSION_1 1u |
| #define | OCCTL_TOPO_MAKE_EDGE_INFO_INIT |
| #define | OCCTL_TOPO_MAKE_WIRE_INFO_VERSION_1 1u |
| #define | OCCTL_TOPO_MAKE_WIRE_INFO_INIT {OCCTL_TOPO_MAKE_WIRE_INFO_VERSION_1, NULL, NULL, 0} |
| #define | OCCTL_TOPO_EDGES_TO_WIRES_OPTIONS_VERSION_1 1u |
| #define | OCCTL_TOPO_EDGES_TO_WIRES_OPTIONS_INIT {OCCTL_TOPO_EDGES_TO_WIRES_OPTIONS_VERSION_1, NULL, NULL, 0, 0.0, 1} |
| #define | OCCTL_TOPO_WIRE_OFFSET_2D_OPTIONS_VERSION_1 1u |
| #define | OCCTL_TOPO_WIRE_OFFSET_2D_OPTIONS_INIT |
| #define | OCCTL_TOPO_WIRE_FIX_DEGENERATE_EDGES_OPTIONS_VERSION_1 1u |
| #define | OCCTL_TOPO_WIRE_FIX_DEGENERATE_EDGES_OPTIONS_INIT {OCCTL_TOPO_WIRE_FIX_DEGENERATE_EDGES_OPTIONS_VERSION_1, NULL, OCCTL_NODE_ID_INVALID, 1.0e-9} |
| #define | OCCTL_TOPO_FACE_CHAMFER_2D_OPTIONS_VERSION_1 1u |
| #define | OCCTL_TOPO_FACE_CHAMFER_2D_OPTIONS_INIT {OCCTL_TOPO_FACE_CHAMFER_2D_OPTIONS_VERSION_1, NULL, OCCTL_NODE_ID_INVALID, NULL, 0, 1.0, 1.0} |
| #define | OCCTL_TOPO_WIRE_CHAMFER_2D_OPTIONS_VERSION_1 1u |
| #define | OCCTL_TOPO_WIRE_CHAMFER_2D_OPTIONS_INIT {OCCTL_TOPO_WIRE_CHAMFER_2D_OPTIONS_VERSION_1, NULL, OCCTL_NODE_ID_INVALID, NULL, 0, 1.0, 1.0} |
| #define | OCCTL_TOPO_MAKE_FACE_INFO_VERSION_1 1u |
| #define | OCCTL_TOPO_MAKE_FACE_INFO_INIT |
| #define | OCCTL_TOPO_MAKE_FACE_FROM_WIRES_AUTO_OPTIONS_VERSION_1 1u |
| #define | OCCTL_TOPO_MAKE_FACE_FROM_WIRES_AUTO_OPTIONS_INIT |
| #define | OCCTL_TOPO_MAKE_SHELL_INFO_VERSION_1 1u |
| #define | OCCTL_TOPO_MAKE_SHELL_INFO_INIT {OCCTL_TOPO_MAKE_SHELL_INFO_VERSION_1, NULL, NULL, 0, 0} |
| #define | OCCTL_TOPO_MAKE_SOLID_INFO_VERSION_1 1u |
| #define | OCCTL_TOPO_MAKE_SOLID_INFO_INIT {OCCTL_TOPO_MAKE_SOLID_INFO_VERSION_1, NULL, NULL, 0} |
| #define | OCCTL_TOPO_MAKE_COMPOUND_INFO_VERSION_1 1u |
| #define | OCCTL_TOPO_MAKE_COMPOUND_INFO_INIT {OCCTL_TOPO_MAKE_COMPOUND_INFO_VERSION_1, NULL, NULL, 0} |
| #define | OCCTL_TOPO_MAKE_COMPSOLID_INFO_VERSION_1 1u |
| #define | OCCTL_TOPO_MAKE_COMPSOLID_INFO_INIT {OCCTL_TOPO_MAKE_COMPSOLID_INFO_VERSION_1, NULL, NULL, 0} |
| #define | OCCTL_MATERIAL_INFO_VERSION_1 1u |
| #define | OCCTL_MATERIAL_INFO_INIT |
| #define | OCCTL_JOINT_INFO_VERSION_1 1u |
| #define | OCCTL_JOINT_INFO_INIT |
| #define | OCCTL_SELECT_OPTIONS_VERSION_1 1u |
| #define | OCCTL_SELECT_METADATA_FILTER_VERSION_1 1u |
| #define | OCCTL_SELECT_DISTANCE_TO_NODE_SORT_VERSION_1 1u |
| #define | OCCTL_SELECT_GROUP_OPTIONS_VERSION_1 1u |
| #define | OCCTL_SELECT_GROUP_VIEW_VERSION_1 1u |
| #define | OCCTL_SELECT_OPTIONS_INIT |
| #define | OCCTL_SELECT_METADATA_FILTER_INIT {OCCTL_SELECT_METADATA_FILTER_VERSION_1, NULL, NULL, 0u, NULL, 0u, 0} |
| #define | OCCTL_SELECT_DISTANCE_TO_NODE_SORT_INIT {OCCTL_SELECT_DISTANCE_TO_NODE_SORT_VERSION_1, NULL, OCCTL_NODE_ID_INVALID} |
| #define | OCCTL_SELECT_GROUP_OPTIONS_INIT |
| #define | OCCTL_SELECT_GROUP_VIEW_INIT |
OCCT-Light: Topology builders, mutations, and property setters.
Covers low-level element construction (make_vertex, make_edge, make_wire, make_face, make_shell, make_solid, make_compound, make_compsolid), wire/edge operations (edges_to_wires, wire_offset_2d, curves_to_wire, wire_fix_degenerate, face_chamfer_2d, wire_chamfer_2d), in-place mutations (remove, replace, add/remove from parent, edge_split), and property setters.
| #define OCCTL_JOINT_INFO_INIT |
| #define OCCTL_MATERIAL_INFO_INIT |
| #define OCCTL_SELECT_GROUP_OPTIONS_INIT |
| #define OCCTL_SELECT_GROUP_VIEW_INIT |
| #define OCCTL_TOPO_MAKE_EDGE_INFO_INIT |
| #define OCCTL_TOPO_MAKE_FACE_FROM_WIRES_AUTO_OPTIONS_INIT |
| #define OCCTL_TOPO_MAKE_FACE_INFO_INIT |
| #define OCCTL_TOPO_WIRE_OFFSET_2D_OPTIONS_INIT |
| typedef struct occtl_batch occtl_batch_t |
Opaque handle for a batched graph mutation scope.
Created by occtl_graph_begin_batch. Mutations performed on graph while a batch is open are deferred; occtl_batch_commit applies them all at once. occtl_batch_abort discards uncommitted changes.
Outside a batch, every mutation is its own implicit scope.
| typedef struct occtl_color_rgba occtl_color_rgba_t |
RGBA colour value for use with graph annotation functions.
Each channel is in the range [0.0f, 1.0f]. The alpha channel follows the OpenGL convention: 1.0f is opaque, 0.0f is fully transparent.
This is a plain-data struct; no struct_version is needed.
| typedef struct occtl_graph_mass_properties occtl_graph_mass_properties_t |
Combined OCCT mass-property value computed for a graph node.
linear_length is the total curve length of edges in the shape, surface_area is the total face area, and volume is the signed solid volume. mass uses unit density and follows the highest non-zero dimensional property: volume, then area, then length. The inertia matrix is row-major, about centre_of_mass, in the global XYZ frame.
| typedef struct occtl_graph_obb occtl_graph_obb_t |
Oriented box value computed for a graph node.
The three direction vectors form the local box axes. Half sizes are non-negative distances from center along the matching axis.
| typedef struct occtl_graph_uv_bounds occtl_graph_uv_bounds_t |
Face UV bounds value computed for a graph node.
| typedef struct occtl_joint_info occtl_joint_info_t |
Assembly joint record stored in graph-owned metadata.
The endpoint nodes may be products, occurrences, or topology nodes. Frames are local joint frames on the respective endpoints. Limits are optional and are interpreted in radians for rotational joints and graph length units for translational joints.
| typedef enum occtl_joint_kind occtl_joint_kind_t |
Assembly joint kind.
These values describe the intended relative motion between two graph nodes. The library stores the declaration as graph metadata; constraint solving is layered separately.
| typedef struct occtl_material_info occtl_material_info_t |
Material-lite record for graph material layers.
name is a borrowed UTF-8 byte span when setting material data. For occtl_graph_material_get, name points at the caller-provided output buffer when a buffer was supplied, otherwise it is NULL and name_len is the stored byte length. A zero name_len is allowed.
| typedef struct occtl_metadata_key_view occtl_metadata_key_view_t |
Borrowed view of a metadata key stored on a graph node.
Pointer lifetime is tied to the owning graph metadata. The view is invalidated by metadata mutation on the graph, graph mutation that remaps/removes the target node, graph clone/free, or graph compaction.
| typedef enum occtl_offset_join_type occtl_offset_join_type_t |
Edge-join style for 3D offset, thicken, and hollow operations.
Shared by occtl_prim_make_offset_shape, occtl_prim_make_thick_solid, and #occtl_topo_offset_features.
| typedef enum occtl_select_axis_position occtl_select_axis_position_t |
Axis-position predicate for occtl_select_options_t.
Position is measured from each candidate bounding-box centre along occtl_select_options_t::axis. MIN / MAX select candidates on the lowest / highest centre plane. CENTER selects candidates on the mid-plane between the lowest and highest candidate centres.
| typedef enum occtl_select_axis occtl_select_axis_t |
Principal axis used by selector position filters.
| typedef enum occtl_select_bbox_mode occtl_select_bbox_mode_t |
Bounding-box predicate for occtl_select_options_t.
| typedef struct occtl_select_bbox occtl_select_bbox_t |
Axis-aligned box used by selector filters.
Distance-to-node sort extension for occtl_select_options_t.
Chain one instance through occtl_select_options_t::p_next when occtl_select_options_t::sort_key is OCCTL_SELECT_SORT_DISTANCE_TO_NODE. The selector computes OCCT minimum distances from each candidate node to target.
To combine this with a metadata filter, set this struct as the first occtl_select_options_t::p_next entry and chain occtl_select_metadata_filter_t from this struct's p_next.
| typedef struct occtl_select_group_iter occtl_select_group_iter_t |
Opaque iterator over grouped selector results.
Created by occtl_select_group_iter_create and released with occtl_select_group_iter_free.
\par Thread Safety No — single-owner; concurrent reads on distinct iterators are safe when the owning graph is not mutated.
| typedef enum occtl_select_group_key occtl_select_group_key_t |
Grouping key for selector results.
| typedef struct occtl_select_group_options occtl_select_group_options_t |
Grouping options for occtl_select_group_iter_create.
| typedef struct occtl_select_group_view occtl_select_group_view_t |
Immutable view of one selected-node group.
Pointer fields borrow from the owning occtl_select_group_iter_t and remain valid until the iterator is advanced or freed.
| typedef struct occtl_select_iter occtl_select_iter_t |
Opaque iterator over selected graph nodes.
Created by occtl_select_iter_create and released with occtl_select_iter_free.
\par Thread Safety No — single-owner; concurrent reads on distinct iterators are safe when the owning graph is not mutated.
| typedef enum occtl_select_measure_kind occtl_select_measure_kind_t |
OCCT mass-property predicate for occtl_select_options_t.
| typedef struct occtl_select_metadata_filter occtl_select_metadata_filter_t |
Metadata predicate extension for occtl_select_options_t.
Chain one instance through occtl_select_options_t::p_next. Set key_len to a non-zero value to match key presence. Also set match_value to 1 to require an exact value match.
| typedef enum occtl_select_normal_mode occtl_select_normal_mode_t |
Face-normal predicate for occtl_select_options_t.
| typedef struct occtl_select_options occtl_select_options_t |
Selection options for occtl_select_iter_create.
kind_mask uses (1ull << OCCTL_KIND_*) bits. A zero mask means all node kinds. When root is invalid, selection scans the whole graph; otherwise it walks descendants from root. Set include_root to 1 to test root itself before its descendants.
Metadata filters are supplied through occtl_select_metadata_filter_t chained from p_next.
| typedef enum occtl_select_sort_direction occtl_select_sort_direction_t |
Sort direction for selected-node output.
| typedef enum occtl_select_sort_key occtl_select_sort_key_t |
Sort key for selected-node output.
| typedef struct occtl_tag_view occtl_tag_view_t |
Borrowed view of a tag stored on a graph node.
Pointer lifetime is tied to the owning graph metadata. The view is invalidated by tag mutation on the graph, graph mutation that remaps/removes the target node, graph clone/free, or graph compaction.
Options for occtl_topo_edges_to_wires.
edges is a borrowed span of Edge node IDs. The graph copies only the resulting Wire topology; the input span need not remain valid after the call returns.
Options for occtl_topo_face_chamfer_2d.
vertices is a borrowed optional span of Vertex node IDs. When vertices is NULL and vertex_count is 0, OCCT attempts to chamfer every vertex of face. The result is inserted into the same graph as a new Face node; the source face is not modified.
| typedef struct occtl_topo_make_compound_info occtl_topo_make_compound_info_t |
Info for occtl_topo_make_compound.
| typedef struct occtl_topo_make_compsolid_info occtl_topo_make_compsolid_info_t |
Info for occtl_topo_make_compsolid.
| typedef struct occtl_topo_make_edge_info occtl_topo_make_edge_info_t |
Info for occtl_topo_make_edge.
curve is a rep ID referencing a 3D curve node in the graph. Use OCCTL_REP_ID_INVALID for a degenerate edge (no 3D curve).
| typedef struct occtl_topo_make_face_from_wires_auto_options occtl_topo_make_face_from_wires_auto_options_t |
Options for occtl_topo_make_face_from_wires_auto.
surface is a rep ID referencing a surface node in the graph. Must be valid (not OCCTL_REP_ID_INVALID). wires is a borrowed span of Wire node IDs.
| typedef struct occtl_topo_make_face_info occtl_topo_make_face_info_t |
Info for occtl_topo_make_face.
surface is a rep ID referencing a surface node in the graph. Must be valid (not OCCTL_REP_ID_INVALID). inner_wires is a borrowed span of wire NodeIds; NULL when inner_wire_count is 0.
| typedef struct occtl_topo_make_shell_info occtl_topo_make_shell_info_t |
Info for occtl_topo_make_shell.
| typedef struct occtl_topo_make_solid_info occtl_topo_make_solid_info_t |
Info for occtl_topo_make_solid.
| typedef struct occtl_topo_make_vertex_info occtl_topo_make_vertex_info_t |
Info for occtl_topo_make_vertex.
| typedef struct occtl_topo_make_wire_info occtl_topo_make_wire_info_t |
Info for occtl_topo_make_wire.
edges is a borrowed span of (edge, orientation) pairs; the graph copies during construction. NULL is valid only when edge_count is 0.
Options for occtl_topo_wire_chamfer_2d.
The source Wire must be planar. The resulting outer Wire is inserted into the same graph as a new Wire node; the source wire is not modified.
| typedef struct occtl_topo_wire_fix_degenerate_edges_options occtl_topo_wire_fix_degenerate_edges_options_t |
Options for occtl_topo_wire_fix_degenerate.
The operation detaches coedge usages whose underlying Edge has OCCT length less than or equal to min_length. The Edge and Vertex definitions remain in the graph for other users.
Join style for planar wire offsets.
Options for occtl_topo_wire_offset_2d.
distance is signed; its side follows OCCT's planar-wire offset convention for the wire orientation. The result is inserted into the same graph as a new topology root.
| enum occtl_joint_kind |
Assembly joint kind.
These values describe the intended relative motion between two graph nodes. The library stores the declaration as graph metadata; constraint solving is layered separately.
Edge-join style for 3D offset, thicken, and hollow operations.
Shared by occtl_prim_make_offset_shape, occtl_prim_make_thick_solid, and #occtl_topo_offset_features.
| enum occtl_select_axis |
Axis-position predicate for occtl_select_options_t.
Position is measured from each candidate bounding-box centre along occtl_select_options_t::axis. MIN / MAX select candidates on the lowest / highest centre plane. CENTER selects candidates on the mid-plane between the lowest and highest candidate centres.
Bounding-box predicate for occtl_select_options_t.
Grouping key for selector results.
| Enumerator | |
|---|---|
| OCCTL_SELECT_GROUP_KIND | Group by occtl_node_kind_t. |
| OCCTL_SELECT_GROUP_AXIS_COORDINATE | Group by approximate bbox-centre coordinate. |
| OCCTL_SELECT_GROUP_CURVE_KIND | Group Edge nodes by occtl_curve_kind_t. |
| OCCTL_SELECT_GROUP_SURFACE_KIND | Group Face nodes by occtl_surface_kind_t. |
| OCCTL_SELECT_GROUP_NAME | Group by metadata-backed name. |
| OCCTL_SELECT_GROUP_COLOR | Group by metadata-backed colour. |
OCCT mass-property predicate for occtl_select_options_t.
Face-normal predicate for occtl_select_options_t.
| Enumerator | |
|---|---|
| OCCTL_SELECT_NORMAL_PARALLEL | Normal points with |
| OCCTL_SELECT_NORMAL_ANTIPARALLEL | Normal points opposite |
| OCCTL_SELECT_NORMAL_EITHER | Normal is parallel or antiparallel. |
Sort key for selected-node output.
| occtl_status_t occtl_batch_abort | ( | occtl_batch_t * | batch | ) |
Aborts the batch, discarding all deferred mutations.
After this call batch is freed and must not be reused. NULL-tolerant (no-op).
| [in] | batch | Owning pointer. May be NULL. |
| OCCTL_OK | On success. |
\par Thread Safety No (mutates graph).
| occtl_status_t occtl_batch_commit | ( | occtl_batch_t * | batch | ) |
Commits all deferred mutations in the batch to the graph.
After this call batch is freed and must not be reused. NULL-tolerant (no-op).
| [in] | batch | Owning pointer. May be NULL. |
| OCCTL_OK | On success. |
\par Thread Safety No (mutates graph).
| occtl_status_t occtl_graph_adjacent_edges_get | ( | occtl_graph_t * | graph, |
| occtl_node_id_t | edge, | ||
| occtl_node_id_t * | out_buf, | ||
| size_t | cap, | ||
| size_t * | out_count | ||
| ) |
Returns computed adjacent Edge nodes for one Edge node.
The list is computed through BRepGraph shared-Vertex incidence from current graph state. Duplicate Edge definitions are collapsed and edge itself is not returned. This is a reusable graph-owned adjacency primitive for connected-edge walks, wire grouping, selector-style relation predicates, and future sketch cleanup helpers.
Two-call buffer (§10.1): pass out_buf as NULL with cap = 0 to learn the required count in out_count, then reissue with a buffer of at least that many occtl_node_id_t entries.
| [in,out] | graph | Borrows it. Must be non-NULL. |
| [in] | edge | Edge node ID to query. Must be valid and active. |
| [out] | out_buf | Borrows it. May be NULL on the sizing call. |
| [in] | cap | Capacity of out_buf in entries. |
| [out] | out_count | Borrows it. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_count is NULL. |
| OCCTL_NOT_FOUND | edge is invalid or removed. |
| OCCTL_WRONG_KIND | edge is not an Edge node. |
| OCCTL_BUFFER_TOO_SMALL | out_buf is non-NULL and cap is too small. |
\par Thread Safety No (may update OCCT internal caches).
| occtl_status_t occtl_graph_adjacent_faces_get | ( | occtl_graph_t * | graph, |
| occtl_node_id_t | face, | ||
| occtl_node_id_t * | out_buf, | ||
| size_t | cap, | ||
| size_t * | out_count | ||
| ) |
Returns computed adjacent Face nodes for one Face node.
The list is computed through BRepGraph face-adjacency relations from current graph state. Duplicate Face definitions are collapsed. This is a reusable graph-owned adjacency primitive for connected-face walks, selector-style relation predicates, and future reverse-engineering patch traversal.
Two-call buffer (§10.1): pass out_buf as NULL with cap = 0 to learn the required count in out_count, then reissue with a buffer of at least that many occtl_node_id_t entries.
| [in,out] | graph | Borrows it. Must be non-NULL. |
| [in] | face | Face node ID to query. Must be valid and active. |
| [out] | out_buf | Borrows it. May be NULL on the sizing call. |
| [in] | cap | Capacity of out_buf in entries. |
| [out] | out_count | Borrows it. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_count is NULL. |
| OCCTL_NOT_FOUND | face is invalid or removed. |
| OCCTL_WRONG_KIND | face is not a Face node. |
| OCCTL_BUFFER_TOO_SMALL | out_buf is non-NULL and cap is too small. |
\par Thread Safety No (may update OCCT internal caches).
| occtl_status_t occtl_graph_bbox_get | ( | occtl_graph_t * | graph, |
| occtl_node_id_t | node, | ||
| occtl_select_bbox_t * | out_bbox | ||
| ) |
Returns a computed axis-aligned bounding box for a node.
The value is computed from current graph state. OCCT may use internal transient caches, but OCCT-Light exposes only the computed POD result.
| [in,out] | graph | Borrows it. Must be non-NULL. |
| [in] | node | Node ID to query. Must be valid and active. |
| [out] | out_bbox | Borrows it. Must be non-NULL. Receives the box. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_bbox is NULL. |
| OCCTL_NOT_FOUND | node is invalid or removed. |
| OCCTL_GEOMETRY_INVALID | OCCT could not compute a finite box. |
\par Thread Safety No (may update OCCT internal caches).
| occtl_status_t occtl_graph_begin_batch | ( | occtl_graph_t * | graph, |
| occtl_batch_t ** | out_batch | ||
| ) |
Opens a batched mutation scope on graph.
Subsequent mutations on graph are deferred until occtl_batch_commit is called on the returned handle. Release with occtl_batch_commit (apply) or occtl_batch_abort (discard).
| [in,out] | graph | Borrows it. Must be non-NULL. |
| [out] | out_batch | Owns it. Must be non-NULL. The caller is responsible for calling commit or abort. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_batch is NULL. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety No (mutates graph batch state).
| occtl_status_t occtl_graph_clear_cached | ( | occtl_graph_t * | graph, |
| occtl_node_id_t | node, | ||
| occtl_ref_id_t | ref | ||
| ) |
Clears graph-owned computed data related to one node or one reference.
Exactly one of node or ref must be valid. The implementation removes graph-owned computed data attached to the selected target; callers must treat cached calculation results as an optimization only.
| [in,out] | graph | Borrows it. Must be non-NULL. |
| [in] | node | Node ID to clear, or OCCTL_NODE_ID_INVALID. |
| [in] | ref | Ref ID to clear, or OCCTL_REF_ID_INVALID. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph is NULL, or both/neither IDs are valid. |
| OCCTL_NOT_FOUND | The selected node or reference is invalid or removed. |
\par Thread Safety No (mutates internal computed-data state).
| occtl_status_t occtl_graph_clone | ( | const occtl_graph_t * | source, |
| occtl_graph_t ** | out_graph | ||
| ) |
Deep-clones a topology graph.
Copies all active nodes, references, representations, and registered layers. Geometry handles are deep-copied so the new graph is fully independent. The caller owns the returned graph and must release it with occtl_graph_free.
| [in] | source | Borrows it. Must be non-NULL. |
| [out] | out_graph | Owns it. Must be non-NULL. On success receives a valid handle; on failure set to NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | source or out_graph is NULL. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety No (reads source, but source must not be concurrently mutated).
| occtl_status_t occtl_graph_compact | ( | occtl_graph_t * | graph | ) |
Compacts the graph by reclaiming slots from removed nodes.
After compaction all occtl_node_id_t and occtl_ref_id_t values are invalidated (they are session-local indices that may be renumbered). Persistent occtl_uid_t values survive compaction and can be resolved back to new NodeIds via occtl_graph_node_id_from_uid.
| [in,out] | graph | Borrows it. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph is NULL. |
\par Thread Safety No (mutates graph).
| occtl_status_t occtl_graph_descendant_edges_get | ( | occtl_graph_t * | graph, |
| occtl_node_id_t | node, | ||
| occtl_node_id_t * | out_buf, | ||
| size_t | cap, | ||
| size_t * | out_count | ||
| ) |
Returns computed descendant Edge nodes for a graph root.
The list is computed through BRepGraph child traversal from current graph state. Duplicate Edge definitions are collapsed. If node is itself an Edge, the returned list contains that Edge.
Two-call buffer (§10.1): pass out_buf as NULL with cap = 0 to learn the required count in out_count, then reissue with a buffer of at least that many occtl_node_id_t entries.
| [in,out] | graph | Borrows it. Must be non-NULL. |
| [in] | node | Root node ID to query. Must be valid and active. |
| [out] | out_buf | Borrows it. May be NULL on the sizing call. |
| [in] | cap | Capacity of out_buf in entries. |
| [out] | out_count | Borrows it. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_count is NULL. |
| OCCTL_NOT_FOUND | node is invalid or removed. |
| OCCTL_BUFFER_TOO_SMALL | out_buf is non-NULL and cap is too small. |
\par Thread Safety No (may update OCCT internal caches).
| occtl_status_t occtl_graph_descendant_faces_get | ( | occtl_graph_t * | graph, |
| occtl_node_id_t | node, | ||
| occtl_node_id_t * | out_buf, | ||
| size_t | cap, | ||
| size_t * | out_count | ||
| ) |
Returns computed descendant Face nodes for a graph root.
The list is computed through BRepGraph child traversal from current graph state. Duplicate Face definitions are collapsed. If node is itself a Face, the returned list contains that Face.
Two-call buffer (§10.1): pass out_buf as NULL with cap = 0 to learn the required count in out_count, then reissue with a buffer of at least that many occtl_node_id_t entries.
| [in,out] | graph | Borrows it. Must be non-NULL. |
| [in] | node | Root node ID to query. Must be valid and active. |
| [out] | out_buf | Borrows it. May be NULL on the sizing call. |
| [in] | cap | Capacity of out_buf in entries. |
| [out] | out_count | Borrows it. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_count is NULL. |
| OCCTL_NOT_FOUND | node is invalid or removed. |
| OCCTL_BUFFER_TOO_SMALL | out_buf is non-NULL and cap is too small. |
\par Thread Safety No (may update OCCT internal caches).
| occtl_status_t occtl_graph_descendant_vertices_get | ( | occtl_graph_t * | graph, |
| occtl_node_id_t | node, | ||
| occtl_node_id_t * | out_buf, | ||
| size_t | cap, | ||
| size_t * | out_count | ||
| ) |
Returns computed descendant Vertex nodes for a graph root.
The list is computed through BRepGraph child traversal from current graph state. Duplicate Vertex definitions are collapsed. If node is itself a Vertex, the returned list contains that Vertex.
Two-call buffer (§10.1): pass out_buf as NULL with cap = 0 to learn the required count in out_count, then reissue with a buffer of at least that many occtl_node_id_t entries.
| [in,out] | graph | Borrows it. Must be non-NULL. |
| [in] | node | Root node ID to query. Must be valid and active. |
| [out] | out_buf | Borrows it. May be NULL on the sizing call. |
| [in] | cap | Capacity of out_buf in entries. |
| [out] | out_count | Borrows it. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_count is NULL. |
| OCCTL_NOT_FOUND | node is invalid or removed. |
| OCCTL_BUFFER_TOO_SMALL | out_buf is non-NULL and cap is too small. |
\par Thread Safety No (may update OCCT internal caches).
| occtl_status_t occtl_graph_descendants_get | ( | occtl_graph_t * | graph, |
| occtl_node_id_t | node, | ||
| occtl_node_kind_t | descendant_kind, | ||
| occtl_node_id_t * | out_buf, | ||
| size_t | cap, | ||
| size_t * | out_count | ||
| ) |
Returns computed descendant nodes of one requested kind for a graph root.
The list is computed through BRepGraph child traversal from current graph state and keyed by descendant_kind. Duplicate definitions are collapsed. If node itself has descendant_kind, the returned list includes node.
This is the broad descendant query surface for root-scoped scans. Use the narrower Vertex / Edge / Face functions only when a binding wants a more explicitly named convenience wrapper.
Two-call buffer (§10.1): pass out_buf as NULL with cap = 0 to learn the required count in out_count, then reissue with a buffer of at least that many occtl_node_id_t entries.
| [in,out] | graph | Borrows it. Must be non-NULL. |
| [in] | node | Root node ID to query. Must be valid and active. |
| [in] | descendant_kind | Requested node kind. Must not be OCCTL_KIND_INVALID. |
| [out] | out_buf | Borrows it. May be NULL on the sizing call. |
| [in] | cap | Capacity of out_buf in entries. |
| [out] | out_count | Borrows it. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_count is NULL, or descendant_kind is invalid. |
| OCCTL_NOT_FOUND | node is invalid or removed. |
| OCCTL_BUFFER_TOO_SMALL | out_buf is non-NULL and cap is too small. |
\par Thread Safety No (may update OCCT internal caches).
| occtl_status_t occtl_graph_edge_curve_kind_get | ( | occtl_graph_t * | graph, |
| occtl_node_id_t | edge, | ||
| occtl_curve_kind_t * | out_kind | ||
| ) |
Returns a computed curve-kind classification for an Edge node.
The classification delegates to OCCT edge adaptors. Callers receive a POD enum copy.
| [in,out] | graph | Borrows it. Must be non-NULL. |
| [in] | edge | Edge node ID to classify. Must be valid and active. |
| [out] | out_kind | Borrows it. Must be non-NULL. Receives the curve kind. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_kind is NULL. |
| OCCTL_NOT_FOUND | edge is invalid or removed. |
| OCCTL_WRONG_KIND | edge is not an Edge node. |
| OCCTL_GEOMETRY_INVALID | OCCT could not classify the edge geometry. |
\par Thread Safety No (may update OCCT internal caches).
| occtl_status_t occtl_graph_face_surface_kind_get | ( | occtl_graph_t * | graph, |
| occtl_node_id_t | face, | ||
| occtl_surface_kind_t * | out_kind | ||
| ) |
Returns a computed surface-kind classification for a Face node.
The classification delegates to OCCT surface adaptors. Callers receive a POD enum copy.
| [in,out] | graph | Borrows it. Must be non-NULL. |
| [in] | face | Face node ID to classify. Must be valid and active. |
| [out] | out_kind | Borrows it. Must be non-NULL. Receives the surface kind. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_kind is NULL. |
| OCCTL_NOT_FOUND | face is invalid or removed. |
| OCCTL_WRONG_KIND | face is not a Face node. |
| OCCTL_GEOMETRY_INVALID | OCCT could not classify the face geometry. |
\par Thread Safety No (may update OCCT internal caches).
| occtl_status_t occtl_graph_face_uv_bounds_get | ( | occtl_graph_t * | graph, |
| occtl_node_id_t | face, | ||
| occtl_graph_uv_bounds_t * | out_uv_bounds | ||
| ) |
Returns computed UV parameter bounds for a Face node.
The value is computed through BRepGraph UV-bounds algorithms from current graph state. OCCT may use internal transient caches; callers receive a POD copy.
| [in,out] | graph | Borrows it. Must be non-NULL. |
| [in] | face | Face node ID to query. Must be valid and active. |
| [out] | out_uv_bounds | Borrows it. Must be non-NULL. Receives bounds. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_uv_bounds is NULL. |
| OCCTL_NOT_FOUND | face is invalid or removed. |
| OCCTL_WRONG_KIND | face is not a Face node. |
| OCCTL_GEOMETRY_INVALID | OCCT could not compute valid UV bounds. |
\par Thread Safety No (may update OCCT internal caches).
| occtl_status_t occtl_graph_mass_properties_get | ( | occtl_graph_t * | graph, |
| occtl_node_id_t | node, | ||
| occtl_graph_mass_properties_t * | out_properties | ||
| ) |
Returns computed combined OCCT mass properties for a node.
The value is computed through OCCT mass-property algorithms from current graph state. Callers receive a POD copy.
| [in,out] | graph | Borrows it. Must be non-NULL. |
| [in] | node | Node ID to query. Must be valid and active. |
| [out] | out_properties | Borrows it. Must be non-NULL. Receives the mass-property summary. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_properties is NULL. |
| OCCTL_NOT_FOUND | node is invalid or removed. |
| OCCTL_GEOMETRY_INVALID | OCCT could not compute finite properties. |
\par Thread Safety No (may update OCCT internal caches).
| occtl_status_t occtl_graph_measure_get | ( | occtl_graph_t * | graph, |
| occtl_node_id_t | node, | ||
| occtl_select_measure_kind_t | kind, | ||
| double * | out_value | ||
| ) |
Returns a computed OCCT mass-property scalar for a node.
The value is computed through OCCT mass-property algorithms from current graph state.
| [in,out] | graph | Borrows it. Must be non-NULL. |
| [in] | node | Node ID to query. Must be valid and active. |
| [in] | kind | Measure scalar to compute. |
| [out] | out_value | Borrows it. Must be non-NULL. Receives the value. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_value is NULL, or kind is unsupported. |
| OCCTL_NOT_FOUND | node is invalid or removed. |
| OCCTL_WRONG_KIND | kind is not applicable to node. |
| OCCTL_GEOMETRY_INVALID | OCCT could not compute the requested value. |
\par Thread Safety No (may update OCCT internal caches).
| occtl_status_t occtl_graph_obb_get | ( | occtl_graph_t * | graph, |
| occtl_node_id_t | node, | ||
| occtl_graph_obb_t * | out_obb | ||
| ) |
Returns a computed oriented bounding box for a node.
The value is computed through OCCT from current graph state. Callers receive a POD copy.
| [in,out] | graph | Borrows it. Must be non-NULL. |
| [in] | node | Node ID to query. Must be valid and active. |
| [out] | out_obb | Borrows it. Must be non-NULL. Receives the box. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_obb is NULL. |
| OCCTL_NOT_FOUND | node is invalid or removed. |
| OCCTL_GEOMETRY_INVALID | OCCT could not compute an oriented box. |
\par Thread Safety No (may update OCCT internal caches).
| occtl_status_t occtl_graph_pair_distance_get | ( | occtl_graph_t * | graph, |
| occtl_node_id_t | first, | ||
| occtl_node_id_t | second, | ||
| double * | out_distance | ||
| ) |
Returns a computed OCCT minimum distance between two graph nodes.
The value is computed through OCCT from current graph state. Callers receive a POD scalar copy.
| [in,out] | graph | Borrows it. Must be non-NULL. |
| [in] | first | First node ID. Must be valid and active. |
| [in] | second | Second node ID. Must be valid and active. |
| [out] | out_distance | Borrows it. Must be non-NULL. Receives the minimum distance. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_distance is NULL. |
| OCCTL_NOT_FOUND | first or second is invalid or removed. |
| OCCTL_GEOMETRY_INVALID | OCCT could not compute a finite distance. |
\par Thread Safety No (may update OCCT internal caches).
| occtl_status_t occtl_select_group_iter_create | ( | occtl_graph_t * | graph, |
| const occtl_select_options_t * | select_options, | ||
| const occtl_select_group_options_t * | group_options, | ||
| occtl_select_group_iter_t ** | out_iter | ||
| ) |
Creates an iterator over grouped selector results.
| [in,out] | graph | Borrows it. Must be non-NULL. |
| [in] | select_options | Borrows it. May be NULL for defaults. |
| [in] | group_options | Borrows it. May be NULL for defaults. |
| [out] | out_iter | Owns it. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_iter is NULL, or an option value is invalid. |
| OCCTL_NOT_FOUND | select_options->root is invalid or removed. |
| OCCTL_VERSION_MISMATCH | An options struct version is unsupported. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety No (may update OCCT internal caches).
| void occtl_select_group_iter_free | ( | occtl_select_group_iter_t * | iter | ) |
Releases a grouped-selection iterator.
| [in] | iter | Owns it. May be NULL. |
\par Thread Safety Yes.
| occtl_status_t occtl_select_group_iter_next | ( | occtl_select_group_iter_t * | iter, |
| occtl_select_group_view_t * | out_view | ||
| ) |
Advances a grouped-selection iterator.
| [in,out] | iter | Borrows it. Must be non-NULL. |
| [out] | out_view | Borrows it. Must be non-NULL. |
| OCCTL_OK | Next group view written. |
| OCCTL_NOT_FOUND | Iterator exhausted. |
| OCCTL_INVALID_ARGUMENT | iter or out_view is NULL. |
\par Thread Safety No (mutates iterator).
| void occtl_select_group_options_init | ( | occtl_select_group_options_t * | options | ) |
Initialises options to OCCTL_SELECT_GROUP_OPTIONS_INIT.
| [out] | options | Borrows it. May be NULL. |
\par Thread Safety Yes.
| void occtl_select_group_view_init | ( | occtl_select_group_view_t * | view | ) |
Initialises view to OCCTL_SELECT_GROUP_VIEW_INIT.
| [out] | view | Borrows it. May be NULL. |
\par Thread Safety Yes.
| occtl_status_t occtl_select_iter_create | ( | occtl_graph_t * | graph, |
| const occtl_select_options_t * | options, | ||
| occtl_select_iter_t ** | out_iter | ||
| ) |
Creates an iterator over nodes matching options.
The selector computes derived data such as node bounding boxes; pass a mutable graph handle because OCCT algorithms may update internal graph state.
| [in,out] | graph | Borrows it. Must be non-NULL. |
| [in] | options | Borrows it. May be NULL for defaults. |
| [out] | out_iter | Owns it. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_iter is NULL, or an optional pointer field is inconsistent. |
| OCCTL_NOT_FOUND | options->root is invalid or removed. |
| OCCTL_VERSION_MISMATCH | options->struct_version unsupported. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety No (may update OCCT internal caches).
| void occtl_select_iter_free | ( | occtl_select_iter_t * | iter | ) |
Releases a selection iterator.
| [in] | iter | Owns it. May be NULL. |
\par Thread Safety Yes.
| occtl_status_t occtl_select_iter_next | ( | occtl_select_iter_t * | iter, |
| occtl_node_id_t * | out_node | ||
| ) |
Advances a selection iterator.
| [in,out] | iter | Borrows it. Must be non-NULL. |
| [out] | out_node | Borrows it. Must be non-NULL. |
| OCCTL_OK | Next selected node written. |
| OCCTL_NOT_FOUND | Iterator exhausted; out_node is invalid. |
| OCCTL_INVALID_ARGUMENT | iter or out_node is NULL. |
\par Thread Safety No (mutates iterator).
| void occtl_select_options_init | ( | occtl_select_options_t * | options | ) |
Initialises options to OCCTL_SELECT_OPTIONS_INIT.
| [out] | options | Borrows it. May be NULL. |
\par Thread Safety Yes.
| occtl_status_t occtl_select_tagged_iter_create | ( | occtl_graph_t * | graph, |
| const occtl_select_options_t * | options, | ||
| const char * | tag, | ||
| size_t | tagLen, | ||
| occtl_select_iter_t ** | out_iter | ||
| ) |
Creates an iterator over tagged nodes matching options.
This is equivalent to occtl_select_iter_create followed by an exact graph tag predicate, but filtering is performed during selector traversal. The selector may populate BRepGraph transient caches for expensive derived data such as node bounding boxes; pass a mutable graph handle.
| [in,out] | graph | Borrows it. Must be non-NULL. |
| [in] | options | Borrows it. May be NULL for defaults. |
| [in] | tag | Tag bytes. Borrowed; must be non-NULL and non-empty. |
| [in] | tagLen | Length of tag in bytes. |
| [out] | out_iter | Owns it. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_iter is NULL, tag is NULL/empty, or an optional pointer field is inconsistent. |
| OCCTL_NOT_FOUND | options->root is invalid or removed. |
| OCCTL_VERSION_MISMATCH | options->struct_version unsupported. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety No (may update OCCT internal caches).
| occtl_status_t occtl_topo_add_pcurve | ( | occtl_graph_t * | graph, |
| occtl_node_id_t | edge, | ||
| occtl_node_id_t | face, | ||
| occtl_rep_id_t | pcurve_id, | ||
| double | first, | ||
| double | last, | ||
| occtl_orientation_t | orientation | ||
| ) |
Adds a PCurve binding between an edge and a face.
Creates a new CoEdge entity with a Curve2DRep for the given edge-face pair. This is the canonical repair operation when an edge lacks a pcurve on a face it bounds.
| [in,out] | graph | Borrows it. Must be non-NULL. |
| [in] | edge | Edge node ID. Must be a valid, active edge. |
| [in] | face | Face node ID. Must be a valid, active face. |
| [in] | pcurve_id | Rep ID of the 2D parametric curve node. Must be valid (not OCCTL_REP_ID_INVALID). |
| [in] | first | First parameter on the PCurve. |
| [in] | last | Last parameter on the PCurve. |
| [in] | orientation | Edge orientation on the face. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph is NULL or pcurve_id is invalid. |
| OCCTL_NOT_FOUND | edge or face is invalid or removed. |
| OCCTL_WRONG_KIND | edge is not an edge or face is not a face. |
\par Thread Safety No (mutates graph).
| occtl_status_t occtl_topo_cleanup_removed_refs | ( | occtl_graph_t * | graph | ) |
Cleans up stale references after removal operations.
Forces the graph to finalise deferred invalidation and validate internal consistency. Idempotent — calling multiple times is safe and has no additional side effects.
| [in,out] | graph | Borrows it. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph is NULL. |
\par Thread Safety No (mutates graph).
| occtl_status_t occtl_topo_coedge_has_polygon_on_surface | ( | const occtl_graph_t *const | graph, |
| occtl_node_id_t | coedge, | ||
| int32_t *const | out_has_polygon_on_surface | ||
| ) |
Returns whether a coedge has a polygon-on-surface discretization.
| [in] | graph | Must be non-NULL. |
| [in] | coedge | CoEdge node ID. |
| [out] | out_has_polygon_on_surface | Borrows it. Set to 1 if polygon present, 0 otherwise. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_has_polygon_on_surface is NULL. |
| OCCTL_NOT_FOUND | coedge is invalid, removed, or not a coedge. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_coedge_orientation | ( | const occtl_graph_t *const | graph, |
| occtl_node_id_t | coedge, | ||
| occtl_orientation_t *const | out_orientation | ||
| ) |
Returns the full orientation (FORWARD/REVERSED/INTERNAL/EXTERNAL) of a coedge.
Unlike occtl_topo_coedge_is_reversed, which only tests the REVERSED flag, this returns the complete TopAbs_Orientation.
| [in] | graph | Must be non-NULL. |
| [in] | coedge | CoEdge node ID. |
| [out] | out_orientation | Borrows it. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_orientation is NULL. |
| OCCTL_NOT_FOUND | coedge is invalid, removed, or not a coedge. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_compound_add_child | ( | occtl_graph_t * | graph, |
| occtl_node_id_t | compound, | ||
| occtl_node_id_t | child, | ||
| occtl_orientation_t | orientation | ||
| ) |
Adds a child entity to an existing compound.
| [in,out] | graph | Borrows it. Must be non-NULL. |
| [in] | compound | Compound node ID. Must be a valid, active compound. |
| [in] | child | Child node ID of any topology kind. |
| [in] | orientation | Orientation of the child in the compound. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph is NULL. |
| OCCTL_NOT_FOUND | compound or child is invalid or removed. |
| OCCTL_WRONG_KIND | compound is not a compound. |
| OCCTL_ERROR | the operation was rejected. |
\par Thread Safety No (mutates graph).
| occtl_status_t occtl_topo_compound_remove_child | ( | occtl_graph_t * | graph, |
| occtl_node_id_t | compound, | ||
| occtl_node_id_t | child | ||
| ) |
Removes a child from a compound without deleting the child definition.
| [in,out] | graph | Borrows it. Must be non-NULL. |
| [in] | compound | Compound node ID. Must be a valid, active compound. |
| [in] | child | Child node ID. Must be the definition ID of a child referenced by the compound. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph is NULL. |
| OCCTL_NOT_FOUND | compound or child is invalid, removed, has wrong kind, or the child is not in the compound. |
| OCCTL_WRONG_KIND | compound is not a compound. |
\par Thread Safety No (mutates graph).
| occtl_status_t occtl_topo_curves_to_wire | ( | occtl_graph_t * | graph, |
| const occtl_rep_id_t * | curve_ids, | ||
| size_t | count, | ||
| occtl_node_id_t * | out_wire | ||
| ) |
Creates a wire from an ordered array of curve rep IDs.
For each curve the function evaluates the start and end point, creates vertices (sharing vertices between consecutive curves whose endpoints match within tolerance), creates a single-edge wire per curve, then joins all edges into one wire.
A single closed curve (e.g. a circle) produces one vertex used as both start and end of a single edge.
| [in,out] | graph | Borrows it. Must be non-NULL. |
| [in] | curve_ids | Borrows it. Array of count curve rep IDs. Must be non-NULL when count > 0. |
| [in] | count | Number of curves. Must be >= 1. |
| [out] | out_wire | Owns it. Receives the wire node ID. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | Any required pointer is NULL, count == 0, or a curve rep ID in the array is invalid. |
| OCCTL_NOT_FOUND | A curve evaluation failed. |
| OCCTL_GEOMETRY_INVALID | Could not create geometry. |
\par Thread Safety No (mutates graph).
| occtl_status_t occtl_topo_edge_add_internal_vertex | ( | occtl_graph_t * | graph, |
| occtl_node_id_t | edge, | ||
| occtl_node_id_t | vertex | ||
| ) |
Adds an internal vertex to an edge.
The vertex is recorded on the edge with INTERNAL orientation. This does not split the edge; for splitting see occtl_topo_edge_split.
| [in,out] | graph | Borrows it. Must be non-NULL. |
| [in] | edge | Edge node ID. Must be a valid, active edge. |
| [in] | vertex | Vertex node ID. Must be a valid, active vertex. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph is NULL. |
| OCCTL_NOT_FOUND | edge or vertex is invalid or removed. |
| OCCTL_WRONG_KIND | edge is not an edge or vertex is not a vertex. |
| OCCTL_ERROR | the operation was rejected. |
\par Thread Safety No (mutates graph).
| occtl_status_t occtl_topo_edge_continuity | ( | const occtl_graph_t *const | graph, |
| occtl_node_id_t | edge, | ||
| occtl_node_id_t | faceA, | ||
| occtl_node_id_t | faceB, | ||
| occtl_shape_continuity_t *const | out_continuity | ||
| ) |
Returns the geometric continuity between two faces at their shared edge.
The continuity describes how smoothly the surfaces of faceA and faceB meet along edge.
| [in] | graph | Must be non-NULL. |
| [in] | edge | Edge node ID shared by both faces. |
| [in] | faceA | First face node ID. |
| [in] | faceB | Second face node ID. |
| [out] | out_continuity | Borrows it. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_continuity is NULL. |
| OCCTL_NOT_FOUND | edge, faceA, or faceB is invalid or removed. |
| OCCTL_WRONG_KIND | A NodeId has the wrong kind. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_edge_find_coedge_on_face | ( | const occtl_graph_t *const | graph, |
| occtl_node_id_t | edge, | ||
| occtl_node_id_t | face, | ||
| occtl_node_id_t *const | out_coedge | ||
| ) |
Finds the coedge belonging to the given (edge, face) pair.
O(1) lookup through the edge's coedge reverse-index. Returns OCCTL_NOT_FOUND when edge is not incident to face.
| [in] | graph | Must be non-NULL. |
| [in] | edge | Edge node ID. |
| [in] | face | Face node ID. |
| [out] | out_coedge | Borrows it. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_coedge is NULL. |
| OCCTL_NOT_FOUND | edge or face is invalid/removed, or no coedge binds this edge-face pair. |
| OCCTL_WRONG_KIND | edge is not an edge or face is not a face. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_edge_find_coedge_on_face_oriented | ( | const occtl_graph_t *const | graph, |
| occtl_node_id_t | edge, | ||
| occtl_node_id_t | face, | ||
| occtl_orientation_t | orientation, | ||
| occtl_node_id_t *const | out_coedge | ||
| ) |
Finds the coedge for an (edge, face, orientation) triple.
On seam edges two coedges share the same face with opposite orientations; this overload disambiguates by the requested orientation.
| [in] | graph | Must be non-NULL. |
| [in] | edge | Edge node ID. |
| [in] | face | Face node ID. |
| [in] | orientation | Orientation filter (by value). |
| [out] | out_coedge | Borrows it. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_coedge is NULL. |
| OCCTL_NOT_FOUND | edge or face is invalid/removed, or no coedge matches the triple. |
| OCCTL_WRONG_KIND | edge is not an edge or face is not a face. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_edge_has_continuity | ( | const occtl_graph_t *const | graph, |
| occtl_node_id_t | edge, | ||
| occtl_node_id_t | faceA, | ||
| occtl_node_id_t | faceB, | ||
| int32_t *const | out_has_continuity | ||
| ) |
Returns whether continuity information is recorded between two faces at a shared edge.
| [in] | graph | Must be non-NULL. |
| [in] | edge | Edge node ID shared by both faces. |
| [in] | faceA | First face node ID. |
| [in] | faceB | Second face node ID. |
| [out] | out_has_continuity | Borrows it. Set to 1 if continuity is recorded, 0 otherwise. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_has_continuity is NULL. |
| OCCTL_NOT_FOUND | edge, faceA, or faceB is invalid or removed. |
| OCCTL_WRONG_KIND | A NodeId has the wrong kind. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_edge_has_polygon3d | ( | const occtl_graph_t *const | graph, |
| occtl_node_id_t | edge, | ||
| int32_t *const | out_has_polygon3d | ||
| ) |
Returns whether an edge has a 3D polygon discretization.
| [in] | graph | Must be non-NULL. |
| [in] | edge | Edge node ID. |
| [out] | out_has_polygon3d | Borrows it. Set to 1 if polygon present, 0 otherwise. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_has_polygon3d is NULL. |
| OCCTL_NOT_FOUND | edge is invalid, removed, or not an edge. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_edge_max_continuity | ( | const occtl_graph_t *const | graph, |
| occtl_node_id_t | edge, | ||
| occtl_shape_continuity_t *const | out_continuity | ||
| ) |
Returns the maximum continuity across all incident faces at an edge.
This is the highest continuity value across every face pair that shares edge.
| [in] | graph | Must be non-NULL. |
| [in] | edge | Edge node ID. |
| [out] | out_continuity | Borrows it. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_continuity is NULL. |
| OCCTL_NOT_FOUND | edge is invalid or removed. |
| OCCTL_WRONG_KIND | edge is not an edge. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_edge_remove_vertex | ( | occtl_graph_t * | graph, |
| occtl_node_id_t | edge, | ||
| occtl_node_id_t | vertex | ||
| ) |
Removes a vertex from an edge.
Supports both boundary vertices (start/end) and internal vertices. The vertex definition is not deleted.
| [in,out] | graph | Borrows it. Must be non-NULL. |
| [in] | edge | Edge node ID. Must be a valid, active edge. |
| [in] | vertex | Vertex node ID. Must be the definition ID of a vertex referenced by the edge. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph is NULL. |
| OCCTL_NOT_FOUND | edge or vertex is invalid, removed, has wrong kind, or the vertex is not on the edge. |
| OCCTL_WRONG_KIND | edge is not an edge. |
\par Thread Safety No (mutates graph).
| occtl_status_t occtl_topo_edge_split | ( | occtl_graph_t * | graph, |
| occtl_node_id_t | edge, | ||
| double | parameter, | ||
| occtl_node_id_t * | out_edge1, | ||
| occtl_node_id_t * | out_edge2 | ||
| ) |
Splits an edge at the given parameter on its 3D curve.
Creates a new vertex at the split point and produces two sub-edges. The original edge is soft-removed; all wires containing it are updated to reference the two new edges.
| [in,out] | graph | Borrows it. Must be non-NULL. |
| [in] | edge | Edge node ID. Must be a valid, active edge with a 3D curve. |
| [in] | parameter | Parameter on the edge's 3D curve at which to split. |
| [out] | out_edge1 | Borrows it. Receives the first sub-edge NodeId (start → split). |
| [out] | out_edge2 | Borrows it. Receives the second sub-edge NodeId (split → end). |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or an out-param is NULL. |
| OCCTL_NOT_FOUND | edge is invalid, removed, not an edge, or the edge has no 3D curve. |
| OCCTL_WRONG_KIND | edge is not an edge. |
| OCCTL_ERROR | the operation was rejected. |
\par Thread Safety No (mutates graph).
| occtl_status_t occtl_topo_edges_to_wires | ( | occtl_graph_t * | graph, |
| const occtl_topo_edges_to_wires_options_t * | options, | ||
| occtl_node_id_t * | out_wires, | ||
| size_t | cap, | ||
| size_t * | out_count | ||
| ) |
Connects unordered Edge nodes into one or more Wire nodes.
On a sizing call, pass out_wires as NULL with cap = 0; the function writes the number of wires that would be created into out_count without mutating graph. Reissue with a buffer of at least that many occtl_node_id_t entries to create the wires and receive their IDs.
Endpoint matching prefers shared BRepGraph vertex IDs and falls back to endpoint point distance when options->tolerance > 0. Created wires reference the original Edge nodes; no Edge or Vertex nodes are duplicated.
| [in,out] | graph | Borrows it. Must be non-NULL. |
| [in] | options | Borrows it. Must be non-NULL. |
| [out] | out_wires | Borrows it. May be NULL on the sizing call. |
| [in] | cap | Capacity of out_wires in entries. |
| [out] | out_count | Borrows it. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph, options, or out_count is NULL; an options field is malformed; or open wires are produced while options->allow_open is 0. |
| OCCTL_VERSION_MISMATCH | options->struct_version unsupported. |
| OCCTL_NOT_FOUND | An Edge node ID is invalid or removed. |
| OCCTL_WRONG_KIND | An input node is not an Edge. |
| OCCTL_BUFFER_TOO_SMALL | out_wires is non-NULL and cap is too small. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety No (mutates graph when out_wires is non-NULL and large enough).
| void occtl_topo_edges_to_wires_options_init | ( | occtl_topo_edges_to_wires_options_t * | options | ) |
Initialises options to default values via OCCTL_TOPO_EDGES_TO_WIRES_OPTIONS_INIT.
NULL-tolerant.
| [out] | options | Borrows it. May be NULL (no-op). |
\par Thread Safety Yes.
| occtl_status_t occtl_topo_face_add_holes | ( | occtl_graph_t * | graph, |
| occtl_node_id_t | face, | ||
| const occtl_node_id_t * | holes, | ||
| size_t | hole_count | ||
| ) |
Adds inner wire references to a face without duplicating wire definitions.
Each entry in holes must name an active Wire definition. The function attaches each wire as a non-outer wire reference owned by face. Wires already referenced by face are rejected to avoid duplicate hole usages.
| [in,out] | graph | Borrows it. Must be non-NULL. |
| [in] | face | Face node ID. Must be a valid, active face. |
| [in] | holes | Borrowed span of Wire node IDs to add as holes. Must be non-NULL. |
| [in] | hole_count | Number of entries in holes. Must be greater than zero. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or holes is NULL; hole_count is zero; a hole ID appears more than once; or a wire is already referenced by face. |
| OCCTL_NOT_FOUND | face or a requested hole is invalid or removed. |
| OCCTL_WRONG_KIND | face is not a face, or a requested hole node is not a wire. |
| OCCTL_ERROR | The graph editor rejected the wire usage. |
\par Thread Safety No (mutates graph).
| occtl_status_t occtl_topo_face_chamfer_2d | ( | occtl_graph_t * | graph, |
| const occtl_topo_face_chamfer_2d_options_t * | options, | ||
| occtl_node_id_t * | out_face | ||
| ) |
Chamfers corners of a planar Face and inserts the result into the graph.
The source face must be planar. The chamfered Face is inserted into graph as a new Face node. The source face is not modified.
| [in,out] | graph | Borrows it. Must be non-NULL. |
| [in] | options | Borrows it. Must be non-NULL. |
| [out] | out_face | Borrows it. Must be non-NULL. Receives the new Face node ID. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph, options, or out_face is NULL; an options field is malformed; or a distance is non-positive / non-finite. |
| OCCTL_VERSION_MISMATCH | options->struct_version unsupported. |
| OCCTL_NOT_FOUND | options->face is invalid or removed; or a selected vertex is invalid / removed. |
| OCCTL_WRONG_KIND | options->face is not a Face node, or a selected node is not a Vertex. |
| OCCTL_GEOMETRY_INVALID | OCCT could not create a valid chamfered face. |
| OCCTL_TOPOLOGY_INVALID | The chamfer result could not be ingested as a graph Face. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety No (mutates graph).
| void occtl_topo_face_chamfer_2d_options_init | ( | occtl_topo_face_chamfer_2d_options_t * | options | ) |
Initialises options to default values via OCCTL_TOPO_FACE_CHAMFER_2D_OPTIONS_INIT.
NULL-tolerant.
| [out] | options | Borrows it. May be NULL (no-op). |
\par Thread Safety Yes.
| occtl_status_t occtl_topo_face_remove_holes | ( | occtl_graph_t * | graph, |
| occtl_node_id_t | face, | ||
| const occtl_node_id_t * | holes, | ||
| size_t | hole_count | ||
| ) |
Removes inner wire references from a face without deleting wire definitions.
When holes is NULL and hole_count is 0, all non-outer wire references are removed from face. Otherwise, holes must name inner Wire definition IDs referenced by face; each matching wire reference is detached. The outer wire is never removed by this function.
| [in,out] | graph | Borrows it. Must be non-NULL. |
| [in] | face | Face node ID. Must be a valid, active face. |
| [in] | holes | Borrowed span of inner Wire node IDs, or NULL to remove all inner wires. |
| [in] | hole_count | Number of entries in holes. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph is NULL; holes is NULL while hole_count > 0; or holes is non-NULL while hole_count == 0. |
| OCCTL_NOT_FOUND | face or a requested hole is invalid, removed, not referenced by face, or is the outer wire. |
| OCCTL_WRONG_KIND | face is not a face, or a requested hole node is not a wire. |
\par Thread Safety No (mutates graph).
| occtl_status_t occtl_topo_face_uv_bounds_restricted | ( | const occtl_graph_t *const | graph, |
| occtl_node_id_t | face, | ||
| double | umin, | ||
| double | umax, | ||
| double | vmin, | ||
| double | vmax, | ||
| double | u, | ||
| double | v, | ||
| occtl_point3_t *const | out_point, | ||
| occtl_vector3_t *const | out_d1u, | ||
| occtl_vector3_t *const | out_d1v | ||
| ) |
Evaluates a face surface and its first partial derivatives inside a restricted UV box.
The surface is evaluated at (u, v). The adaptor is clamped to [umin, umax] x [vmin, vmax], which binds the evaluation range separately from the surface's natural bounds.
| [in] | graph | Must be non-NULL. |
| [in] | face | Face node ID. |
| [in] | umin | Lower U bound. |
| [in] | umax | Upper U bound. |
| [in] | vmin | Lower V bound. |
| [in] | vmax | Upper V bound. |
| [in] | u | U evaluation parameter. |
| [in] | v | V evaluation parameter. |
| [out] | out_point | Borrows it. Must be non-NULL. |
| [out] | out_d1u | Borrows it. Must be non-NULL. |
| [out] | out_d1v | Borrows it. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or an out-param is NULL. |
| OCCTL_NOT_FOUND | face is invalid, removed, or not a face. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_make_compound | ( | occtl_graph_t * | graph, |
| const occtl_topo_make_compound_info_t * | info, | ||
| occtl_node_id_t * | out_compound | ||
| ) |
Creates a compound in the graph from a span of mixed-kind (child, orientation) pairs.
| [in,out] | graph | Borrows it. Must be non-NULL. |
| [in] | info | Borrows it. Must be non-NULL. The children span is borrowed; it need not remain valid after the call returns. |
| [out] | out_compound | Borrows it. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph, info, or out_compound is NULL; or children is NULL when child_count > 0; or children is non-NULL when child_count == 0. |
| OCCTL_VERSION_MISMATCH | info->struct_version unsupported. |
| OCCTL_NOT_FOUND | A child NodeId is invalid or removed. |
| OCCTL_WRONG_KIND | A child NodeId does not have the expected kind. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety No (mutates graph).
| void occtl_topo_make_compound_info_init | ( | occtl_topo_make_compound_info_t * | info | ) |
Initialises info to default values via OCCTL_TOPO_MAKE_COMPOUND_INFO_INIT.
NULL-tolerant.
| [out] | info | Borrows it. May be NULL (no-op). |
\par Thread Safety Yes.
| occtl_status_t occtl_topo_make_compsolid | ( | occtl_graph_t * | graph, |
| const occtl_topo_make_compsolid_info_t * | info, | ||
| occtl_node_id_t * | out_compsolid | ||
| ) |
Creates a compsolid in the graph from a span of (solid, orientation) pairs.
| [in,out] | graph | Borrows it. Must be non-NULL. |
| [in] | info | Borrows it. Must be non-NULL. The solids span is borrowed; it need not remain valid after the call returns. |
| [out] | out_compsolid | Borrows it. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph, info, or out_compsolid is NULL; or solids is NULL when solid_count > 0; or solids is non-NULL when solid_count == 0. |
| OCCTL_VERSION_MISMATCH | info->struct_version unsupported. |
| OCCTL_NOT_FOUND | A child NodeId is invalid or removed. |
| OCCTL_WRONG_KIND | A child NodeId does not have the expected kind. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety No (mutates graph).
| void occtl_topo_make_compsolid_info_init | ( | occtl_topo_make_compsolid_info_t * | info | ) |
Initialises info to default values via OCCTL_TOPO_MAKE_COMPSOLID_INFO_INIT.
NULL-tolerant.
| [out] | info | Borrows it. May be NULL (no-op). |
\par Thread Safety Yes.
| occtl_status_t occtl_topo_make_edge | ( | occtl_graph_t * | graph, |
| const occtl_topo_make_edge_info_t * | info, | ||
| occtl_node_id_t * | out_edge | ||
| ) |
Creates an edge in the graph.
| [in,out] | graph | Borrows it. Must be non-NULL. |
| [in] | info | Borrows it. Must be non-NULL. start_vertex and end_vertex must be valid, active vertex NodeIds. curve may be NULL for a degenerate edge. |
| [out] | out_edge | Borrows it. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph, info, or out_edge is NULL. |
| OCCTL_VERSION_MISMATCH | info->struct_version unsupported. |
| OCCTL_NOT_FOUND | A vertex NodeId is invalid or removed. |
| OCCTL_WRONG_KIND | A vertex NodeId is not a vertex. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety No (mutates graph).
| void occtl_topo_make_edge_info_init | ( | occtl_topo_make_edge_info_t * | info | ) |
Initialises info to default values via OCCTL_TOPO_MAKE_EDGE_INFO_INIT.
NULL-tolerant.
| [out] | info | Borrows it. May be NULL (no-op). |
\par Thread Safety Yes.
| occtl_status_t occtl_topo_make_face | ( | occtl_graph_t * | graph, |
| const occtl_topo_make_face_info_t * | info, | ||
| occtl_node_id_t * | out_face | ||
| ) |
Creates a face in the graph from a surface, outer wire, and optional inner wires.
| [in,out] | graph | Borrows it. Must be non-NULL. |
| [in] | info | Borrows it. Must be non-NULL. surface must be non-NULL. The inner-wires span is borrowed; it need not remain valid after the call returns. |
| [out] | out_face | Borrows it. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph, info, out_face, or info->surface is NULL. |
| OCCTL_VERSION_MISMATCH | info->struct_version unsupported. |
| OCCTL_NOT_FOUND | A wire NodeId is invalid or removed. |
| OCCTL_WRONG_KIND | A wire NodeId is not a wire. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety No (mutates graph).
| occtl_status_t occtl_topo_make_face_from_wires_auto | ( | occtl_graph_t * | graph, |
| const occtl_topo_make_face_from_wires_auto_options_t * | options, | ||
| occtl_node_id_t * | out_face | ||
| ) |
Creates a face by classifying candidate wires into outer and inner loops.
The function classifies the candidate Wires by planar enclosed area and uses the largest unambiguous loop as the outer wire. All other input wires become inner wires in their input order. The stored graph Face references the original Wire nodes; no boundary topology is duplicated.
| [in,out] | graph | Borrows it. Must be non-NULL. |
| [in] | options | Borrows it. Must be non-NULL. |
| [out] | out_face | Borrows it. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph, options, out_face, options->surface, or options->wires is NULL; wire_count is 0; an option value is malformed; or the outer wire is ambiguous. |
| OCCTL_VERSION_MISMATCH | options->struct_version unsupported. |
| OCCTL_NOT_FOUND | A Wire node ID is invalid or removed. |
| OCCTL_WRONG_KIND | An input node is not a Wire. |
| OCCTL_ERROR | The candidate wires could not be classified. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety No (mutates graph).
| void occtl_topo_make_face_from_wires_auto_options_init | ( | occtl_topo_make_face_from_wires_auto_options_t * | options | ) |
Initialises options to default values via OCCTL_TOPO_MAKE_FACE_FROM_WIRES_AUTO_OPTIONS_INIT.
NULL-tolerant.
| [out] | options | Borrows it. May be NULL (no-op). |
\par Thread Safety Yes.
| void occtl_topo_make_face_info_init | ( | occtl_topo_make_face_info_t * | info | ) |
Initialises info to default values via OCCTL_TOPO_MAKE_FACE_INFO_INIT.
NULL-tolerant.
| [out] | info | Borrows it. May be NULL (no-op). |
\par Thread Safety Yes.
| occtl_status_t occtl_topo_make_shell | ( | occtl_graph_t * | graph, |
| const occtl_topo_make_shell_info_t * | info, | ||
| occtl_node_id_t * | out_shell | ||
| ) |
Creates a shell in the graph from a span of (face, orientation) pairs.
| [in,out] | graph | Borrows it. Must be non-NULL. |
| [in] | info | Borrows it. Must be non-NULL. The faces span is borrowed; it need not remain valid after the call returns. |
| [out] | out_shell | Borrows it. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph, info, or out_shell is NULL; or faces is NULL when face_count > 0; or faces is non-NULL when face_count == 0. |
| OCCTL_VERSION_MISMATCH | info->struct_version unsupported. |
| OCCTL_NOT_FOUND | A child NodeId is invalid or removed. |
| OCCTL_WRONG_KIND | A child NodeId does not have the expected kind. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety No (mutates graph).
| void occtl_topo_make_shell_info_init | ( | occtl_topo_make_shell_info_t * | info | ) |
Initialises info to default values via OCCTL_TOPO_MAKE_SHELL_INFO_INIT.
NULL-tolerant.
| [out] | info | Borrows it. May be NULL (no-op). |
\par Thread Safety Yes.
| occtl_status_t occtl_topo_make_solid | ( | occtl_graph_t * | graph, |
| const occtl_topo_make_solid_info_t * | info, | ||
| occtl_node_id_t * | out_solid | ||
| ) |
Creates a solid in the graph from a span of (shell, orientation) pairs.
| [in,out] | graph | Borrows it. Must be non-NULL. |
| [in] | info | Borrows it. Must be non-NULL. The shells span is borrowed; it need not remain valid after the call returns. |
| [out] | out_solid | Borrows it. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph, info, or out_solid is NULL; or shells is NULL when shell_count > 0; or shells is non-NULL when shell_count == 0. |
| OCCTL_VERSION_MISMATCH | info->struct_version unsupported. |
| OCCTL_NOT_FOUND | A child NodeId is invalid or removed. |
| OCCTL_WRONG_KIND | A child NodeId does not have the expected kind. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety No (mutates graph).
| void occtl_topo_make_solid_info_init | ( | occtl_topo_make_solid_info_t * | info | ) |
Initialises info to default values via OCCTL_TOPO_MAKE_SOLID_INFO_INIT.
NULL-tolerant.
| [out] | info | Borrows it. May be NULL (no-op). |
\par Thread Safety Yes.
| occtl_status_t occtl_topo_make_vertex | ( | occtl_graph_t * | graph, |
| const occtl_topo_make_vertex_info_t * | info, | ||
| occtl_node_id_t * | out_vertex | ||
| ) |
Creates a vertex in the graph.
| [in,out] | graph | Borrows it. Must be non-NULL. |
| [in] | info | Borrows it. Must be non-NULL. |
| [out] | out_vertex | Borrows it. Must be non-NULL. Receives the new vertex NodeId on success. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph, info, or out_vertex is NULL. |
| OCCTL_VERSION_MISMATCH | info->struct_version is unsupported. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety No (mutates graph).
| void occtl_topo_make_vertex_info_init | ( | occtl_topo_make_vertex_info_t * | info | ) |
Initialises info to default values via OCCTL_TOPO_MAKE_VERTEX_INFO_INIT.
NULL-tolerant.
| [out] | info | Borrows it. May be NULL (no-op). |
\par Thread Safety Yes.
| occtl_status_t occtl_topo_make_wire | ( | occtl_graph_t * | graph, |
| const occtl_topo_make_wire_info_t * | info, | ||
| occtl_node_id_t * | out_wire | ||
| ) |
Creates a wire in the graph from an ordered span of (edge, orientation) pairs.
| [in,out] | graph | Borrows it. Must be non-NULL. |
| [in] | info | Borrows it. Must be non-NULL. The edges span is borrowed; it need not remain valid after the call returns. |
| [out] | out_wire | Borrows it. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph, info, or out_wire is NULL; or edges is NULL when edge_count > 0; or edges is non-NULL when edge_count == 0. |
| OCCTL_VERSION_MISMATCH | info->struct_version unsupported. |
| OCCTL_NOT_FOUND | A child NodeId is invalid or removed. |
| OCCTL_WRONG_KIND | A child NodeId does not have the expected kind. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety No (mutates graph).
| void occtl_topo_make_wire_info_init | ( | occtl_topo_make_wire_info_t * | info | ) |
Initialises info to default values via OCCTL_TOPO_MAKE_WIRE_INFO_INIT.
NULL-tolerant.
| [out] | info | Borrows it. May be NULL (no-op). |
\par Thread Safety Yes.
| occtl_status_t occtl_topo_remove | ( | occtl_graph_t * | graph, |
| occtl_node_id_t | id | ||
| ) |
Removes a node from the graph.
The node's children (direct references) are also removed. Removing a node that is referenced by other active nodes is valid: those references become dangling and will resolve to invalid on subsequent refinement.
| [in,out] | graph | Borrows it. Must be non-NULL. |
| [in] | id | NodeId of the entity to remove. All-zero value returns OCCTL_NOT_FOUND. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph is NULL, or first/ non-finite, or last is less than first. |
| OCCTL_NOT_FOUND | id is invalid or already removed. |
\par Thread Safety No (mutates graph).
| occtl_status_t occtl_topo_remove_ref | ( | occtl_graph_t * | graph, |
| occtl_ref_id_t | ref_id | ||
| ) |
Removes a reference entry by its RefId.
This is the builder-level API for detaching a child usage from its parent without removing the referenced definition itself.
| [in,out] | graph | Borrows it. Must be non-NULL. |
| [in] | ref_id | Reference entry to remove. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph is NULL. |
| OCCTL_NOT_FOUND | ref_id is invalid or already removed. |
\par Thread Safety No (mutates graph).
| occtl_status_t occtl_topo_remove_rep | ( | occtl_graph_t * | graph, |
| occtl_rep_id_t | rep_id | ||
| ) |
Removes a representation entry by its RepId.
Owning topology entities are marked modified so generation-based caches observe the representation as absent.
| [in,out] | graph | Borrows it. Must be non-NULL. |
| [in] | rep_id | Representation entry to remove. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph is NULL. |
| OCCTL_NOT_FOUND | rep_id is invalid or already removed. |
\par Thread Safety No (mutates graph).
| occtl_status_t occtl_topo_remove_subgraph | ( | occtl_graph_t * | graph, |
| occtl_node_id_t | id | ||
| ) |
Recursively removes a node and its entire subgraph.
All descendants reachable through reference edges are removed.
| [in,out] | graph | Borrows it. Must be non-NULL. |
| [in] | id | NodeId of the root to remove. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph is NULL. |
| OCCTL_NOT_FOUND | id is invalid or already removed. |
\par Thread Safety No (mutates graph).
| occtl_status_t occtl_topo_remove_with_replacement | ( | occtl_graph_t * | graph, |
| occtl_node_id_t | node, | ||
| occtl_node_id_t | replacement | ||
| ) |
Removes a node and reparents its children to a replacement node.
For edge nodes: all CoEdges referencing the removed edge are reparented to the replacement edge. Metadata observers are notified with both old and replacement NodeIds for data migration.
| [in,out] | graph | Borrows it. Must be non-NULL. |
| [in] | node | NodeId of the entity to remove. |
| [in] | replacement | NodeId of the replacement entity. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph is NULL. |
| OCCTL_NOT_FOUND | node or replacement is invalid or removed. |
\par Thread Safety No (mutates graph).
| occtl_status_t occtl_topo_replace_coedge_pcurve | ( | occtl_graph_t * | graph, |
| occtl_node_id_t | coedge, | ||
| occtl_rep_id_t | pcurve_id | ||
| ) |
Replaces the PCurve of a coedge.
Pass pcurve_id == OCCTL_REP_ID_INVALID to clear the PCurve binding.
| [in,out] | graph | Borrows it. Must be non-NULL. |
| [in] | coedge | CoEdge node ID. Must be a valid, active coedge. |
| [in] | pcurve_id | Rep ID of the 2D curve node to bind, or OCCTL_REP_ID_INVALID to clear. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph is NULL. |
| OCCTL_NOT_FOUND | coedge is invalid, removed, or not a coedge. |
| OCCTL_WRONG_KIND | coedge is not a coedge. |
\par Thread Safety No (mutates graph).
| occtl_status_t occtl_topo_replace_edge_curve | ( | occtl_graph_t * | graph, |
| occtl_node_id_t | edge, | ||
| occtl_rep_id_t | curve_id | ||
| ) |
Replaces the 3D curve of an edge.
Replaces the underlying Curve3DRep geometry without rebuilding the edge topology. Callers can later query the new extent through occtl_topo_edge_range or evaluate via occtl_topo_edge_eval.
Passing curve_id == OCCTL_REP_ID_INVALID clears the curve binding, making the edge degenerate.
| [in,out] | graph | Borrows it. Must be non-NULL. |
| [in] | edge | Edge node ID. Must be a valid, active edge. |
| [in] | curve_id | Rep ID of the 3D curve node to bind, or OCCTL_REP_ID_INVALID to clear. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph is NULL. |
| OCCTL_NOT_FOUND | edge is invalid, removed, or not an edge. |
| OCCTL_WRONG_KIND | edge is not an edge. |
\par Thread Safety No (mutates graph).
| occtl_status_t occtl_topo_replace_face_surface | ( | occtl_graph_t * | graph, |
| occtl_node_id_t | face, | ||
| occtl_rep_id_t | surface_id | ||
| ) |
Replaces the surface of a face.
Replaces the underlying SurfaceRep geometry without rebuilding the face topology. Passing surface_id == OCCTL_REP_ID_INVALID clears the surface binding.
| [in,out] | graph | Borrows it. Must be non-NULL. |
| [in] | face | Face node ID. Must be a valid, active face. |
| [in] | surface_id | Rep ID of the surface node to bind, or OCCTL_REP_ID_INVALID to clear. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph is NULL. |
| OCCTL_NOT_FOUND | face is invalid, removed, or not a face. |
| OCCTL_WRONG_KIND | face is not a face. |
\par Thread Safety No (mutates graph).
| occtl_status_t occtl_topo_set_coedge_param_range | ( | occtl_graph_t * | graph, |
| occtl_node_id_t | coedge, | ||
| double | first, | ||
| double | last | ||
| ) |
Sets the parametric range of a coedge.
| [in,out] | graph | Borrows it. Must be non-NULL. |
| [in] | coedge | CoEdge node ID. |
| [in] | first | First parameter (lower bound). |
| [in] | last | Last parameter (upper bound). |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph is NULL, or first/ non-finite, or last is less than first. |
| OCCTL_NOT_FOUND | coedge is invalid, removed, or not a coedge. |
\par Thread Safety No (mutates graph).
| occtl_status_t occtl_topo_set_coedge_uv_box | ( | occtl_graph_t * | graph, |
| occtl_node_id_t | coedge, | ||
| occtl_point2_t | uv_lo, | ||
| occtl_point2_t | uv_hi | ||
| ) |
Sets the UV box (start UV, end UV) of a coedge.
| [in,out] | graph | Borrows it. Must be non-NULL. |
| [in] | coedge | CoEdge node ID. |
| [in] | uv_lo | UV point at parameter first (by value). |
| [in] | uv_hi | UV point at parameter last (by value). |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph is NULL. |
| OCCTL_NOT_FOUND | coedge is invalid, removed, or not a coedge. |
\par Thread Safety No (mutates graph).
| occtl_status_t occtl_topo_set_edge_end_vertex | ( | occtl_graph_t * | graph, |
| occtl_node_id_t | edge, | ||
| occtl_node_id_t | vertex | ||
| ) |
Rebinds an edge's end vertex to a different vertex definition.
Rebinds an edge's start vertex to a different vertex definition.
Rewires the existing start-vertex reference to point to vertex. The previous vertex definition is no longer referenced by this edge.
| [in,out] | graph | Borrows it. Must be non-NULL. |
| [in] | edge | Edge node ID. Must be a valid, active edge. |
| [in] | vertex | Vertex node ID. Must be a valid, active vertex. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph is NULL. |
| OCCTL_NOT_FOUND | edge or vertex is invalid or removed. |
| OCCTL_WRONG_KIND | edge is not an edge or vertex is not a vertex. |
\par Thread Safety No (mutates graph).
| occtl_status_t occtl_topo_set_edge_is_closed | ( | occtl_graph_t * | graph, |
| occtl_node_id_t | edge, | ||
| int32_t | flag | ||
| ) |
Sets the is-closed flag on an edge (start vertex == end vertex).
| [in,out] | graph | Borrows it. Must be non-NULL. |
| [in] | edge | Edge node ID. |
| [in] | flag | 1 to mark closed, 0 otherwise. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph is NULL. |
| OCCTL_NOT_FOUND | edge is invalid, removed, or not an edge. |
\par Thread Safety No (mutates graph).
| occtl_status_t occtl_topo_set_edge_is_degenerate | ( | occtl_graph_t * | graph, |
| occtl_node_id_t | edge, | ||
| int32_t | flag | ||
| ) |
Sets the is-degenerate flag on an edge.
| [in,out] | graph | Borrows it. Must be non-NULL. |
| [in] | edge | Edge node ID. |
| [in] | flag | 1 to mark degenerate, 0 otherwise. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph is NULL. |
| OCCTL_NOT_FOUND | edge is invalid, removed, or not an edge. |
\par Thread Safety No (mutates graph).
| occtl_status_t occtl_topo_set_edge_param_range | ( | occtl_graph_t * | graph, |
| occtl_node_id_t | edge, | ||
| double | first, | ||
| double | last | ||
| ) |
Sets the parametric range of an edge's 3D curve.
| [in,out] | graph | Borrows it. Must be non-NULL. |
| [in] | edge | Edge node ID. |
| [in] | first | First parameter (lower bound). |
| [in] | last | Last parameter (upper bound). |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph is NULL, or first/ non-finite, or last is less than first. |
| OCCTL_NOT_FOUND | edge is invalid, removed, or not an edge. |
\par Thread Safety No (mutates graph).
| occtl_status_t occtl_topo_set_edge_same_parameter | ( | occtl_graph_t * | graph, |
| occtl_node_id_t | edge, | ||
| int32_t | flag | ||
| ) |
Sets the same-parameter flag on an edge.
| [in,out] | graph | Borrows it. Must be non-NULL. |
| [in] | edge | Edge node ID. |
| [in] | flag | 1 to set, 0 to clear. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph is NULL, or first/ non-finite, or last is less than first. |
| OCCTL_NOT_FOUND | edge is invalid, removed, or not an edge. |
\par Thread Safety No (mutates graph).
| occtl_status_t occtl_topo_set_edge_same_range | ( | occtl_graph_t * | graph, |
| occtl_node_id_t | edge, | ||
| int32_t | flag | ||
| ) |
Sets the same-range flag on an edge.
| [in,out] | graph | Borrows it. Must be non-NULL. |
| [in] | edge | Edge node ID. |
| [in] | flag | 1 to set, 0 to clear. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph is NULL. |
| OCCTL_NOT_FOUND | edge is invalid, removed, or not an edge. |
\par Thread Safety No (mutates graph).
| occtl_status_t occtl_topo_set_edge_start_vertex | ( | occtl_graph_t * | graph, |
| occtl_node_id_t | edge, | ||
| occtl_node_id_t | vertex | ||
| ) |
Rebinds an edge's start vertex to a different vertex definition.
Rewires the existing start-vertex reference to point to vertex. The previous vertex definition is no longer referenced by this edge.
| [in,out] | graph | Borrows it. Must be non-NULL. |
| [in] | edge | Edge node ID. Must be a valid, active edge. |
| [in] | vertex | Vertex node ID. Must be a valid, active vertex. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph is NULL. |
| OCCTL_NOT_FOUND | edge or vertex is invalid or removed. |
| OCCTL_WRONG_KIND | edge is not an edge or vertex is not a vertex. |
\par Thread Safety No (mutates graph).
| occtl_status_t occtl_topo_set_edge_tolerance | ( | occtl_graph_t * | graph, |
| occtl_node_id_t | edge, | ||
| double | tol | ||
| ) |
Sets the tolerance of an edge.
| [in,out] | graph | Borrows it. Must be non-NULL. |
| [in] | edge | Edge node ID. |
| [in] | tol | New tolerance value. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph is NULL, or tol is negative or non-finite. |
| OCCTL_NOT_FOUND | edge is invalid, removed, or not an edge. |
\par Thread Safety No (mutates graph).
| occtl_status_t occtl_topo_set_face_natural_restriction | ( | occtl_graph_t * | graph, |
| occtl_node_id_t | face, | ||
| int32_t | flag | ||
| ) |
Sets the natural-restriction flag on a face.
| [in,out] | graph | Borrows it. Must be non-NULL. |
| [in] | face | Face node ID. |
| [in] | flag | 1 to set natural restriction, 0 to clear. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph is NULL. |
| OCCTL_NOT_FOUND | face is invalid, removed, or not a face. |
\par Thread Safety No (mutates graph).
| occtl_status_t occtl_topo_set_face_tolerance | ( | occtl_graph_t * | graph, |
| occtl_node_id_t | face, | ||
| double | tol | ||
| ) |
Sets the tolerance of a face.
| [in,out] | graph | Borrows it. Must be non-NULL. |
| [in] | face | Face node ID. |
| [in] | tol | New tolerance value. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph is NULL, or tol is negative or non-finite. |
| OCCTL_NOT_FOUND | face is invalid, removed, or not a face. |
\par Thread Safety No (mutates graph).
| occtl_status_t occtl_topo_set_ref_location | ( | occtl_graph_t * | graph, |
| occtl_ref_id_t | ref_id, | ||
| occtl_transform_t | transform | ||
| ) |
Sets the local location of a reference entry.
Dispatches internally by RefId kind. Supported ref kinds: Shell, Face, Wire, CoEdge, Vertex, Solid, Child, Occurrence.
| [in,out] | graph | Borrows it. Must be non-NULL. |
| [in] | ref_id | Reference entry to modify. |
| [in] | transform | New local location as an affine transform. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph is NULL. |
| OCCTL_NOT_FOUND | ref_id is invalid or removed. |
\par Thread Safety No (mutates graph).
| occtl_status_t occtl_topo_set_ref_orientation | ( | occtl_graph_t * | graph, |
| occtl_ref_id_t | ref_id, | ||
| occtl_orientation_t | orientation | ||
| ) |
Sets the orientation of a reference entry.
Dispatches internally by RefId kind. Supported ref kinds: Shell, Face, Wire, CoEdge, Vertex, Solid, Child.
| [in,out] | graph | Borrows it. Must be non-NULL. |
| [in] | ref_id | Reference entry to modify. |
| [in] | orientation | New orientation value. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph is NULL. |
| OCCTL_NOT_FOUND | ref_id is invalid or removed. |
\par Thread Safety No (mutates graph).
| occtl_status_t occtl_topo_set_shell_is_closed | ( | occtl_graph_t * | graph, |
| occtl_node_id_t | shell, | ||
| int32_t | flag | ||
| ) |
Sets the is-closed flag on a shell (watertightness).
| [in,out] | graph | Borrows it. Must be non-NULL. |
| [in] | shell | Shell node ID. |
| [in] | flag | 1 to mark closed, 0 otherwise. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph is NULL. |
| OCCTL_NOT_FOUND | shell is invalid, removed, or not a shell. |
\par Thread Safety No (mutates graph).
| occtl_status_t occtl_topo_set_vertex_point | ( | occtl_graph_t * | graph, |
| occtl_node_id_t | vertex, | ||
| occtl_point3_t | point | ||
| ) |
Sets the 3D point of a vertex.
| [in,out] | graph | Borrows it. Must be non-NULL. |
| [in] | vertex | Vertex node ID. |
| [in] | point | New point coordinates (by value). |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph is NULL, or tol is negative or non-finite. |
| OCCTL_NOT_FOUND | vertex is invalid, removed, or not a vertex. |
\par Thread Safety No (mutates graph).
| occtl_status_t occtl_topo_set_vertex_tolerance | ( | occtl_graph_t * | graph, |
| occtl_node_id_t | vertex, | ||
| double | tol | ||
| ) |
Sets the tolerance of a vertex.
| [in,out] | graph | Borrows it. Must be non-NULL. |
| [in] | vertex | Vertex node ID. |
| [in] | tol | New tolerance value. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph is NULL, or tol is negative or non-finite. |
| OCCTL_NOT_FOUND | vertex is invalid, removed, or not a vertex. |
\par Thread Safety No (mutates graph).
| occtl_status_t occtl_topo_set_wire_is_closed | ( | occtl_graph_t * | graph, |
| occtl_node_id_t | wire, | ||
| int32_t | flag | ||
| ) |
Sets the is-closed flag on a wire.
| [in,out] | graph | Borrows it. Must be non-NULL. |
| [in] | wire | Wire node ID. |
| [in] | flag | 1 to mark closed, 0 otherwise. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph is NULL. |
| OCCTL_NOT_FOUND | wire is invalid, removed, or not a wire. |
\par Thread Safety No (mutates graph).
| occtl_status_t occtl_topo_set_wire_ref_is_outer | ( | occtl_graph_t * | graph, |
| occtl_ref_id_t | ref_id, | ||
| int32_t | flag | ||
| ) |
Sets the IsOuter flag on a wire reference (marks it as the outer wire on a face).
| [in,out] | graph | Borrows it. Must be non-NULL. |
| [in] | ref_id | Wire reference entry to modify. |
| [in] | flag | 1 to mark as outer wire, 0 to clear. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph is NULL. |
| OCCTL_NOT_FOUND | ref_id is invalid, removed, or not a wire ref. |
\par Thread Safety No (mutates graph).
| occtl_status_t occtl_topo_shell_add_face | ( | occtl_graph_t * | graph, |
| occtl_node_id_t | shell, | ||
| occtl_node_id_t | face, | ||
| occtl_orientation_t | orientation | ||
| ) |
Adds a face to an existing shell.
| [in,out] | graph | Borrows it. Must be non-NULL. |
| [in] | shell | Shell node ID. Must be a valid, active shell. |
| [in] | face | Face node ID. Must be a valid, active face. |
| [in] | orientation | Orientation of the face inside the shell. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph is NULL. |
| OCCTL_NOT_FOUND | shell or face is invalid or removed. |
| OCCTL_WRONG_KIND | shell is not a shell or face is not a face. |
| OCCTL_ERROR | the operation was rejected. |
\par Thread Safety No (mutates graph).
| occtl_status_t occtl_topo_shell_remove_face | ( | occtl_graph_t * | graph, |
| occtl_node_id_t | shell, | ||
| occtl_node_id_t | face | ||
| ) |
Removes a face from a shell without deleting the face definition.
The face remains in the graph for use by other shells or compounds.
| [in,out] | graph | Borrows it. Must be non-NULL. |
| [in] | shell | Shell node ID. Must be a valid, active shell. |
| [in] | face | Face node ID. Must be the definition ID of a face referenced by the shell. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph is NULL. |
| OCCTL_NOT_FOUND | shell or face is invalid, removed, has wrong kind, or the face is not in the shell. |
| OCCTL_WRONG_KIND | shell is not a shell. |
\par Thread Safety No (mutates graph).
| occtl_status_t occtl_topo_solid_add_shell | ( | occtl_graph_t * | graph, |
| occtl_node_id_t | solid, | ||
| occtl_node_id_t | shell, | ||
| occtl_orientation_t | orientation | ||
| ) |
Adds a shell to an existing solid.
| [in,out] | graph | Borrows it. Must be non-NULL. |
| [in] | solid | Solid node ID. Must be a valid, active solid. |
| [in] | shell | Shell node ID. Must be a valid, active shell. |
| [in] | orientation | Orientation of the shell inside the solid. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph is NULL. |
| OCCTL_NOT_FOUND | solid or shell is invalid or removed. |
| OCCTL_WRONG_KIND | solid is not a solid or shell is not a shell. |
| OCCTL_ERROR | the operation was rejected. |
\par Thread Safety No (mutates graph).
| occtl_status_t occtl_topo_solid_remove_shell | ( | occtl_graph_t * | graph, |
| occtl_node_id_t | solid, | ||
| occtl_node_id_t | shell | ||
| ) |
Removes a shell from a solid without deleting the shell definition.
| [in,out] | graph | Borrows it. Must be non-NULL. |
| [in] | solid | Solid node ID. Must be a valid, active solid. |
| [in] | shell | Shell node ID. Must be the definition ID of a shell referenced by the solid. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph is NULL. |
| OCCTL_NOT_FOUND | solid or shell is invalid, removed, has wrong kind, or the shell is not in the solid. |
| OCCTL_WRONG_KIND | solid is not a solid. |
\par Thread Safety No (mutates graph).
| occtl_status_t occtl_topo_vertex_pcurve_parameter | ( | const occtl_graph_t *const | graph, |
| occtl_node_id_t | vertex, | ||
| occtl_node_id_t | coedge, | ||
| double *const | out_u | ||
| ) |
Returns the 2D parameter of a vertex on a coedge's pcurve.
| [in] | graph | Must be non-NULL. |
| [in] | vertex | Vertex node ID. |
| [in] | coedge | CoEdge node ID. |
| [out] | out_u | Borrows it. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_u is NULL. |
| OCCTL_NOT_FOUND | vertex or coedge is invalid or removed. |
| OCCTL_WRONG_KIND | vertex is not a vertex or coedge is not a coedge. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_vertex_point_in_usage | ( | const occtl_graph_t *const | graph, |
| occtl_node_id_t | vertex, | ||
| occtl_node_id_t | parent, | ||
| occtl_point3_t *const | out_point | ||
| ) |
Returns the 3D point of a vertex with the parent's Location applied.
The parent can be any node that references the vertex (edge, face, compound, occurrence, etc.). The returned point incorporates the Location from the parent's reference chain.
| [in] | graph | Must be non-NULL. |
| [in] | vertex | Vertex node ID. |
| [in] | parent | Parent node ID whose Location is applied. |
| [out] | out_point | Borrows it. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_point is NULL. |
| OCCTL_NOT_FOUND | vertex or parent is invalid or removed, or parent does not reference vertex. |
| OCCTL_WRONG_KIND | vertex is not a vertex. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_wire_chamfer_2d | ( | occtl_graph_t * | graph, |
| const occtl_topo_wire_chamfer_2d_options_t * | options, | ||
| occtl_node_id_t * | out_wire | ||
| ) |
Chamfers corners of a planar Wire and inserts the result into the graph.
The source wire must be planar. The resulting outer Wire is inserted into graph as a new Wire node. The source wire is not modified.
| [in,out] | graph | Borrows it. Must be non-NULL. |
| [in] | options | Borrows it. Must be non-NULL. |
| [out] | out_wire | Borrows it. Must be non-NULL. Receives the new Wire node ID. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph, options, or out_wire is NULL; an options field is malformed; or a distance is non-positive / non-finite. |
| OCCTL_VERSION_MISMATCH | options->struct_version unsupported. |
| OCCTL_NOT_FOUND | options->wire is invalid or removed; or a selected vertex is invalid / removed. |
| OCCTL_WRONG_KIND | options->wire is not a Wire node, or a selected node is not a Vertex. |
| OCCTL_GEOMETRY_INVALID | OCCT could not create a valid chamfered wire. |
| OCCTL_TOPOLOGY_INVALID | The chamfer result could not be ingested as a graph Wire. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety No (mutates graph).
| void occtl_topo_wire_chamfer_2d_options_init | ( | occtl_topo_wire_chamfer_2d_options_t * | options | ) |
Initialises options to default values via OCCTL_TOPO_WIRE_CHAMFER_2D_OPTIONS_INIT.
NULL-tolerant.
| [out] | options | Borrows it. May be NULL (no-op). |
\par Thread Safety Yes.
| occtl_status_t occtl_topo_wire_fix_degenerate | ( | occtl_graph_t * | graph, |
| const occtl_topo_wire_fix_degenerate_edges_options_t * | options, | ||
| size_t * | out_removed | ||
| ) |
Removes degenerate edge usages from a Wire in place.
The function scans the Wire's coedge usages, measures each underlying Edge with OCCT linear properties when possible, and detaches every usage whose length is less than or equal to options->min_length. The underlying Edge definitions are not deleted; only their usage in options->wire is removed. This makes the operation safe for shared graph topology.
| [in,out] | graph | Borrows it. Must be non-NULL. |
| [in] | options | Borrows it. Must be non-NULL. |
| [out] | out_removed | Borrows it. Must be non-NULL. Receives the number of detached coedge usages. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph, options, or out_removed is NULL; p_next is non-NULL; or min_length is negative / non-finite. |
| OCCTL_VERSION_MISMATCH | options->struct_version unsupported. |
| OCCTL_NOT_FOUND | options->wire is invalid or removed. |
| OCCTL_WRONG_KIND | options->wire is not a Wire node. |
\par Thread Safety No (mutates graph).
| void occtl_topo_wire_fix_degenerate_options_init | ( | occtl_topo_wire_fix_degenerate_edges_options_t * | options | ) |
Initialises options to default values via OCCTL_TOPO_WIRE_FIX_DEGENERATE_EDGES_OPTIONS_INIT.
NULL-tolerant.
| [out] | options | Borrows it. May be NULL (no-op). |
\par Thread Safety Yes.
| occtl_status_t occtl_topo_wire_offset_2d | ( | occtl_graph_t * | graph, |
| const occtl_topo_wire_offset_2d_options_t * | options, | ||
| occtl_node_id_t * | out_wire | ||
| ) |
Creates a planar 2D offset of a Wire node and inserts it into the graph.
The source wire must be planar. The resulting offset Wire is inserted into graph as a new Wire node. The source wire is not modified.
| [in,out] | graph | Borrows it. Must be non-NULL. |
| [in] | options | Borrows it. Must be non-NULL. |
| [out] | out_wire | Borrows it. Must be non-NULL. Receives the new Wire node ID. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph, options, or out_wire is NULL; an options field is malformed; or distance is zero / non-finite. |
| OCCTL_VERSION_MISMATCH | options->struct_version unsupported. |
| OCCTL_NOT_FOUND | options->wire is invalid or removed. |
| OCCTL_WRONG_KIND | options->wire is not a Wire node. |
| OCCTL_GEOMETRY_INVALID | OCCT could not create a valid offset wire. |
| OCCTL_TOPOLOGY_INVALID | The offset result could not be ingested as a graph Wire. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety No (mutates graph).
| void occtl_topo_wire_offset_2d_options_init | ( | occtl_topo_wire_offset_2d_options_t * | options | ) |
Initialises options to default values via OCCTL_TOPO_WIRE_OFFSET_2D_OPTIONS_INIT.
NULL-tolerant.
| [out] | options | Borrows it. May be NULL (no-op). |
\par Thread Safety Yes.