OCCT-Light 0.1
C ABI and C++ veneer for multi-language CAD workflows
Loading...
Searching...
No Matches
occtl_triangulation_view Struct Reference

#include <occtl_mesh.h>

Collaboration diagram for occtl_triangulation_view:

Public Attributes

const double * nodes
 
size_t node_count
 
const double * normals
 
const double * uvs
 
const uint32_t * triangles
 
size_t triangle_count
 
double deflection
 
occtl_uid_t source_uid
 

Detailed Description

Zero-copy view of a face triangulation.

Math-POD per ABI_PATTERNS.md §15 — not versioned (re-shape via a new type if the field set ever changes).

All pointer fields borrow from a per-graph internal cache. Each cache slot remembers the source node's version stamp; the next fetch after any mutation (builder, boolean op, compact, occtl_mesh_generate) sees the slot as stale and re-materialises into a fresh allocation. Existing pointers remain valid until this graph mutates and another fetch on the same face triggers re-materialisation, so callers that straddle a mutation must copy out or refetch.

Triangle indices are 0-indexed into nodes — buffers are materialised on first read into a per-face cache.

normals and uvs are NULL when the underlying triangulation carries no per-vertex normals / UV nodes; check before dereferencing.

Member Data Documentation

◆ deflection

double occtl_triangulation_view::deflection

Linear deflection used when this triangulation was generated.

◆ node_count

size_t occtl_triangulation_view::node_count

Number of vertices in the triangulation.

◆ nodes

const double* occtl_triangulation_view::nodes

xyz interleaved doubles, length 3 * node_count.

◆ normals

const double* occtl_triangulation_view::normals

xyz interleaved doubles, length 3 * node_count, or NULL when absent.

◆ source_uid

occtl_uid_t occtl_triangulation_view::source_uid

UID of the parent face. OCCTL_UID_INVALID if the cache could not resolve it.

◆ triangle_count

size_t occtl_triangulation_view::triangle_count

Number of triangles.

◆ triangles

const uint32_t* occtl_triangulation_view::triangles

0-indexed triplets into nodes, length 3 * triangle_count.

◆ uvs

const double* occtl_triangulation_view::uvs

uv interleaved doubles, length 2 * node_count, or NULL when absent.


The documentation for this struct was generated from the following file: