|
OCCT-Light 0.1
C ABI and C++ veneer for multi-language CAD workflows
|
OCCT-Light: Topology relation queries, hit tests, and contact analysis. More...
#include <stddef.h>#include <stdint.h>#include "occtl_core.h"#include "occtl_geom.h"#include "occtl_topo_types.h"

Go to the source code of this file.
Classes | |
| struct | occtl_oriented_node |
| struct | occtl_topo_child_explorer_config |
| struct | occtl_topo_parent_explorer_config |
| struct | occtl_topo_relation_options |
| struct | occtl_topo_distance_pair |
| struct | occtl_topo_axis_hit |
| struct | occtl_topo_touch_hit |
Macros | |
| #define | OCCTL_TOPO_CHILD_EXPLORER_CONFIG_VERSION_1 1u |
| #define | OCCTL_TOPO_CHILD_EXPLORER_CONFIG_INIT |
| #define | OCCTL_TOPO_PARENT_EXPLORER_CONFIG_VERSION_1 1u |
| #define | OCCTL_TOPO_PARENT_EXPLORER_CONFIG_INIT |
| #define | OCCTL_TOPO_RELATION_OPTIONS_VERSION_1 1u |
| #define | OCCTL_TOPO_RELATION_OPTIONS_INIT {OCCTL_TOPO_RELATION_OPTIONS_VERSION_1, NULL, 1.0e-7, 1, 1, 1} |
OCCT-Light: Topology relation queries, hit tests, and contact analysis.
Defines enums, structs, iterators, and functions for computing spatial relationships between topology entities: distance pairs, adjacency, connectivity, axis hits, touch points, intersection tests, and geometric classification.
| #define OCCTL_TOPO_CHILD_EXPLORER_CONFIG_INIT |
| #define OCCTL_TOPO_PARENT_EXPLORER_CONFIG_INIT |
| typedef enum occtl_orientation occtl_orientation_t |
Orientation used when placing a child entity inside its parent.
Values mirror TopAbs_Orientation 1:1 in numeric order so conversion is a static_cast (with a sanity assert in debug).
| typedef struct occtl_oriented_node occtl_oriented_node_t |
(NodeId, orientation) pair used in builder info structs and ordered traversal results to specify a child entity and its parent orientation.
Passed by value; embedded in spans inside info structs. Not versioned.
| typedef enum occtl_relation_kind occtl_relation_kind_t |
Semantic relation between two nodes in the graph.
| typedef enum occtl_shape_continuity occtl_shape_continuity_t |
Shape continuity level, mirroring GeomAbs_Shape.
Describes the geometric continuity at an edge between two adjacent faces.
| typedef struct occtl_topo_axis_hit_iter occtl_topo_axis_hit_iter_t |
Opaque iterator over axis/face intersection hits.
Created by occtl_topo_axis_intersect_faces and released with occtl_topo_axis_hit_iter_free.
\par Thread Safety No — single-owner; concurrent reads on distinct iterators are safe when the owning graph is not mutated.
| typedef struct occtl_topo_axis_hit occtl_topo_axis_hit_t |
One intersection between an axis and a face under a graph root.
Configuration for occtl_topo_child_explorer_create.
| typedef struct occtl_topo_distance_pair occtl_topo_distance_pair_t |
Closest-distance result between two graph nodes.
Support nodes are best-effort mappings from OCCT's support shapes back to graph node IDs. They are OCCTL_NODE_ID_INVALID when OCCT reports a support that is not represented by an active graph node.
| typedef struct occtl_topo_explorer_iter occtl_topo_explorer_iter_t |
Opaque iterator over accumulated-location/orientation graph traversal.
Created by occtl_topo_child_explorer_create and occtl_topo_parent_explorer_create. Each yield includes the current node's definition ID, accumulated transform, and accumulated orientation. Release with occtl_topo_explorer_iter_free.
\par Thread Safety No — single-owner; concurrent reads on distinct iterators over the same graph are safe when the graph is not mutated.
Traversal mode for child and parent explorers.
| typedef struct occtl_topo_intersection_iter occtl_topo_intersection_iter_t |
Opaque iterator over topology generated by an intersection query.
Created by occtl_topo_intersection_iter_create and released with occtl_topo_intersection_iter_free.
\par Thread Safety No — single-owner; concurrent reads on distinct iterators are safe when the owning graph is not mutated.
Configuration for occtl_topo_parent_explorer_create.
| typedef enum occtl_topo_point_class occtl_topo_point_class_t |
Point classification result for graph topology.
| typedef struct occtl_topo_related_iter occtl_topo_related_iter_t |
Opaque iterator over a node's semantic neighbours and their relation kinds.
Created by occtl_topo_related_iter_create. Release with occtl_topo_related_iter_free.
\par Thread Safety No — single-owner; concurrent reads on distinct iterators over the same graph are safe when the graph is not mutated.
| typedef struct occtl_topo_relation_options occtl_topo_relation_options_t |
Options for relation/contact queries.
The first version is used by occtl_topo_touch_iter_create. Tangent contacts are distance-zero solutions reported by OCCT. Overlap solutions are included when include_overlaps is 1; set it to 0 to suppress OCCT inner-overlap reports.
| typedef struct occtl_topo_touch_hit occtl_topo_touch_hit_t |
One contact solution between two graph nodes.
Support node IDs are best-effort mappings from OCCT support shapes back to original graph nodes. They may be OCCTL_NODE_ID_INVALID when OCCT reports a support that is not represented directly by an active graph node.
| typedef struct occtl_topo_touch_iter occtl_topo_touch_iter_t |
Opaque iterator over contact solutions between two graph nodes.
Created by occtl_topo_touch_iter_create and released with occtl_topo_touch_iter_free.
\par Thread Safety No — single-owner; concurrent reads on distinct iterators are safe when the owning graph is not mutated.
| enum occtl_orientation |
Orientation used when placing a child entity inside its parent.
Values mirror TopAbs_Orientation 1:1 in numeric order so conversion is a static_cast (with a sanity assert in debug).
| enum occtl_relation_kind |
Semantic relation between two nodes in the graph.
Shape continuity level, mirroring GeomAbs_Shape.
Describes the geometric continuity at an edge between two adjacent faces.
| occtl_status_t occtl_topo_adjacent_edges | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | edge, | ||
| occtl_node_id_t * | out_buf, | ||
| size_t | cap, | ||
| size_t * | out_count | ||
| ) |
Lists edges adjacent to edge through shared vertices.
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.
The input edge itself is not included.
| [in] | graph | Borrows it. Must be non-NULL. |
| [in] | edge | Edge node ID. |
| [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. |
| OCCTL_BUFFER_TOO_SMALL | out_buf is non-NULL and cap is too small. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_adjacent_faces | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | face, | ||
| occtl_node_id_t * | out_buf, | ||
| size_t | cap, | ||
| size_t * | out_count | ||
| ) |
Lists faces adjacent to face through shared edges.
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.
The input face itself is not included.
| [in] | graph | Borrows it. Must be non-NULL. |
| [in] | face | Face node ID. |
| [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. |
| OCCTL_BUFFER_TOO_SMALL | out_buf is non-NULL and cap is too small. |
\par Thread Safety Yes (read-only on graph).
| void occtl_topo_axis_hit_iter_free | ( | occtl_topo_axis_hit_iter_t * | iter | ) |
Releases an axis-hit iterator.
| [in] | iter | Owns it. May be NULL. |
\par Thread Safety Yes.
| occtl_status_t occtl_topo_axis_hit_iter_next | ( | occtl_topo_axis_hit_iter_t * | iter, |
| occtl_topo_axis_hit_t * | out_hit | ||
| ) |
Advances an axis-hit iterator.
| [in,out] | iter | Borrows it. Must be non-NULL. |
| [out] | out_hit | Borrows it. Must be non-NULL. |
| OCCTL_OK | Next hit written. |
| OCCTL_NOT_FOUND | Iterator exhausted. |
| OCCTL_INVALID_ARGUMENT | iter or out_hit is NULL. |
\par Thread Safety No (mutates iterator).
| occtl_status_t occtl_topo_axis_intersect_faces | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | root, | ||
| occtl_axis1_placement_t | axis, | ||
| double | min_parameter, | ||
| double | max_parameter, | ||
| double | tolerance, | ||
| occtl_topo_axis_hit_iter_t ** | out_iter | ||
| ) |
Creates an iterator over faces intersected by an axis under root.
The calculation is delegated to OCCT's face/curve intersector. Hits are ordered by signed axis parameter and include the hit point, UV parameters, and a best-effort oriented surface normal.
| [in] | graph | Borrows it. Must be non-NULL. |
| [in] | root | Root shape node whose faces are tested. |
| [in] | axis | Directed axis used as the query line. |
| [in] | min_parameter | Inclusive lower signed axis parameter. |
| [in] | max_parameter | Inclusive upper signed axis parameter. |
| [in] | tolerance | Intersection tolerance. Must be non-negative. |
| [out] | out_iter | Owns it. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_iter is NULL, tolerance is negative, the parameter interval is invalid, or axis direction is zero/non-finite. |
| OCCTL_NOT_FOUND | root is invalid or removed. |
| OCCTL_GEOMETRY_INVALID | OCCT could not complete the intersection. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety Yes (read-only on graph; uses local OCCT intersector state).
| void occtl_topo_child_explorer_config_init | ( | occtl_topo_child_explorer_config_t * | config | ) |
Initialises config to default values via OCCTL_TOPO_CHILD_EXPLORER_CONFIG_INIT.
NULL-tolerant.
| [out] | config | Borrows it. May be NULL (no-op). |
\par Thread Safety Yes.
| occtl_status_t occtl_topo_child_explorer_create | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | root, | ||
| const occtl_topo_child_explorer_config_t * | config, | ||
| occtl_topo_explorer_iter_t ** | out_iter | ||
| ) |
Creates a downward depth-first child explorer starting from root.
The explorer accumulates location and orientation along reference chains and yields each visited node with its accumulated transform and orientation. Use occtl_topo_explorer_iter_next to step and occtl_topo_explorer_iter_free to release.
| [in] | graph | Must be non-NULL. |
| [in] | root | Root node ID for the traversal. |
| [in] | config | Borrows it. May be NULL for defaults (recursive, all kinds, location+orientation accumulated). |
| [out] | out_iter | Owns it. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_iter is NULL, or config->p_next is non-NULL. |
| OCCTL_NOT_FOUND | root is invalid or removed. |
| OCCTL_VERSION_MISMATCH | config->struct_version unsupported. |
| OCCTL_OUT_OF_RANGE | config->mode, config->target_kind, or config->avoid_kind is not valid. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_classify_point | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | solid, | ||
| occtl_point3_t | point, | ||
| double | tolerance, | ||
| occtl_topo_point_class_t * | out_class | ||
| ) |
Classifies a 3D point relative to a solid node.
Classification is graph-native and delegates to OCCT BRepGraphAlgo_SolidClassifier.
| [in] | graph | Borrows it. Must be non-NULL. |
| [in] | solid | Solid node to classify against. |
| [in] | point | Point to classify. |
| [in] | tolerance | Tolerance for boundary detection. Must be non-negative. |
| [out] | out_class | Borrows it. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_class is NULL, or tolerance is negative. |
| OCCTL_NOT_FOUND | solid is invalid or removed. |
| OCCTL_WRONG_KIND | solid is not a solid. |
\par Thread Safety Yes (read-only on graph; may build classifier-local caches).
| occtl_status_t occtl_topo_closest_point_to_point | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | node, | ||
| occtl_point3_t | point, | ||
| occtl_point3_t * | out_closest, | ||
| double * | out_distance | ||
| ) |
Finds the closest point on a graph node to a world-space point.
The graph is not mutated. The returned point lies on node, and out_distance receives the world-space distance from point when requested.
| [in] | graph | Borrows it. Must be non-NULL. |
| [in] | node | Node to search. |
| [in] | point | Query point. |
| [out] | out_closest | Borrows it. Must be non-NULL. Receives the closest point on node. |
| [out] | out_distance | Borrows it. May be NULL. Receives the minimum distance. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_closest is NULL. |
| OCCTL_NOT_FOUND | node is invalid or removed. |
| OCCTL_GEOMETRY_INVALID | OCCT could not compute a closest solution. |
\par Thread Safety Yes (read-only on graph; may populate internal shape caches).
| occtl_status_t occtl_topo_common_vertices | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | node_a, | ||
| occtl_node_id_t | node_b, | ||
| occtl_node_id_t * | out_buf, | ||
| size_t | cap, | ||
| size_t * | out_count | ||
| ) |
Lists vertex nodes common to two graph roots.
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.
The order follows the first root's OCCT vertex traversal order. Duplicate vertex uses are collapsed.
| [in] | graph | Borrows it. Must be non-NULL. |
| [in] | node_a | First root node. |
| [in] | node_b | Second root node. |
| [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_a or node_b 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_topo_connected_edges | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | seed_edge, | ||
| occtl_node_id_t * | out_buf, | ||
| size_t | cap, | ||
| size_t * | out_count | ||
| ) |
Lists all edges connected to seed_edge through shared vertices.
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.
The seed edge is included in the result.
| [in] | graph | Borrows it. Must be non-NULL. |
| [in] | seed_edge | Edge where the walk starts. |
| [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 | seed_edge is invalid or removed. |
| OCCTL_WRONG_KIND | seed_edge is not an edge. |
| OCCTL_BUFFER_TOO_SMALL | out_buf is non-NULL and cap is too small. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_connected_faces | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | seed_face, | ||
| occtl_node_id_t * | out_buf, | ||
| size_t | cap, | ||
| size_t * | out_count | ||
| ) |
Lists all faces connected to seed_face through shared edges.
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.
The seed face is included in the result.
| [in] | graph | Borrows it. Must be non-NULL. |
| [in] | seed_face | Face where the walk starts. |
| [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 | seed_face is invalid or removed. |
| OCCTL_WRONG_KIND | seed_face is not a face. |
| OCCTL_BUFFER_TOO_SMALL | out_buf is non-NULL and cap is too small. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_distance_pair | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | node_a, | ||
| occtl_node_id_t | node_b, | ||
| occtl_topo_distance_pair_t * | out_pair | ||
| ) |
Computes the closest-distance pair between two graph nodes.
The calculation is delegated to OCCT and returns the minimum distance, closest points, and best-effort support-node IDs for the first closest solution.
| [in] | graph | Borrows it. Must be non-NULL. |
| [in] | node_a | First node to query. |
| [in] | node_b | Second node to query. |
| [out] | out_pair | Borrows it. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_pair is NULL. |
| OCCTL_NOT_FOUND | node_a or node_b is invalid or removed. |
| OCCTL_GEOMETRY_INVALID | OCCT could not compute a closest solution. |
\par Thread Safety Yes (read-only on graph; may populate internal shape caches).
| void occtl_topo_explorer_iter_free | ( | occtl_topo_explorer_iter_t * | iter | ) |
Releases an explorer iterator.
| [in] | iter | Owns it. NULL is a no-op. |
\par Thread Safety Yes.
| occtl_status_t occtl_topo_explorer_iter_next | ( | occtl_topo_explorer_iter_t * | iter, |
| occtl_node_id_t * | out_node, | ||
| occtl_transform_t * | out_transform, | ||
| occtl_orientation_t * | out_orientation | ||
| ) |
Advances the explorer iterator to the next node.
Writes the current node's definition ID, accumulated transform, and accumulated orientation.
| [in,out] | iter | Borrows it. Must be non-NULL. |
| [out] | out_node | Borrows it. Must be non-NULL. |
| [out] | out_transform | Borrows it. Must be non-NULL. |
| [out] | out_orientation | Borrows it. Must be non-NULL. |
| OCCTL_OK | Next value written. |
| OCCTL_NOT_FOUND | Exhausted; out params set to invalid/identity. |
| OCCTL_INVALID_ARGUMENT | An out-param is NULL. |
\par Thread Safety No (mutates iter; concurrent reads on distinct iters OK).
| occtl_status_t occtl_topo_graph_distance | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | root, | ||
| const occtl_node_id_t * | sources, | ||
| size_t | source_count, | ||
| occtl_node_id_t | target, | ||
| int32_t * | out_distance | ||
| ) |
Computes same-kind topological graph distance under a shared root.
Distance is the minimum number of adjacency hops from any source node to target while walking only peers of the same kind reachable from root. Supported peer kinds are Vertex, Edge, Wire, Face, Shell, and Solid. Vertex/Edge/Wire peers connect through shared vertices; Face peers connect through shared edges; Shell/Solid peers connect through shared faces.
A source node has distance 0 from itself. If target is reachable from root but not connected to any source peer, the function succeeds and writes -1 to out_distance.
| [in] | graph | Borrows it. Must be non-NULL. |
| [in] | root | Root that defines the peer set. Must be active. |
| [in] | sources | Borrows it. Array of source nodes. Must be non-NULL and contain source_count entries. |
| [in] | source_count | Number of entries in sources. Must be non-zero. |
| [in] | target | Target node. Must have the same kind as all sources. |
| [out] | out_distance | Borrows it. Must be non-NULL. Receives the hop count, or -1 when unreachable within the peer graph. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph, sources, or out_distance is NULL, or source_count is zero. |
| OCCTL_NOT_FOUND | root, target, or a source is invalid, removed, or not reachable from root. |
| OCCTL_WRONG_KIND | Sources and target are not the same kind, or the kind is not supported for this query. |
\par Thread Safety No (may populate graph caches for descendant vertices).
| occtl_status_t occtl_topo_intersection_iter_create | ( | occtl_graph_t * | graph, |
| occtl_node_id_t | node_a, | ||
| occtl_node_id_t | node_b, | ||
| const occtl_topo_relation_options_t * | options, | ||
| occtl_topo_intersection_iter_t ** | out_iter | ||
| ) |
Creates an iterator over topology generated by intersecting two graph nodes.
The calculation is delegated to OCCT section/common algorithms. Generated intersection topology is inserted into graph as fresh topology roots so returned NodeIds are meaningful in the caller's graph. Section edges and vertices are returned first. When options is NULL or include_overlaps is 1, an OCCT common result is also used to return overlap faces when the two inputs have area/volume overlap. The iterator is valid but empty when no requested intersection topology is produced.
| [in,out] | graph | Borrows it. Must be non-NULL. |
| [in] | node_a | First node to intersect. |
| [in] | node_b | Second node to intersect. |
| [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 options contains an invalid p_next, tolerance, or 0/1 flag. |
| OCCTL_VERSION_MISMATCH | options has an unsupported struct_version. |
| OCCTL_NOT_FOUND | node_a or node_b is invalid or removed. |
| OCCTL_GEOMETRY_INVALID | OCCT could not compute the intersection. |
| OCCTL_TOPOLOGY_INVALID | the generated topology could not be inserted. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety No (may mutate graph by inserting generated topology).
| void occtl_topo_intersection_iter_free | ( | occtl_topo_intersection_iter_t * | iter | ) |
Releases an intersection iterator.
| [in] | iter | Owns it. May be NULL. |
\par Thread Safety Yes.
| occtl_status_t occtl_topo_intersection_iter_next | ( | occtl_topo_intersection_iter_t * | iter, |
| occtl_node_id_t * | out_node | ||
| ) |
Advances an intersection iterator.
| [in,out] | iter | Borrows it. Must be non-NULL. |
| [out] | out_node | Borrows it. Must be non-NULL. |
| OCCTL_OK | Next generated node written. |
| OCCTL_NOT_FOUND | Iterator exhausted. |
| OCCTL_INVALID_ARGUMENT | iter or out_node is NULL. |
\par Thread Safety No (mutates iterator).
| occtl_status_t occtl_topo_is_inside | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | solid, | ||
| occtl_point3_t | point, | ||
| double | tolerance, | ||
| int32_t | include_boundary, | ||
| int32_t * | out_is_inside | ||
| ) |
Tests whether a 3D point is inside a solid node.
| [in] | graph | Borrows it. Must be non-NULL. |
| [in] | solid | Solid node to test. |
| [in] | point | Point to test. |
| [in] | tolerance | Tolerance for boundary detection. Must be non-negative. |
| [in] | include_boundary | 1 treats boundary points as inside; 0 does not. |
| [out] | out_is_inside | Borrows it. Receives 1 or 0. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_is_inside is NULL, tolerance is negative, or include_boundary is not 0 or 1. |
| OCCTL_NOT_FOUND | solid is invalid or removed. |
| OCCTL_WRONG_KIND | solid is not a solid. |
\par Thread Safety Yes (read-only on graph; may build classifier-local caches).
| occtl_status_t occtl_topo_is_same_geometry | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | node_a, | ||
| occtl_node_id_t | node_b, | ||
| double | tolerance, | ||
| int32_t * | out_is_same_geometry | ||
| ) |
Tests whether two edge or face nodes share the same geometric support.
This is a geometry predicate, not topological identity: two different bounded edges/faces may compare equal when OCCT reports coincident support within tolerance. Node kinds must match and must be Edge or Face.
| [in] | graph | Borrows it. Must be non-NULL. |
| [in] | node_a | First edge or face node. |
| [in] | node_b | Second edge or face node. |
| [in] | tolerance | Linear tolerance. Must be non-negative. |
| [out] | out_is_same_geometry | Borrows it. Receives 1 for same geometry, 0 otherwise. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_is_same_geometry is NULL, or tolerance is negative/non-finite. |
| OCCTL_NOT_FOUND | node_a or node_b is invalid or removed. |
| OCCTL_WRONG_KIND | Nodes are not both edges or both faces. |
\par Thread Safety Yes (read-only on graph; may use local OCCT projection state).
| void occtl_topo_parent_explorer_config_init | ( | occtl_topo_parent_explorer_config_t * | config | ) |
Initialises config to default values via OCCTL_TOPO_PARENT_EXPLORER_CONFIG_INIT.
NULL-tolerant.
| [out] | config | Borrows it. May be NULL (no-op). |
\par Thread Safety Yes.
| occtl_status_t occtl_topo_parent_explorer_create | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | node, | ||
| const occtl_topo_parent_explorer_config_t * | config, | ||
| occtl_topo_explorer_iter_t ** | out_iter | ||
| ) |
Creates an upward parent explorer starting from node.
The explorer walks the reverse reference indices upward from the starting node, accumulating location and orientation along each parent chain.
| [in] | graph | Must be non-NULL. |
| [in] | node | Starting node ID. |
| [in] | config | 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 config->p_next is non-NULL. |
| OCCTL_NOT_FOUND | node is invalid or removed. |
| OCCTL_VERSION_MISMATCH | config->struct_version unsupported. |
| OCCTL_OUT_OF_RANGE | config->mode, config->target_kind, or config->avoid_kind is not valid. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety Yes (read-only on graph).
| occtl_status_t occtl_topo_related_iter_create | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | node, | ||
| occtl_topo_related_iter_t ** | out_iter | ||
| ) |
Creates an iterator over the semantic neighbours of node.
Neighbours are definition IDs without accumulated location or orientation. Each yield includes a occtl_relation_kind_t that describes the semantic relationship.
| [in] | graph | Must be non-NULL. |
| [in] | node | Node to query neighbours for. |
| [out] | out_iter | Owns it. Must be non-NULL. |
| OCCTL_OK | On success. |
| OCCTL_INVALID_ARGUMENT | graph or out_iter is NULL. |
| OCCTL_NOT_FOUND | node is invalid or removed. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety Yes (read-only on graph).
| void occtl_topo_related_iter_free | ( | occtl_topo_related_iter_t * | iter | ) |
Releases a related-iterator.
| [in] | iter | Owns it. NULL is a no-op. |
\par Thread Safety Yes.
| occtl_status_t occtl_topo_related_iter_next | ( | occtl_topo_related_iter_t * | iter, |
| occtl_node_id_t * | out_node, | ||
| occtl_relation_kind_t * | out_kind | ||
| ) |
Advances the related-iterator to the next semantic neighbour.
| [in,out] | iter | Borrows it. Must be non-NULL. |
| [out] | out_node | Borrows it. Must be non-NULL. |
| [out] | out_kind | Borrows it. Must be non-NULL. |
| OCCTL_OK | Next value written. |
| OCCTL_NOT_FOUND | Exhausted; out params set to invalid. |
| OCCTL_INVALID_ARGUMENT | An out-param is NULL. |
\par Thread Safety No (mutates iter; concurrent reads on distinct iters OK).
| void occtl_topo_relation_options_init | ( | occtl_topo_relation_options_t * | options | ) |
Runtime initialiser for occtl_topo_relation_options_t.
Sets all fields to OCCTL_TOPO_RELATION_OPTIONS_INIT.
| [out] | options | Borrows it. NULL-tolerant; no-op when NULL. |
\par Thread Safety Yes.
| occtl_status_t occtl_topo_touch_iter_create | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | node_a, | ||
| occtl_node_id_t | node_b, | ||
| const occtl_topo_relation_options_t * | options, | ||
| occtl_topo_touch_iter_t ** | out_iter | ||
| ) |
Creates an iterator over contact solutions between two graph nodes.
The calculation is delegated to OCCT BRepExtrema_DistShapeShape. When the minimum distance is greater than the requested tolerance, the iterator is valid but empty. Results are original-graph support nodes plus the OCCT contact / closest points; the queried graph is not mutated.
| [in] | graph | Borrows it. Must be non-NULL. |
| [in] | node_a | First node to query. |
| [in] | node_b | Second node to query. |
| [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 options contains an invalid p_next, tolerance, or 0/1 flag. |
| OCCTL_VERSION_MISMATCH | options has an unsupported struct_version. |
| OCCTL_NOT_FOUND | node_a or node_b is invalid or removed. |
| OCCTL_GEOMETRY_INVALID | OCCT could not compute distance/contact solutions. |
| OCCTL_OUT_OF_MEMORY | Allocation failed. |
\par Thread Safety Yes (read-only on graph; may populate internal shape caches).
| void occtl_topo_touch_iter_free | ( | occtl_topo_touch_iter_t * | iter | ) |
Releases a touch iterator.
| [in] | iter | Owns it. May be NULL. |
\par Thread Safety Yes.
| occtl_status_t occtl_topo_touch_iter_next | ( | occtl_topo_touch_iter_t * | iter, |
| occtl_topo_touch_hit_t * | out_hit | ||
| ) |
Advances a touch iterator.
| [in,out] | iter | Borrows it. Must be non-NULL. |
| [out] | out_hit | Borrows it. Must be non-NULL. |
| OCCTL_OK | Next hit written. |
| OCCTL_NOT_FOUND | Iterator exhausted. |
| OCCTL_INVALID_ARGUMENT | iter or out_hit is NULL. |
\par Thread Safety No (mutates iterator).
| occtl_status_t occtl_topo_wire_order_edges | ( | const occtl_graph_t * | graph, |
| occtl_node_id_t | wire, | ||
| occtl_oriented_node_t * | out_buf, | ||
| size_t | cap, | ||
| size_t * | out_count | ||
| ) |
Lists a wire's edges in endpoint-chaining order.
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_oriented_node_t entries.
Each returned entry contains an Edge node ID and the coedge orientation of that edge inside wire. The order matches occtl_topo_wire_explorer_create.
| [in] | graph | Borrows it. Must be non-NULL. |
| [in] | wire | Wire node ID. |
| [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 | wire is invalid or removed. |
| OCCTL_WRONG_KIND | wire is not a wire. |
| OCCTL_BUFFER_TOO_SMALL | out_buf is non-NULL and cap is too small. |
\par Thread Safety Yes (read-only on graph).