OCCT-Light 0.1
C ABI and C++ veneer for multi-language CAD workflows
Loading...
Searching...
No Matches
occtl_topo_relation.h
Go to the documentation of this file.
1// Copyright (c) 2026 Capgemini Engineering Research and Development.
2//
3// This file is part of OCCT-Light software library.
4//
5// This library is free software; you can redistribute it and/or modify it under
6// the terms of the GNU Affero General Public License version 3 as published
7// by the Free Software Foundation, with an option to use any later version.
8// Consult the file LICENSE_AGPL_30.txt included in OCCT-Light distribution
9// for complete text of the license and disclaimer of any warranty.
10//
11// Alternatively, this file may be used under the terms of a commercial
12// license or contractual agreement.
13//
14// SPDX-License-Identifier: AGPL-3.0-or-later
15
26#ifndef OCCTL_TOPO_RELATION_H
27#define OCCTL_TOPO_RELATION_H
28
29#include <stddef.h>
30#include <stdint.h>
31
32#include "occtl_core.h"
33#include "occtl_geom.h"
34#include "occtl_topo_types.h"
35
36#ifdef __cplusplus
37extern "C"
38{
39#endif
40
58
73
85
113 occtl_node_id_t wire,
114 occtl_oriented_node_t* out_buf,
115 size_t cap,
116 size_t* out_count);
117
131typedef struct occtl_topo_explorer_iter occtl_topo_explorer_iter_t;
132
137{
140 OCCTL_TOPO_EXPLORER_TRAVERSAL_RESERVED_FUTURE = 0x7fffffff
142
143#define OCCTL_TOPO_CHILD_EXPLORER_CONFIG_VERSION_1 1u
144
163
164#define OCCTL_TOPO_CHILD_EXPLORER_CONFIG_INIT \
165 {OCCTL_TOPO_CHILD_EXPLORER_CONFIG_VERSION_1, \
166 NULL, \
167 OCCTL_TOPO_EXPLORER_RECURSIVE, \
168 OCCTL_KIND_INVALID, \
169 OCCTL_KIND_INVALID, \
170 0, \
171 1, \
172 1}
173
185OCCTL_API void OCCTL_CALL
187
215OCCTL_API occtl_status_t OCCTL_CALL
217 occtl_node_id_t root,
219 occtl_topo_explorer_iter_t** out_iter);
220
221#define OCCTL_TOPO_PARENT_EXPLORER_CONFIG_VERSION_1 1u
222
237
238#define OCCTL_TOPO_PARENT_EXPLORER_CONFIG_INIT \
239 {OCCTL_TOPO_PARENT_EXPLORER_CONFIG_VERSION_1, \
240 NULL, \
241 OCCTL_TOPO_EXPLORER_RECURSIVE, \
242 OCCTL_KIND_INVALID, \
243 OCCTL_KIND_INVALID, \
244 0}
245
257OCCTL_API void OCCTL_CALL
259
285OCCTL_API occtl_status_t OCCTL_CALL
287 occtl_node_id_t node,
289 occtl_topo_explorer_iter_t** out_iter);
290
311OCCTL_API occtl_status_t OCCTL_CALL
313 occtl_node_id_t* out_node,
314 occtl_transform_t* out_transform,
315 occtl_orientation_t* out_orientation);
316
327
337typedef struct occtl_topo_related_iter occtl_topo_related_iter_t;
338
348typedef struct occtl_topo_axis_hit_iter occtl_topo_axis_hit_iter_t;
349
350#define OCCTL_TOPO_RELATION_OPTIONS_VERSION_1 1u
351
369
370#define OCCTL_TOPO_RELATION_OPTIONS_INIT \
371 {OCCTL_TOPO_RELATION_OPTIONS_VERSION_1, NULL, 1.0e-7, 1, 1, 1}
372
385
395typedef struct occtl_topo_touch_iter occtl_topo_touch_iter_t;
396
406typedef struct occtl_topo_intersection_iter occtl_topo_intersection_iter_t;
407
425
437
455
469
488
509OCCTL_API occtl_status_t OCCTL_CALL
511 occtl_node_id_t node,
512 occtl_topo_related_iter_t** out_iter);
513
536 occtl_node_id_t node_a,
537 occtl_node_id_t node_b,
539
563 occtl_node_id_t node,
564 occtl_point3_t point,
565 occtl_point3_t* out_closest,
566 double* out_distance);
567
596OCCTL_API occtl_status_t OCCTL_CALL
598 occtl_node_id_t root,
600 double min_parameter,
601 double max_parameter,
602 double tolerance,
603 occtl_topo_axis_hit_iter_t** out_iter);
604
635OCCTL_API occtl_status_t OCCTL_CALL
637 occtl_node_id_t node_a,
638 occtl_node_id_t node_b,
639 const occtl_topo_relation_options_t* options,
640 occtl_topo_touch_iter_t** out_iter);
641
675OCCTL_API occtl_status_t OCCTL_CALL
677 occtl_node_id_t node_a,
678 occtl_node_id_t node_b,
679 const occtl_topo_relation_options_t* options,
681
707 occtl_node_id_t node_a,
708 occtl_node_id_t node_b,
709 double tolerance,
710 int32_t* out_is_same_geometry);
711
739 occtl_node_id_t node_a,
740 occtl_node_id_t node_b,
741 occtl_node_id_t* out_buf,
742 size_t cap,
743 size_t* out_count);
744
771 occtl_node_id_t edge,
772 occtl_node_id_t* out_buf,
773 size_t cap,
774 size_t* out_count);
775
802 occtl_node_id_t face,
803 occtl_node_id_t* out_buf,
804 size_t cap,
805 size_t* out_count);
806
833 occtl_node_id_t seed_edge,
834 occtl_node_id_t* out_buf,
835 size_t cap,
836 size_t* out_count);
837
864 occtl_node_id_t seed_face,
865 occtl_node_id_t* out_buf,
866 size_t cap,
867 size_t* out_count);
868
905 occtl_node_id_t root,
906 const occtl_node_id_t* sources,
907 size_t source_count,
908 occtl_node_id_t target,
909 int32_t* out_distance);
910
934 occtl_node_id_t solid,
935 occtl_point3_t point,
936 double tolerance,
937 occtl_topo_point_class_t* out_class);
938
961 occtl_node_id_t solid,
962 occtl_point3_t point,
963 double tolerance,
964 int32_t include_boundary,
965 int32_t* out_is_inside);
966
982 occtl_topo_axis_hit_t* out_hit);
983
994
1010 occtl_topo_touch_hit_t* out_hit);
1011
1022
1037OCCTL_API occtl_status_t OCCTL_CALL
1039 occtl_node_id_t* out_node);
1040
1051
1068 occtl_node_id_t* out_node,
1069 occtl_relation_kind_t* out_kind);
1070
1081
1082#ifdef __cplusplus
1083} /* extern "C" */
1084#endif
1085
1086#endif /* OCCTL_TOPO_RELATION_H */
OCCT-Light: core public API.
#define OCCTL_API
Definition occtl_core.h:111
enum occtl_status occtl_status_t
enum occtl_node_kind occtl_node_kind_t
OCCT-Light: geometry primitive types and math utilities.
struct occtl_topo_parent_explorer_config occtl_topo_parent_explorer_config_t
occtl_orientation
Definition occtl_topo_relation.h:66
@ OCCTL_ORIENTATION_EXTERNAL
Definition occtl_topo_relation.h:70
@ OCCTL_ORIENTATION_INTERNAL
Definition occtl_topo_relation.h:69
@ OCCTL_ORIENTATION_FORWARD
Definition occtl_topo_relation.h:67
@ OCCTL_ORIENTATION_REVERSED
Definition occtl_topo_relation.h:68
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)
void occtl_topo_parent_explorer_config_init(occtl_topo_parent_explorer_config_t *config)
void occtl_topo_touch_iter_free(occtl_topo_touch_iter_t *iter)
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)
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)
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)
enum occtl_shape_continuity occtl_shape_continuity_t
enum occtl_relation_kind occtl_relation_kind_t
occtl_shape_continuity
Definition occtl_topo_relation.h:48
@ OCCTL_CONTINUITY_C1
Definition occtl_topo_relation.h:50
@ OCCTL_CONTINUITY_C0
Definition occtl_topo_relation.h:49
@ OCCTL_CONTINUITY_G2
Definition occtl_topo_relation.h:55
@ OCCTL_CONTINUITY_CN
Definition occtl_topo_relation.h:53
@ OCCTL_CONTINUITY_G1
Definition occtl_topo_relation.h:54
@ OCCTL_CONTINUITY_C2
Definition occtl_topo_relation.h:51
@ OCCTL_CONTINUITY_C3
Definition occtl_topo_relation.h:52
void occtl_topo_related_iter_free(occtl_topo_related_iter_t *iter)
struct occtl_topo_touch_iter occtl_topo_touch_iter_t
Definition occtl_topo_relation.h:395
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)
occtl_status_t occtl_topo_axis_hit_iter_next(occtl_topo_axis_hit_iter_t *iter, occtl_topo_axis_hit_t *out_hit)
struct occtl_topo_touch_hit occtl_topo_touch_hit_t
struct occtl_topo_distance_pair occtl_topo_distance_pair_t
struct occtl_topo_child_explorer_config occtl_topo_child_explorer_config_t
struct occtl_topo_relation_options occtl_topo_relation_options_t
struct occtl_topo_intersection_iter occtl_topo_intersection_iter_t
Definition occtl_topo_relation.h:406
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)
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)
void occtl_topo_intersection_iter_free(occtl_topo_intersection_iter_t *iter)
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)
enum occtl_orientation occtl_orientation_t
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)
occtl_relation_kind
Definition occtl_topo_relation.h:412
@ OCCTL_RELATION_OWNING_FACE
Definition occtl_topo_relation.h:419
@ OCCTL_RELATION_BOUNDARY_EDGE
Definition occtl_topo_relation.h:413
@ OCCTL_RELATION_WIRE_COEDGE
Definition occtl_topo_relation.h:418
@ OCCTL_RELATION_INCIDENT_EDGE
Definition occtl_topo_relation.h:420
@ OCCTL_RELATION_SEAM_PAIR
Definition occtl_topo_relation.h:422
@ OCCTL_RELATION_OUTER_WIRE
Definition occtl_topo_relation.h:415
@ OCCTL_RELATION_INCIDENT_VERTEX
Definition occtl_topo_relation.h:417
@ OCCTL_RELATION_REFERENCED_BY
Definition occtl_topo_relation.h:416
@ OCCTL_RELATION_ADJACENT_FACE
Definition occtl_topo_relation.h:414
@ OCCTL_RELATION_PARENT_EDGE
Definition occtl_topo_relation.h:421
void occtl_topo_child_explorer_config_init(occtl_topo_child_explorer_config_t *config)
struct occtl_topo_axis_hit occtl_topo_axis_hit_t
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)
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)
struct occtl_oriented_node occtl_oriented_node_t
occtl_topo_point_class
Definition occtl_topo_relation.h:430
@ OCCTL_TOPO_POINT_CLASS_IN
Definition occtl_topo_relation.h:431
@ OCCTL_TOPO_POINT_CLASS_OUT
Definition occtl_topo_relation.h:432
@ OCCTL_TOPO_POINT_CLASS_UNKNOWN
Definition occtl_topo_relation.h:434
@ OCCTL_TOPO_POINT_CLASS_ON
Definition occtl_topo_relation.h:433
struct occtl_topo_axis_hit_iter occtl_topo_axis_hit_iter_t
Definition occtl_topo_relation.h:348
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)
void occtl_topo_axis_hit_iter_free(occtl_topo_axis_hit_iter_t *iter)
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)
void occtl_topo_explorer_iter_free(occtl_topo_explorer_iter_t *iter)
occtl_status_t occtl_topo_intersection_iter_next(occtl_topo_intersection_iter_t *iter, occtl_node_id_t *out_node)
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)
enum occtl_topo_point_class occtl_topo_point_class_t
occtl_status_t occtl_topo_touch_iter_next(occtl_topo_touch_iter_t *iter, occtl_topo_touch_hit_t *out_hit)
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)
struct occtl_topo_related_iter occtl_topo_related_iter_t
Definition occtl_topo_relation.h:337
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)
struct occtl_topo_explorer_iter occtl_topo_explorer_iter_t
Definition occtl_topo_relation.h:131
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)
void occtl_topo_relation_options_init(occtl_topo_relation_options_t *options)
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)
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)
enum occtl_topo_explorer_traversal occtl_topo_explorer_traversal_t
occtl_topo_explorer_traversal
Definition occtl_topo_relation.h:137
@ OCCTL_TOPO_EXPLORER_DIRECT_CHILDREN
Definition occtl_topo_relation.h:139
@ OCCTL_TOPO_EXPLORER_RECURSIVE
Definition occtl_topo_relation.h:138
OCCT-Light: Core topology identity types.
struct occtl_graph occtl_graph_t
Definition occtl_topo_types.h:152
Definition occtl_geom.h:111
Definition occtl_geom.h:98
Definition occtl_topo_types.h:50
Definition occtl_topo_relation.h:81
occtl_node_id_t id
Definition occtl_topo_relation.h:82
occtl_orientation_t orientation
Definition occtl_topo_relation.h:83
Definition occtl_geom.h:49
Definition occtl_geom.h:76
Definition occtl_topo_relation.h:460
occtl_point2_t uv
Definition occtl_topo_relation.h:463
int32_t has_normal
Definition occtl_topo_relation.h:466
occtl_point3_t point
Definition occtl_topo_relation.h:462
occtl_node_id_t face
Definition occtl_topo_relation.h:461
double parameter
Definition occtl_topo_relation.h:464
occtl_direction3_t normal
Definition occtl_topo_relation.h:465
occtl_topo_point_class_t location
Definition occtl_topo_relation.h:467
Definition occtl_topo_relation.h:149
const void * p_next
Definition occtl_topo_relation.h:151
uint32_t struct_version
Definition occtl_topo_relation.h:150
int32_t accumulate_orientation
Definition occtl_topo_relation.h:160
int32_t accumulate_location
Definition occtl_topo_relation.h:159
occtl_topo_explorer_traversal_t mode
Definition occtl_topo_relation.h:152
occtl_node_kind_t target_kind
Definition occtl_topo_relation.h:154
occtl_node_kind_t avoid_kind
Definition occtl_topo_relation.h:156
int32_t emit_avoid_kind
Definition occtl_topo_relation.h:157
Definition occtl_topo_relation.h:446
int32_t inner_solution
Definition occtl_topo_relation.h:452
occtl_node_id_t support_b
Definition occtl_topo_relation.h:451
double distance
Definition occtl_topo_relation.h:447
int32_t solution_count
Definition occtl_topo_relation.h:453
occtl_point3_t point_a
Definition occtl_topo_relation.h:448
occtl_node_id_t support_a
Definition occtl_topo_relation.h:450
occtl_point3_t point_b
Definition occtl_topo_relation.h:449
Definition occtl_topo_relation.h:227
occtl_node_kind_t target_kind
Definition occtl_topo_relation.h:232
uint32_t struct_version
Definition occtl_topo_relation.h:228
int32_t emit_avoid_kind
Definition occtl_topo_relation.h:235
occtl_node_kind_t avoid_kind
Definition occtl_topo_relation.h:234
const void * p_next
Definition occtl_topo_relation.h:229
occtl_topo_explorer_traversal_t mode
Definition occtl_topo_relation.h:230
Definition occtl_topo_relation.h:361
uint32_t struct_version
Definition occtl_topo_relation.h:362
int32_t include_overlaps
Definition occtl_topo_relation.h:366
double tolerance
Definition occtl_topo_relation.h:364
int32_t include_tangent_contacts
Definition occtl_topo_relation.h:365
const void * p_next
Definition occtl_topo_relation.h:363
int32_t include_lower_dimension_results
Definition occtl_topo_relation.h:367
Definition occtl_topo_relation.h:478
occtl_node_id_t node_a
Definition occtl_topo_relation.h:479
occtl_point3_t point_b
Definition occtl_topo_relation.h:484
occtl_node_id_t support_a
Definition occtl_topo_relation.h:481
occtl_node_id_t node_b
Definition occtl_topo_relation.h:480
occtl_point3_t point_a
Definition occtl_topo_relation.h:483
double distance
Definition occtl_topo_relation.h:485
int32_t inner_solution
Definition occtl_topo_relation.h:486
occtl_node_id_t support_b
Definition occtl_topo_relation.h:482
Definition occtl_geom.h:171