24#ifndef OCCTL_HPP_MESH_HPP
25#define OCCTL_HPP_MESH_HPP
39#if defined(__cpp_lib_span) && __cpp_lib_span >= 202002L
41 #ifndef OCCTL_HPP_HAS_SPAN
42 #define OCCTL_HPP_HAS_SPAN 1
45 #ifndef OCCTL_HPP_HAS_SPAN
46 #define OCCTL_HPP_HAS_SPAN 0
66 double deflection = 0.001;
68 double deflection_interior = -1.0;
69 double angle_interior = -1.0;
70 double min_size = -1.0;
71 bool in_parallel =
false;
72 bool relative =
false;
73 bool internal_vertices_mode =
true;
74 bool control_surface_deflection =
true;
75 bool control_surface_deflection_all =
false;
76 bool clean_model =
true;
77 bool adjust_min_size =
false;
78 bool force_face_deflection =
false;
79 bool allow_quality_decrease =
false;
81 std::optional<AABB3> bbox;
82 double deviation_coefficient = 0.001;
83 double deviation_angle = 0.3490658503988659;
105 if (bbox.has_value())
108 aOpts.
bbox.
min = bbox->min.c_type();
109 aOpts.
bbox.
max = bbox->max.c_type();
129#if OCCTL_HPP_HAS_SPAN
130 [[nodiscard]] std::span<const double> nodes()
const noexcept
135 [[nodiscard]] std::span<const double> normals()
const noexcept
138 : std::span<const double>{};
141 [[nodiscard]] std::span<const double> uvs()
const noexcept
143 return myC.
uvs !=
nullptr ? std::span<const double>{myC.
uvs, myC.
node_count * 2u}
144 : std::span<const double>{};
147 [[nodiscard]] std::span<const uint32_t> triangles()
const noexcept
152 [[nodiscard]]
const double* nodes()
const noexcept {
return myC.
nodes; }
154 [[nodiscard]]
const double* normals()
const noexcept {
return myC.
normals; }
156 [[nodiscard]]
const double* uvs()
const noexcept {
return myC.
uvs; }
158 [[nodiscard]]
const uint32_t* triangles()
const noexcept {
return myC.
triangles; }
161 [[nodiscard]] std::size_t node_count()
const noexcept {
return myC.
node_count; }
163 [[nodiscard]] std::size_t triangle_count()
const noexcept {
return myC.
triangle_count; }
165 [[nodiscard]]
double deflection()
const noexcept {
return myC.
deflection; }
167 [[nodiscard]]
UID source_uid()
const noexcept {
return UID(myC.
source_uid); }
169 [[nodiscard]]
bool has_normals()
const noexcept {
return myC.
normals !=
nullptr; }
171 [[nodiscard]]
bool has_uvs()
const noexcept {
return myC.
uvs !=
nullptr; }
173 [[nodiscard]] const ::occtl_triangulation_view_t& c()
const noexcept {
return myC; }
185 explicit Polygon3DView(const ::occtl_polygon3d_view_t& theC) noexcept
190#if OCCTL_HPP_HAS_SPAN
191 [[nodiscard]] std::span<const double> nodes()
const noexcept
196 [[nodiscard]] std::span<const double> parameters()
const noexcept
199 : std::span<const double>{};
202 [[nodiscard]]
const double* nodes()
const noexcept {
return myC.
nodes; }
204 [[nodiscard]]
const double* parameters()
const noexcept {
return myC.
parameters; }
207 [[nodiscard]] std::size_t node_count()
const noexcept {
return myC.
node_count; }
209 [[nodiscard]]
double deflection()
const noexcept {
return myC.
deflection; }
211 [[nodiscard]]
UID source_uid()
const noexcept {
return UID(myC.
source_uid); }
213 [[nodiscard]]
bool has_parameters()
const noexcept {
return myC.
parameters !=
nullptr; }
215 [[nodiscard]] const ::occtl_polygon3d_view_t& c()
const noexcept {
return myC; }
227 explicit PolygonOnTriView(const ::occtl_polygon_on_tri_view_t& theC) noexcept
232#if OCCTL_HPP_HAS_SPAN
233 [[nodiscard]] std::span<const uint32_t> node_indices()
const noexcept
238 [[nodiscard]] std::span<const double> parameters()
const noexcept
241 : std::span<const double>{};
244 [[nodiscard]]
const uint32_t* node_indices()
const noexcept {
return myC.
node_indices; }
246 [[nodiscard]]
const double* parameters()
const noexcept {
return myC.
parameters; }
249 [[nodiscard]] std::size_t node_count()
const noexcept {
return myC.
node_count; }
251 [[nodiscard]]
double deflection()
const noexcept {
return myC.
deflection; }
253 [[nodiscard]]
UID source_uid()
const noexcept {
return UID(myC.
source_uid); }
255 [[nodiscard]]
bool has_parameters()
const noexcept {
return myC.
parameters !=
nullptr; }
257 [[nodiscard]] const ::occtl_polygon_on_tri_view_t& c()
const noexcept {
return myC; }
274#if OCCTL_HPP_HAS_SPAN
275 [[nodiscard]] std::span<const double> nodes()
const noexcept
280 [[nodiscard]] std::span<const uint32_t> triangles()
const noexcept
285 [[nodiscard]]
const double* nodes()
const noexcept {
return myC.
nodes; }
287 [[nodiscard]]
const uint32_t* triangles()
const noexcept {
return myC.
triangles; }
290 [[nodiscard]] std::size_t node_count()
const noexcept {
return myC.
node_count; }
292 [[nodiscard]] std::size_t triangle_count()
const noexcept {
return myC.
triangle_count; }
294 [[nodiscard]] std::size_t face_count()
const noexcept {
return myC.
face_count; }
298 [[nodiscard]] const ::occtl_mesh_triangle_buffers_view_t& c()
const noexcept {
return myC; }
315#if OCCTL_HPP_HAS_SPAN
316 [[nodiscard]] std::span<const double> triangle_normals()
const noexcept
321 [[nodiscard]] std::span<const uint32_t> triangle_adjacency()
const noexcept
326 [[nodiscard]]
const double* triangle_normals()
const noexcept {
return myC.
triangle_normals; }
328 [[nodiscard]]
const uint32_t* triangle_adjacency()
const noexcept
334 [[nodiscard]] std::size_t triangle_count()
const noexcept {
return myC.
triangle_count; }
336 [[nodiscard]] std::size_t face_count()
const noexcept {
return myC.
face_count; }
340 [[nodiscard]] const ::occtl_mesh_triangle_analysis_view_t& c()
const noexcept {
return myC; }
359#if OCCTL_HPP_HAS_SPAN
360 [[nodiscard]] std::span<const uint32_t> triangle_component_ids()
const noexcept
365 [[nodiscard]] std::span<const uint32_t> component_sizes()
const noexcept
370 [[nodiscard]]
const uint32_t* triangle_component_ids()
const noexcept
375 [[nodiscard]]
const uint32_t* component_sizes()
const noexcept {
return myC.
component_sizes; }
378 [[nodiscard]] std::size_t triangle_count()
const noexcept {
return myC.
triangle_count; }
380 [[nodiscard]] std::size_t component_count()
const noexcept {
return myC.
component_count; }
384 [[nodiscard]] const ::occtl_mesh_triangle_components_view_t& c()
const noexcept {
return myC; }
397 const ::occtl_mesh_triangle_component_triangles_view_t& theC) noexcept
402#if OCCTL_HPP_HAS_SPAN
403 [[nodiscard]] std::span<const uint32_t> triangles()
const noexcept
408 [[nodiscard]]
const uint32_t* triangles()
const noexcept {
return myC.
triangles; }
411 [[nodiscard]] std::size_t triangle_count()
const noexcept {
return myC.
triangle_count; }
413 [[nodiscard]] uint32_t component_id()
const noexcept {
return myC.
component_id; }
417 [[nodiscard]] const ::occtl_mesh_triangle_component_triangles_view_t& c()
const noexcept
433 const ::occtl_mesh_triangle_component_boundary_view_t& theC) noexcept
438#if OCCTL_HPP_HAS_SPAN
439 [[nodiscard]] std::span<const ::occtl_mesh_triangle_component_boundary_edge_t> edges()
445 [[nodiscard]] const ::occtl_mesh_triangle_component_boundary_edge_t* edges()
const noexcept
451 [[nodiscard]] std::size_t edge_count()
const noexcept {
return myC.
edge_count; }
453 [[nodiscard]] uint32_t component_id()
const noexcept {
return myC.
component_id; }
457 [[nodiscard]] const ::occtl_mesh_triangle_component_boundary_view_t& c()
const noexcept
473 const ::occtl_mesh_triangle_component_boundary_chains_view_t& theC) noexcept
478#if OCCTL_HPP_HAS_SPAN
479 [[nodiscard]] std::span<const ::occtl_mesh_triangle_component_boundary_edge_t> edges()
485 [[nodiscard]] std::span<const ::occtl_mesh_triangle_component_boundary_chain_t> chains()
491 [[nodiscard]] const ::occtl_mesh_triangle_component_boundary_edge_t* edges()
const noexcept
496 [[nodiscard]] const ::occtl_mesh_triangle_component_boundary_chain_t* chains()
const noexcept
502 [[nodiscard]] std::size_t edge_count()
const noexcept {
return myC.
edge_count; }
504 [[nodiscard]] std::size_t chain_count()
const noexcept {
return myC.
chain_count; }
506 [[nodiscard]] uint32_t component_id()
const noexcept {
return myC.
component_id; }
510 [[nodiscard]] const ::occtl_mesh_triangle_component_boundary_chains_view_t& c()
const noexcept
526 const ::occtl_mesh_component_boundary_polylines_view_t& theC) noexcept
531#if OCCTL_HPP_HAS_SPAN
532 [[nodiscard]] std::span<const ::occtl_point3_t> points()
const noexcept
537 [[nodiscard]] std::span<const ::occtl_mesh_component_boundary_polyline_t> polylines()
543 [[nodiscard]] const ::occtl_point3_t* points()
const noexcept {
return myC.
points; }
545 [[nodiscard]] const ::occtl_mesh_component_boundary_polyline_t* polylines()
const noexcept
551 [[nodiscard]] std::size_t point_count()
const noexcept {
return myC.
point_count; }
553 [[nodiscard]] std::size_t polyline_count()
const noexcept {
return myC.
polyline_count; }
555 [[nodiscard]] uint32_t component_id()
const noexcept {
return myC.
component_id; }
559 [[nodiscard]] const ::occtl_mesh_component_boundary_polylines_view_t& c()
const noexcept
575 const ::occtl_mesh_triangle_component_summaries_view_t& theC) noexcept
580#if OCCTL_HPP_HAS_SPAN
581 [[nodiscard]] std::span<const ::occtl_mesh_triangle_component_summary_t> summaries()
587 [[nodiscard]] const ::occtl_mesh_triangle_component_summary_t* summaries()
const noexcept
593 [[nodiscard]] std::size_t component_count()
const noexcept {
return myC.
component_count; }
595 [[nodiscard]] std::size_t triangle_count()
const noexcept {
return myC.
triangle_count; }
599 [[nodiscard]] const ::occtl_mesh_triangle_component_summaries_view_t& c()
const noexcept
617 const ::occtl_mesh_triangle_plane_components_view_t& theC) noexcept
622#if OCCTL_HPP_HAS_SPAN
623 [[nodiscard]] std::span<const ::occtl_mesh_triangle_plane_component_t> components()
const noexcept
628 [[nodiscard]] const ::occtl_mesh_triangle_plane_component_t* components()
const noexcept
634 [[nodiscard]] std::size_t component_count()
const noexcept {
return myC.
component_count; }
636 [[nodiscard]] std::size_t triangle_count()
const noexcept {
return myC.
triangle_count; }
640 [[nodiscard]] const ::occtl_mesh_triangle_plane_components_view_t& c()
const noexcept
658 const ::occtl_mesh_triangle_sphere_components_view_t& theC) noexcept
663#if OCCTL_HPP_HAS_SPAN
664 [[nodiscard]] std::span<const ::occtl_mesh_triangle_sphere_component_t> components()
670 [[nodiscard]] const ::occtl_mesh_triangle_sphere_component_t* components()
const noexcept
676 [[nodiscard]] std::size_t component_count()
const noexcept {
return myC.
component_count; }
678 [[nodiscard]] std::size_t triangle_count()
const noexcept {
return myC.
triangle_count; }
682 [[nodiscard]] const ::occtl_mesh_triangle_sphere_components_view_t& c()
const noexcept
700 const ::occtl_mesh_triangle_cylinder_components_view_t& theC) noexcept
705#if OCCTL_HPP_HAS_SPAN
706 [[nodiscard]] std::span<const ::occtl_mesh_triangle_cylinder_component_t> components()
712 [[nodiscard]] const ::occtl_mesh_triangle_cylinder_component_t* components()
const noexcept
718 [[nodiscard]] std::size_t component_count()
const noexcept {
return myC.
component_count; }
720 [[nodiscard]] std::size_t triangle_count()
const noexcept {
return myC.
triangle_count; }
724 [[nodiscard]] const ::occtl_mesh_triangle_cylinder_components_view_t& c()
const noexcept
743 std::vector<::occtl_node_id_t> aIds;
744 aIds.reserve(theNodes.size());
745 for (
const NodeId& aId : theNodes)
747 aIds.emplace_back(aId.get());
752 aIds.empty() ?
nullptr : aIds.data(),
757#if OCCTL_HPP_HAS_SPAN
759inline void generate(
Graph& theGraph, std::span<const NodeId> theNodes,
const Options& theOpts)
761 std::vector<::occtl_node_id_t> aIds;
762 aIds.reserve(theNodes.size());
763 for (
const NodeId& aId : theNodes)
764 aIds.emplace_back(aId.get());
768 aIds.empty() ?
nullptr : aIds.data(),
785 const char*
const theKey,
786 const std::size_t theKeyLen,
787 const char*
const theValue,
788 const std::size_t theValueLen)
795 const char*
const theKey,
796 const std::size_t theKeyLen)
798 std::size_t aRequired = 0;
804 std::string aResult(aRequired - 1,
'\0');
817 std::size_t aCount = 0;
820 std::vector<::occtl_metadata_key_view_t> aViews(aCount);
826 std::vector<std::string> aKeys;
827 aKeys.reserve(aCount);
828 for (const ::occtl_metadata_key_view_t& aView : aViews)
830 aKeys.emplace_back(aView.key, aView.key_len);
837 const char*
const theKey,
838 const std::size_t theKeyLen)
863 const uint32_t theIndex)
898 const Graph& theGraph,
908 const Graph& theGraph,
918 const Graph& theGraph,
922 anOptions.
root = theRoot.get();
928 const Graph& theGraph,
938 const Graph& theGraph,
942 anOptions.
root = theRoot.get();
948 const Graph& theGraph,
950 const uint32_t theComponentId)
960 const Graph& theGraph,
961 const uint32_t theComponentId,
965 anOptions.
root = theRoot.get();
971 const Graph& theGraph,
973 const uint32_t theComponentId)
983 const Graph& theGraph,
984 const uint32_t theComponentId,
988 anOptions.
root = theRoot.get();
994 const Graph& theGraph,
996 const uint32_t theComponentId)
1008 const Graph& theGraph,
1009 const uint32_t theComponentId,
1013 anOptions.
root = theRoot.get();
1019 const Graph& theGraph,
1021 const uint32_t theComponentId)
1031 const Graph& theGraph,
1032 const uint32_t theComponentId,
1036 anOptions.
root = theRoot.get();
1042 const Graph& theGraph,
1052 const Graph& theGraph,
1056 anOptions.
root = theRoot.get();
1062 const Graph& theGraph,
1072 const Graph& theGraph,
1076 anOptions.
root = theRoot.get();
1082 const Graph& theGraph,
1092 const Graph& theGraph,
1096 OCCTL_MESH_TRIANGLE_CYLINDER_COMPONENTS_OPTIONS_INIT;
1097 anOptions.
root = theRoot.get();
1105 const uint32_t theComponentId)
1116 const uint32_t theComponentId,
1120 anOptions.
root = theRoot.get();
1128 const uint32_t theComponentId)
1141 const uint32_t theComponentId,
1145 OCCTL_MESH_TRIANGLE_CYLINDER_COMPONENTS_OPTIONS_INIT;
1146 anOptions.
root = theRoot.get();
1169 std::vector<NodeId> aSolids;
1170 aSolids.reserve(aCount);
1171 for (const ::occtl_node_id_t& aSolid : aCSolids)
1173 aSolids.emplace_back(aSolid);
1185 anOptions.
root = theRoot.get();
1208 std::vector<NodeId> aSolids;
1209 aSolids.reserve(aCount);
1210 for (const ::occtl_node_id_t& aSolid : aCSolids)
1212 aSolids.emplace_back(aSolid);
1224 OCCTL_MESH_TRIANGLE_CYLINDER_COMPONENTS_OPTIONS_INIT;
1225 anOptions.
root = theRoot.get();
1233 const uint32_t theComponentId)
1243 const uint32_t theComponentId,
1247 anOptions.
root = theRoot.get();
1269 std::vector<NodeId> aFaces;
1270 aFaces.reserve(aCount);
1271 for (const ::occtl_node_id_t& aFace : aCFaces)
1273 aFaces.emplace_back(aFace);
1284 anOptions.
root = theRoot.get();
RAII handle for a topology graph. Mirrors occtl_graph_t.
Definition topo.hpp:1444
::occtl_graph_t * get() const noexcept
Borrows-it pointer to the underlying C handle, for direct ABI calls.
Definition topo.hpp:1494
Session-local identity of a graph node. Mirrors occtl_node_id_t.
Definition topo.hpp:52
::occtl_node_id_t get() const noexcept
Borrows-it view of the underlying C value type, for direct ABI calls.
Definition topo.hpp:64
static NodeId invalid() noexcept
Returns the invalid sentinel (all-zero bits).
Definition topo.hpp:61
Persistent identity surviving node removal and graph compaction. Mirrors occtl_uid_t.
Definition uid.hpp:39
Borrowed view of a 3D polyline cached on an edge.
Definition mesh.hpp:181
Borrowed view of a coedge polyline indexed onto its parent face's triangulation.
Definition mesh.hpp:223
Borrowed per-triangle normals and adjacency for a graph/root.
Definition mesh.hpp:306
Borrowed aggregate triangle-soup buffers for a graph/root.
Definition mesh.hpp:265
Borrowed ordered boundary chains belonging to one triangle component.
Definition mesh.hpp:468
Borrowed ordered boundary polylines belonging to one triangle component.
Definition mesh.hpp:521
Borrowed boundary edges belonging to one triangle component.
Definition mesh.hpp:428
Borrowed summaries for normal-connected triangle components.
Definition mesh.hpp:570
Borrowed aggregate triangle indices belonging to one component.
Definition mesh.hpp:392
Borrowed normal-connected triangle component labels.
Definition mesh.hpp:350
Borrowed cylinder-like normal-connected triangle components.
Definition mesh.hpp:695
Borrowed plane-like normal-connected triangle components.
Definition mesh.hpp:612
Borrowed sphere-like normal-connected triangle components.
Definition mesh.hpp:653
Borrowed view of a face triangulation. Lifetime tied to the source graph.
Definition mesh.hpp:120
C++ veneer for the core module.
void check(const ::occtl_status_t theStatus)
Throw on non-OK; otherwise a no-op.
Definition core.hpp:85
C++ veneer for the geom module.
void generate(Graph &theGraph, const Options &theOpts)
Tessellate every active face and free edge in theGraph.
Definition mesh.hpp:734
std::pair< Graph, NodeId > from_buffers(const FromBuffersOptions &theOptions)
Creates a new graph containing one triangulated Face from caller buffers.
Definition mesh.hpp:775
TriangleComponentBoundaryPolylinesView triangle_component_boundary_polylines(const Graph &theGraph, const TriangleComponentsOptions &theOptions, const uint32_t theComponentId)
Ordered boundary polylines belonging to one triangle component.
Definition mesh.hpp:1018
NodeId make_plane_component_face(Graph &theGraph, const TrianglePlaneComponentsOptions &theOptions, const uint32_t theComponentId)
Rebuild one plane-like triangle component as a planar Face root.
Definition mesh.hpp:1230
std::vector< NodeId > make_plane_component_faces(Graph &theGraph, const TrianglePlaneComponentsOptions &theOptions)
Rebuild all plane-like triangle components as planar Face roots.
Definition mesh.hpp:1252
TrianglePlaneComponentsView triangle_plane_components(const Graph &theGraph, const TrianglePlaneComponentsOptions &theOptions)
Plane-like normal-connected triangle components.
Definition mesh.hpp:1041
TriangleCylinderComponentsView triangle_cylinder_components(const Graph &theGraph, const TriangleCylinderComponentsOptions &theOptions)
Cylinder-like normal-connected triangle components.
Definition mesh.hpp:1081
PolygonOnTriView coedge_polygon_on_tri(const Graph &theGraph, const NodeId theCoEdge)
Cached polygon-on-triangulation for theCoEdge.
Definition mesh.hpp:879
void model_metadata_set(Graph &theGraph, const char *const theKey, const std::size_t theKeyLen, const char *const theValue, const std::size_t theValueLen)
Sets mesh-model metadata on the graph metadata storage.
Definition mesh.hpp:784
std::vector< std::string > model_metadata_keys(const Graph &theGraph)
Lists mesh-model metadata keys from the graph metadata storage.
Definition mesh.hpp:815
TriangleSphereComponentsView triangle_sphere_components(const Graph &theGraph, const TriangleSphereComponentsOptions &theOptions)
Sphere-like normal-connected triangle components.
Definition mesh.hpp:1061
NodeId make_cylinder_component_solid(Graph &theGraph, const TriangleCylinderComponentsOptions &theOptions, const uint32_t theComponentId)
Rebuild one cylinder-like triangle component as an analytic Solid root.
Definition mesh.hpp:1125
TriangulationView face_triangulation(const Graph &theGraph, const NodeId theFace)
Active cached triangulation of theFace.
Definition mesh.hpp:844
std::vector< NodeId > make_sphere_component_solids(Graph &theGraph, const TriangleSphereComponentsOptions &theOptions)
Rebuild all sphere-like triangle components as analytic Solid roots.
Definition mesh.hpp:1151
TriangleAnalysisView triangle_analysis(const Graph &theGraph, const NodeId theRoot=NodeId::invalid())
Cached per-triangle normals and adjacency for graph-owned mesh buffers.
Definition mesh.hpp:897
TriangleComponentsView triangle_components(const Graph &theGraph, const TriangleComponentsOptions &theOptions)
Normal-connected triangle components for graph-owned mesh buffers.
Definition mesh.hpp:907
std::string model_metadata_get(const Graph &theGraph, const char *const theKey, const std::size_t theKeyLen)
Retrieves mesh-model metadata from the graph metadata storage.
Definition mesh.hpp:794
TriangulationView face_triangulation_at(const Graph &theGraph, const NodeId theFace, const uint32_t theIndex)
theIndex-th cached triangulation of theFace.
Definition mesh.hpp:861
TriangleComponentTrianglesView triangle_component_triangles(const Graph &theGraph, const TriangleComponentsOptions &theOptions, const uint32_t theComponentId)
Aggregate triangle indices belonging to one component.
Definition mesh.hpp:947
void model_metadata_unset(Graph &theGraph, const char *const theKey, const std::size_t theKeyLen)
Removes one mesh-model metadata key. Idempotent.
Definition mesh.hpp:836
Polygon3DView edge_polygon3d(const Graph &theGraph, const NodeId theEdge)
Cached 3D polyline on theEdge.
Definition mesh.hpp:871
TriangleBuffersView triangle_buffers(const Graph &theGraph, const NodeId theRoot=NodeId::invalid())
Aggregate cached triangulations into graph-owned triangle-soup buffers.
Definition mesh.hpp:888
TriangleComponentBoundaryChainsView triangle_component_boundary_chains(const Graph &theGraph, const TriangleComponentsOptions &theOptions, const uint32_t theComponentId)
Ordered boundary chains belonging to one triangle component.
Definition mesh.hpp:993
TriangleComponentSummariesView triangle_component_summaries(const Graph &theGraph, const TriangleComponentsOptions &theOptions)
Summaries for normal-connected triangle components.
Definition mesh.hpp:927
std::vector< NodeId > make_cylinder_component_solids(Graph &theGraph, const TriangleCylinderComponentsOptions &theOptions)
Rebuild all cylinder-like triangle components as analytic Solid roots.
Definition mesh.hpp:1190
uint32_t face_triangulation_count(const Graph &theGraph, const NodeId theFace)
Number of cached triangulations on theFace.
Definition mesh.hpp:853
NodeId make_sphere_component_solid(Graph &theGraph, const TriangleSphereComponentsOptions &theOptions, const uint32_t theComponentId)
Rebuild one sphere-like triangle component as an analytic Solid root.
Definition mesh.hpp:1102
TriangleComponentBoundaryView triangle_component_boundary(const Graph &theGraph, const TriangleComponentsOptions &theOptions, const uint32_t theComponentId)
Boundary edges belonging to one triangle component.
Definition mesh.hpp:970
OCCT-Light: mesh (triangulation) module public API.
occtl_status_t occtl_mesh_model_metadata_set(occtl_graph_t *graph, const char *key, size_t keyLen, const char *value, size_t valueLen)
occtl_status_t occtl_mesh_generate(occtl_graph_t *graph, const occtl_node_id_t *nodes, size_t n_nodes, const occtl_mesh_options_t *options)
occtl_status_t occtl_mesh_triangle_sphere_components(const occtl_graph_t *graph, const occtl_mesh_triangle_sphere_components_options_t *options, occtl_mesh_triangle_sphere_components_view_t *out_view)
occtl_status_t occtl_mesh_coedge_polygon_on_tri(const occtl_graph_t *graph, occtl_node_id_t coedge, occtl_polygon_on_tri_view_t *out_view)
occtl_status_t occtl_mesh_from_buffers(const occtl_mesh_from_buffers_options_t *options, occtl_graph_t **out_graph, occtl_node_id_t *out_root)
struct occtl_mesh_triangle_cylinder_components_options occtl_mesh_triangle_cylinder_components_options_t
occtl_status_t occtl_mesh_triangle_component_boundary(const occtl_graph_t *graph, const occtl_mesh_triangle_components_options_t *options, uint32_t component_id, occtl_mesh_triangle_component_boundary_view_t *out_view)
occtl_status_t occtl_mesh_model_metadata_unset(occtl_graph_t *graph, const char *key, size_t keyLen)
occtl_status_t occtl_mesh_make_plane_component_face(occtl_graph_t *graph, const occtl_mesh_triangle_plane_components_options_t *options, uint32_t component_id, occtl_node_id_t *out_face)
occtl_status_t occtl_mesh_make_sphere_component_solid(occtl_graph_t *graph, const occtl_mesh_triangle_sphere_components_options_t *options, uint32_t component_id, occtl_node_id_t *out_solid)
occtl_status_t occtl_mesh_triangle_analysis(const occtl_graph_t *graph, occtl_node_id_t root, occtl_mesh_triangle_analysis_view_t *out_view)
struct occtl_mesh_triangle_sphere_components_options occtl_mesh_triangle_sphere_components_options_t
occtl_status_t occtl_mesh_make_cylinder_component_solid(occtl_graph_t *graph, const occtl_mesh_triangle_cylinder_components_options_t *options, uint32_t component_id, occtl_node_id_t *out_solid)
occtl_status_t occtl_mesh_face_triangulation_indexed(const occtl_graph_t *graph, occtl_node_id_t face, uint32_t index, occtl_triangulation_view_t *out_view)
occtl_status_t occtl_mesh_model_metadata_keys(const occtl_graph_t *graph, occtl_metadata_key_view_t *out_keys, size_t cap, size_t *out_count)
occtl_status_t occtl_mesh_edge_polygon3d(const occtl_graph_t *graph, occtl_node_id_t edge, occtl_polygon3d_view_t *out_view)
occtl_status_t occtl_mesh_triangle_buffers(const occtl_graph_t *graph, occtl_node_id_t root, occtl_mesh_triangle_buffers_view_t *out_view)
occtl_status_t occtl_mesh_make_sphere_component_solids(occtl_graph_t *graph, const occtl_mesh_triangle_sphere_components_options_t *options, occtl_node_id_t *out_buf, size_t cap, size_t *out_count)
occtl_status_t occtl_mesh_face_triangulation(const occtl_graph_t *graph, occtl_node_id_t face, occtl_triangulation_view_t *out_view)
occtl_status_t occtl_mesh_make_plane_component_faces(occtl_graph_t *graph, const occtl_mesh_triangle_plane_components_options_t *options, occtl_node_id_t *out_buf, size_t cap, size_t *out_count)
occtl_status_t occtl_mesh_face_triangulation_count(const occtl_graph_t *graph, occtl_node_id_t face, uint32_t *out_count)
struct occtl_mesh_from_buffers_options occtl_mesh_from_buffers_options_t
occtl_status_t occtl_mesh_model_metadata_get(const occtl_graph_t *graph, const char *key, size_t keyLen, char *buf, size_t bufSize, size_t *out_required)
struct occtl_mesh_triangle_components_options occtl_mesh_triangle_components_options_t
occtl_status_t occtl_mesh_make_cylinder_component_solids(occtl_graph_t *graph, const occtl_mesh_triangle_cylinder_components_options_t *options, occtl_node_id_t *out_buf, size_t cap, size_t *out_count)
occtl_status_t occtl_mesh_triangle_components(const occtl_graph_t *graph, const occtl_mesh_triangle_components_options_t *options, occtl_mesh_triangle_components_view_t *out_view)
#define OCCTL_MESH_OPTIONS_INIT
Definition occtl_mesh.h:139
occtl_status_t occtl_mesh_triangle_component_boundary_chains(const occtl_graph_t *graph, const occtl_mesh_triangle_components_options_t *options, uint32_t component_id, occtl_mesh_triangle_component_boundary_chains_view_t *out_view)
struct occtl_mesh_triangle_plane_components_options occtl_mesh_triangle_plane_components_options_t
occtl_status_t occtl_mesh_triangle_cylinder_components(const occtl_graph_t *graph, const occtl_mesh_triangle_cylinder_components_options_t *options, occtl_mesh_triangle_cylinder_components_view_t *out_view)
occtl_status_t occtl_mesh_triangle_plane_components(const occtl_graph_t *graph, const occtl_mesh_triangle_plane_components_options_t *options, occtl_mesh_triangle_plane_components_view_t *out_view)
occtl_status_t occtl_mesh_component_boundary_polylines(const occtl_graph_t *graph, const occtl_mesh_triangle_components_options_t *options, uint32_t component_id, occtl_mesh_component_boundary_polylines_view_t *out_view)
occtl_status_t occtl_mesh_triangle_component_triangles(const occtl_graph_t *graph, const occtl_mesh_triangle_components_options_t *options, uint32_t component_id, occtl_mesh_triangle_component_triangles_view_t *out_view)
occtl_status_t occtl_mesh_triangle_component_summaries(const occtl_graph_t *graph, const occtl_mesh_triangle_components_options_t *options, occtl_mesh_triangle_component_summaries_view_t *out_view)
#define OCCTL_NODE_ID_INVALID
Definition occtl_topo_types.h:138
struct occtl_graph occtl_graph_t
Definition occtl_topo_types.h:152
3D point value type. Mirrors occtl_point3_t with STL-flavoured access.
Definition geom.hpp:82
Axis-aligned bounding box. Aggregate over the C POD.
Definition mesh.hpp:55
Idiomatic mirror of occtl_mesh_options_t.
Definition mesh.hpp:65
::occtl_mesh_options_t to_c() const noexcept
Project into the C ABI options struct.
Definition mesh.hpp:86
occtl_point3_t min
Definition occtl_mesh.h:67
occtl_point3_t max
Definition occtl_mesh.h:68
Definition occtl_mesh.h:821
size_t polyline_count
Definition occtl_mesh.h:826
const occtl_point3_t * points
Definition occtl_mesh.h:822
occtl_node_id_t root
Definition occtl_mesh.h:828
size_t point_count
Definition occtl_mesh.h:823
const occtl_mesh_component_boundary_polyline_t * polylines
Definition occtl_mesh.h:825
uint32_t component_id
Definition occtl_mesh.h:827
Definition occtl_mesh.h:299
Definition occtl_mesh.h:97
double min_size
Definition occtl_mesh.h:108
int32_t in_parallel
Definition occtl_mesh.h:110
int32_t allow_quality_decrease
Definition occtl_mesh.h:122
int32_t clean_model
Definition occtl_mesh.h:117
double deflection_interior
Definition occtl_mesh.h:104
double angle_interior
Definition occtl_mesh.h:105
double angle
Definition occtl_mesh.h:102
int32_t control_surface_deflection
Definition occtl_mesh.h:114
int32_t force_face_deflection
Definition occtl_mesh.h:120
double deflection
Definition occtl_mesh.h:101
occtl_aabb3_t bbox
Definition occtl_mesh.h:128
double deviation_angle
Definition occtl_mesh.h:130
double deviation_coefficient
Definition occtl_mesh.h:129
int32_t internal_vertices_mode
Definition occtl_mesh.h:112
int32_t use_bbox
Definition occtl_mesh.h:125
int32_t relative
Definition occtl_mesh.h:111
int32_t adjust_min_size
Definition occtl_mesh.h:119
int32_t control_surface_deflection_all
Definition occtl_mesh.h:115
Definition occtl_mesh.h:652
const double * triangle_normals
Definition occtl_mesh.h:653
size_t triangle_count
Definition occtl_mesh.h:656
occtl_node_id_t root
Definition occtl_mesh.h:658
const uint32_t * triangle_adjacency
Definition occtl_mesh.h:655
size_t face_count
Definition occtl_mesh.h:657
Definition occtl_mesh.h:626
size_t node_count
Definition occtl_mesh.h:628
occtl_node_id_t root
Definition occtl_mesh.h:632
const uint32_t * triangles
Definition occtl_mesh.h:629
size_t face_count
Definition occtl_mesh.h:631
const double * nodes
Definition occtl_mesh.h:627
size_t triangle_count
Definition occtl_mesh.h:630
Definition occtl_mesh.h:800
size_t chain_count
Definition occtl_mesh.h:806
size_t edge_count
Definition occtl_mesh.h:803
const occtl_mesh_triangle_component_boundary_chain_t * chains
Definition occtl_mesh.h:805
uint32_t component_id
Definition occtl_mesh.h:807
occtl_node_id_t root
Definition occtl_mesh.h:808
const occtl_mesh_triangle_component_boundary_edge_t * edges
Definition occtl_mesh.h:802
Definition occtl_mesh.h:782
occtl_node_id_t root
Definition occtl_mesh.h:787
uint32_t component_id
Definition occtl_mesh.h:786
size_t edge_count
Definition occtl_mesh.h:785
const occtl_mesh_triangle_component_boundary_edge_t * edges
Definition occtl_mesh.h:784
Definition occtl_mesh.h:858
size_t component_count
Definition occtl_mesh.h:861
size_t triangle_count
Definition occtl_mesh.h:862
occtl_node_id_t root
Definition occtl_mesh.h:863
const occtl_mesh_triangle_component_summary_t * summaries
Definition occtl_mesh.h:860
Definition occtl_mesh.h:719
occtl_node_id_t root
Definition occtl_mesh.h:723
const uint32_t * triangles
Definition occtl_mesh.h:720
uint32_t component_id
Definition occtl_mesh.h:722
size_t triangle_count
Definition occtl_mesh.h:721
Definition occtl_mesh.h:673
occtl_node_id_t root
Definition occtl_mesh.h:676
Definition occtl_mesh.h:700
const uint32_t * triangle_component_ids
Definition occtl_mesh.h:702
const uint32_t * component_sizes
Definition occtl_mesh.h:704
size_t triangle_count
Definition occtl_mesh.h:703
size_t component_count
Definition occtl_mesh.h:705
occtl_node_id_t root
Definition occtl_mesh.h:706
Definition occtl_mesh.h:1012
occtl_node_id_t root
Definition occtl_mesh.h:1016
Definition occtl_mesh.h:1067
const occtl_mesh_triangle_cylinder_component_t * components
Definition occtl_mesh.h:1069
occtl_node_id_t root
Definition occtl_mesh.h:1072
size_t component_count
Definition occtl_mesh.h:1070
size_t triangle_count
Definition occtl_mesh.h:1071
Definition occtl_mesh.h:877
occtl_node_id_t root
Definition occtl_mesh.h:880
Definition occtl_mesh.h:924
const occtl_mesh_triangle_plane_component_t * components
Definition occtl_mesh.h:926
occtl_node_id_t root
Definition occtl_mesh.h:929
size_t triangle_count
Definition occtl_mesh.h:928
size_t component_count
Definition occtl_mesh.h:927
Definition occtl_mesh.h:943
occtl_node_id_t root
Definition occtl_mesh.h:946
Definition occtl_mesh.h:992
size_t component_count
Definition occtl_mesh.h:995
size_t triangle_count
Definition occtl_mesh.h:996
occtl_node_id_t root
Definition occtl_mesh.h:997
const occtl_mesh_triangle_sphere_component_t * components
Definition occtl_mesh.h:994
Definition occtl_topo_types.h:50
Definition occtl_mesh.h:541
double deflection
Definition occtl_mesh.h:546
occtl_uid_t source_uid
Definition occtl_mesh.h:547
const double * nodes
Definition occtl_mesh.h:542
size_t node_count
Definition occtl_mesh.h:543
const double * parameters
Definition occtl_mesh.h:545
Definition occtl_mesh.h:581
double deflection
Definition occtl_mesh.h:587
occtl_uid_t source_uid
Definition occtl_mesh.h:588
const double * parameters
Definition occtl_mesh.h:586
const uint32_t * node_indices
Definition occtl_mesh.h:582
size_t node_count
Definition occtl_mesh.h:584
Definition occtl_mesh.h:439
size_t node_count
Definition occtl_mesh.h:441
occtl_uid_t source_uid
Definition occtl_mesh.h:448
const double * nodes
Definition occtl_mesh.h:440
const double * uvs
Definition occtl_mesh.h:444
const uint32_t * triangles
Definition occtl_mesh.h:445
const double * normals
Definition occtl_mesh.h:443
size_t triangle_count
Definition occtl_mesh.h:446
double deflection
Definition occtl_mesh.h:447
C++ veneer for the topo module.