Geometry — 3D#

Typedefs

typedef CGAL::Exact_predicates_exact_constructions_kernel EX_K#
typedef Traits_2::Point_2 Point_2#
typedef EX_K::Point_3 Point_3#
typedef CGAL::Polygon_2<EX_K> Polygon_2#
typedef CGAL::Simple_cartesian<double> SC_Kernel#
typedef SC_Kernel::Point_3 SC_Point#
typedef openvdb::FloatGrid SDF_Grid#
typedef Traits_2::X_monotone_curve_2 Segment_2#
typedef CGAL::Arr_segment_traits_2<EX_K> Traits_2#
struct Indexed_Triangle#
#include <primitives.h>

Triangle representation capturing integer-based references mapping shared indices into a global vertex pool.

Public Members

size_t p1#
size_t p2#
size_t p3#
class SurfaceMesh#
#include <surface_mesh.h>

A triangle mesh stored in OpenVCAD’s canonical vertex/index representation.

SurfaceMesh stores vertices, indexed triangles, and a bounding box. It can be constructed from explicit mesh data, files, VTK data, implicit trees, and SDF data. Sampling/query accelerators are intentionally handled outside this class.

Public Functions

std::pair<glm::vec3, glm::vec3> bounding_box() const#

Returns the bounding box of the mesh.

Returns:

The minimum and maximum mesh coordinates.

void center()#

Centers the mesh around the origin.

SDF_Grid::Ptr compute_sdf(glm::vec3 voxel_size, float exterior_band_width = 3.0f, float interior_band_width = 3.0f) const#

Converts the mesh into an OpenVDB signed-distance field.

Parameters:
  • voxel_size – The target voxel size.

  • exterior_band_width – Exterior narrow-band width in world units.

  • interior_band_width – Interior narrow-band width in world units.

Returns:

The generated OpenVDB float grid.

void merge(std::shared_ptr<SurfaceMesh> mesh_to_merge)#

Merges another mesh into this mesh.

This performs a simple concatenation of vertices and triangles. It may result in non-manifold geometry or duplicate vertices.

Parameters:

mesh_to_merge – The mesh to merge into this mesh.

SurfaceMesh()#

Default constructor creating an empty mesh.

SurfaceMesh(const openvdb::FloatGrid::Ptr &sdf_grid, bool disable_validation = false)#

Constructor that extracts a zero-isosurface from an OpenVDB float grid.

Parameters:
  • sdf_grid – The signed-distance OpenVDB grid.

  • disable_validation – If true, bypass CGAL validation on input.

SurfaceMesh(const std::shared_ptr<FloatVDBVolume> &sdf_volume, bool disable_validation = false)#

Constructor that extracts a zero-isosurface from a float VDB volume.

Parameters:
  • sdf_volume – The signed-distance volume wrapper.

  • disable_validation – If true, bypass CGAL validation on input.

SurfaceMesh(const std::shared_ptr<Node> &root, double voxel_size, bool disable_validation, bool root_already_prepared, ThreadUsageTracker *thread_usage_tracker = nullptr)#
SurfaceMesh(const std::shared_ptr<Node> &root, double voxel_size, bool disable_validation = false)#

Constructor that samples an OpenVCAD tree and extracts its zero-isosurface.

Parameters:
  • root – The tree root to sample.

  • voxel_size – Uniform voxel size used for the temporary SDF.

  • disable_validation – If true, bypass CGAL validation on input.

SurfaceMesh(const std::string &file_path, bool disable_validation = false)#

Constructor that loads a mesh from a file.

Parameters:
  • file_path – The path to the mesh file to load.

  • disable_validation – If true, bypass CGAL validation on input.

SurfaceMesh(std::vector<glm::vec3> vertices, std::vector<Indexed_Triangle> triangles, bool disable_validation = false)#

Constructor that creates a mesh from vertices and triangles.

Parameters:
  • vertices – The vertices of the mesh.

  • triangles – The indexed triangular faces of the mesh.

  • disable_validation – If true, bypass CGAL validation on input.

SurfaceMesh(vtkSmartPointer<vtkImageData> sdf_image, bool disable_validation = false)#

Constructor that extracts a zero-isosurface from signed-distance image data.

Parameters:
  • sdf_image – The vtkImageData containing signed-distance samples.

  • disable_validation – If true, bypass CGAL validation on input.

SurfaceMesh(vtkSmartPointer<vtkPolyData> poly_data, bool disable_validation = false)#

Constructor that creates a mesh from VTK polydata.

Parameters:
  • poly_data – The vtkPolyData geometry element.

  • disable_validation – If true, bypass CGAL validation on input.

void translate(glm::vec3 translation)#

Translates the mesh by a given translation vector.

Parameters:

translation – The translation vector to apply to the mesh (mm).

std::vector<Indexed_Triangle> triangles() const#

Returns the triangles of the mesh.

Returns:

The triangles of the mesh.

std::vector<glm::vec3> vertices() const#

Returns the vertices of the mesh.

Returns:

The vertices of the mesh.

void write_3mf(const std::string &output_file_name)#

Writes the mesh to a 3MF file.

Parameters:

output_file_name – The file to write.

void write_stl(const std::string &output_file_name)#

Writes the mesh to a binary STL file.

Parameters:

output_file_name – The file to write.

Private Functions

void initialize_from_file(const std::string &file_path, bool disable_validation)#
void initialize_from_float_grid(const openvdb::FloatGrid::Ptr &sdf_grid, bool disable_validation)#
void initialize_from_image_data(vtkSmartPointer<vtkImageData> sdf_image, bool disable_validation, bool allow_empty = false)#
void initialize_from_mesh_data(std::vector<glm::vec3> vertices, std::vector<Indexed_Triangle> triangles, bool disable_validation, bool allow_empty = false)#
void initialize_from_poly_data(vtkSmartPointer<vtkPolyData> poly_data, bool disable_validation, bool allow_empty = false)#
void initialize_from_tree(const std::shared_ptr<Node> &root, double voxel_size, bool disable_validation, bool root_already_prepared = false, ThreadUsageTracker *thread_usage_tracker = nullptr)#

Private Members

glm::vec3 m_max = glm::vec3(0.0f)#
glm::vec3 m_min = glm::vec3(0.0f)#
std::vector<Indexed_Triangle> m_triangles#
std::vector<glm::vec3> m_vertices#

Private Static Functions

static std::pair<glm::vec3, glm::vec3> compute_bounding_box(const std::vector<glm::vec3> &vertices)#
static vtkSmartPointer<vtkPolyData> contour_sdf_image(vtkSmartPointer<vtkImageData> sdf_image)#
static vtkSmartPointer<vtkImageData> create_sdf_image_from_grid(const openvdb::FloatGrid::Ptr &sdf_grid)#
static vtkSmartPointer<vtkImageData> create_sdf_image_from_tree(const std::shared_ptr<Node> &root, double voxel_size, bool root_already_prepared = false, ThreadUsageTracker *thread_usage_tracker = nullptr)#
static std::tuple<std::vector<glm::vec3>, std::vector<Indexed_Triangle>, glm::vec3, glm::vec3> load_mesh_from_file(const std::string &file_path)#
static vtkSmartPointer<vtkPolyData> normalize_poly_data(vtkSmartPointer<vtkPolyData> poly_data)#
static std::shared_ptr<CGAL::Surface_mesh<SC_Point>> to_cgal_mesh(const std::vector<glm::vec3> &vertices, const std::vector<Indexed_Triangle> &triangles)#
static void validate_mesh(const std::vector<glm::vec3> &vertices, const std::vector<Indexed_Triangle> &triangles)#

Friends

friend class MeshSampler
friend class TriangleMeshSurface
class CADPart#
#include <cad_part.h>

A CAD geometry primitive.

The CAD is loaded from a file into memory and provides a signed distance adapter to the surface.

Note

This class supports STEP and IGES file formats.

Public Functions

std::pair<glm::vec3, glm::vec3> bounding_box()#

Finds boundaries encompassing the TopoDs representations of the current CAD state.

Returns:

Defined coordinate constraints mapping [min, max].

CADPart() = default#
CADPart(const std::string &path)#

Constructor.

Parameters:

path – The path to the CAD file to load

CADPart(TopoDS_Shape part)#

Initializes a CADPart shape utilizing an OpenCascade TopoDS_Shape.

Parameters:

part – Evaluated Brep mapping to the part.

std::shared_ptr<CADPart> clone()#

Generates a discrete copy of the CAD evaluation elements and the geometric surface state.

Returns:

A cloned CADPart pointer mapping.

void export_as_stl(const std::string &path, double deflection = 0.1)#

Exports the internal CAD shape bounding representations to an STL mesh wrapper.

Parameters:
  • path – Destination output file matching .stl.

  • deflection – Geometric threshold limit targeting precision bounding deviations.

void set_fast_mode(bool fast_mode, glm::vec3 voxel_size, double interior_bandwidth, double exterior_bandwidth, double deflection = 0.1)#

Converts explicit solid classification evaluations to an accelerated 3D grid based SDF volume mapping.

Parameters:
  • fast_mode – Boolean to enable fast grid evaluation mapping.

  • voxel_size – The local unit block size when generating internal meshes.

  • interior_bandwidthOffset internal bound mapping to compute.

  • exterior_bandwidthOffset external bound region expansion to compute.

  • deflection – Triangle tolerance parameter targeting generation of mesh bounds.

inline const TopoDS_Shape &shape() const#

Returns the topology-preserving OCCT shape owned by this part.

The returned handle shares OCCT’s underlying shape data and is intended for internal topology adapters such as CADModel and CADFace.

Returns:

The loaded OCCT shape.

double signed_distance_to_surface(double x, double y, double z)#

Returns the signed distance to the surface of the CAD geometry.

Parameters:
  • x – The x coordinate

  • y – The y coordinate

  • z – The z coordinate

std::shared_ptr<SurfaceMesh> to_surface_mesh(double deflection = 0.1, bool disable_validation = false)#

Compiles the internal BRep shape parameters to a primitive meshed output state.

Parameters:
  • deflection – Geometry constraints mapping generation scaling.

  • disable_validation – If true, bypass CGAL closure validation on the generated mesh.

Returns:

Converted geometry component class type format to SurfaceMesh.

Private Types

typedef openvdb::FloatGrid GridType#

The type of grid used by OpenVDB.

Private Functions

void compute_bbox()#

Generates local Bnd_box parameters from the base CAD shape definition array bounds.

void load(const std::string &path)#

Loads the CAD file into memory.

void prepare_classification()#

Prepares standard inside classification elements for the underlying part structure limits.

void prepare_fast_classification(glm::vec3 voxel_size, double interior_bandwidth, double exterior_bandwidth, double deflection = 0.1)#

Formats accelerated grid memory block samplers caching classification bounds using an implicit volume conversion.

Parameters:
  • voxel_size – Grid structure block parameters.

  • interior_bandwidthOffset constraints inward.

  • exterior_bandwidthOffset constraints outward.

  • deflection – Triangle alignment threshold.

Private Members

std::shared_ptr<GridType::Accessor> m_accessor = nullptr#

The accessor for the grid.

BRepClass3d_SolidClassifier m_classifier#

The explicit solid shape volume mapper.

bool m_fast_mode = false#

Toggles state flags enabling rapid sampling parameters utilizing discrete blocks over true geometry projection evaluation matrices.

GridType::Ptr m_grid = nullptr#

The OpenVDB grid used to store the signed distance field.

glm::vec3 m_max#

Evaluation limit mapping the upper coordinate bounds marking shape scope regions.

glm::vec3 m_min#

Evaluation limit mapping the lower coordinate block geometry limits.

TopoDS_Shape m_part#

Base representation shape generated from initial files.

openvdb::tools::GridSampler<GridType, openvdb::tools::BoxSampler>::Ptr m_sampler#

Sampling structure mapped linearly over grid data mapping boolean interpolation boundaries.

TopoDS_Shape m_shell#

Unused shell container wrapping representation evaluation definitions.

Private Static Functions

static TopoDS_Shape load_iges(std::string path)#

Loads an IGES file into a TopoDS_Shape.

Parameters:

path – The path to the IGES file

static TopoDS_Shape load_step(std::string path)#

Loads a STEP file into a TopoDS_Shape.

Parameters:

path – The path to the STEP file

class CADFace : public ParametricSurface#
#include <cad_model.h>

A stable topology-preserving face handle owned by a CADModel.

Metadata and native UV evaluation are derived directly from the retained OCCT face. CADFace satisfies the ParametricSurface contract using the exact OCCT surface, so it can be mapped by CellMap interchangeably with a parameterized triangle-mesh patch.

Public Functions

double area() const#
size_t boundary_loop_count() const#
std::pair<glm::vec3, glm::vec3> bounding_box() const#
CADFace(const std::shared_ptr<CADModel> &model, const TopoDS_Face &face, size_t index)#
glm::vec3 centroid() const#
virtual bool contains(double u, double v, double tolerance = 1e-7) const override#

Tests whether native UV coordinates lie within the trimmed face.

inline size_t index() const#
bool is_trimmed() const#
glm::vec3 normal() const#
virtual glm::vec3 normal(double u, double v) const override#

Evaluates the oriented unit normal at native UV coordinates.

virtual glm::vec3 point(double u, double v) const override#

Evaluates the exact CAD surface at native UV coordinates.

inline const TopoDS_Face &shape() const#
std::string surface_type() const#
virtual bool u_periodic() const override#

Reports whether the U parameter wraps through a seam.

virtual std::pair<glm::vec2, glm::vec2> uv_bounds() const override#

Returns the native parameter rectangle as (minimum, maximum) UV corners.

Returns:

The minimum and maximum UV coordinates of the parameter rectangle.

virtual bool v_periodic() const override#

Reports whether the V parameter wraps through a seam.

Private Members

TopoDS_Face m_face#
size_t m_index#
std::shared_ptr<CADModel> m_model#
class CADModel : public std::enable_shared_from_this<CADModel>#
#include <cad_model.h>

A topology-preserving CAD model parsed once and shared by faces and implicit nodes.

Public Functions

explicit CADModel(const std::shared_ptr<CADPart> &part)#
std::shared_ptr<CADFace> face(size_t index)#
std::vector<std::shared_ptr<CADFace>> faces()#
inline const std::shared_ptr<CADPart> &part() const#
std::vector<std::shared_ptr<CADFace>> select_faces(const FaceSelection &selection)#
std::shared_ptr<CAD> to_node(bool use_fast_mode = false)#

Public Static Functions

static std::shared_ptr<CADModel> from_brep(const std::string &path)#
static std::shared_ptr<CADModel> from_brep_bytes(const std::string &data)#
static std::shared_ptr<CADModel> from_iges(const std::string &path)#
static std::shared_ptr<CADModel> from_step(const std::string &path)#

Private Members

std::shared_ptr<CADPart> m_part#

Private Static Functions

static std::shared_ptr<CADModel> from_shape(const TopoDS_Shape &shape)#
struct FaceSelection#
#include <cad_model.h>

Public Members

std::optional<std::pair<glm::vec3, glm::vec3>> bounds#
std::vector<size_t> indices#
std::optional<double> max_area#
std::optional<double> min_area#
double min_dot = -1.0#
std::optional<glm::vec3> normal#
std::optional<std::string> surface_type#
class CellMap#
#include <cell_map.h>

Immutable structured curvilinear map from logical unit cells to world space.

Logical coordinates cover [0, nu] x [0, nv] x [0, nw]. Linear maps use one trilinear element per cell; curved maps use eight sub-elements per cell so midpoint CAD samples are retained without runtime OCCT queries.

Public Types

enum class TrimMode#

Strategy for restricting a surface-built map to the surface’s true domain.

Surfaces backed by a trimmed or non-rectangular chart do not fill their UV bounding rectangle. TrimMode selects how the map treats the empty margin: keep it, remove whole logical elements, or clip implicitly at the true boundary curve.

Values:

enumerator none#

Keep the full rectangular logical domain; nothing is removed.

enumerator cells#

Deactivate whole structured elements outside the surface domain.

enumerator boundary#

Clip smoothly at the surface’s true boundary curve (default).

Public Functions

inline const std::vector<bool> &active_elements() const#
CellMap(const glm::ivec3 &cells, int subdivisions, const std::vector<glm::vec3> &control_points, const std::array<bool, 3> &periodic = {false, false, false}, const std::vector<bool> &active_elements = {})#
inline const glm::ivec3 &cells() const#
bool contains_logical(const glm::vec3 &logical) const#
inline const std::vector<glm::vec3> &control_points() const#
double domain_signed_distance(const glm::vec3 &world) const#

Return signed distance to the finite active CellMap domain.

The boundary is represented by an accelerated triangle mesh extracted from exposed structured-element faces. Distance is negative inside the active map, zero on its boundary, and positive outside. Periodic seams are not boundaries.

Parameters:

world – World-coordinate query point.

Returns:

Signed distance to the active map domain.

double domain_unsigned_distance(const glm::vec3 &world) const#

Return the unsigned distance to the finite active CellMap boundary.

inline const glm::ivec3 &element_counts() const#
glm::vec3 forward(const glm::vec3 &logical) const#
glm::vec3 forward_extended_reference(const glm::vec3 &logical) const#

Continue the reference map beyond its finite logical bounds.

Periodic coordinates wrap through their seam. Nonperiodic coordinates use trilinear continuation of the nearest boundary element. Trim activity is not applied. This specialized preparation operation does not change the finite domain semantics of forward(), locate(), or the domain-distance methods.

Parameters:

logical – Logical reference coordinate, which may lie outside the finite domain.

Returns:

Continued world-space coordinate.

glm::vec3 forward_reference(const glm::vec3 &logical) const#

Map an in-bounds logical reference point without applying trim activity.

This is used while preparing parametric cells whose fields are sampled on the undeformed structured domain, including cells adjacent to a trim.

inline bool has_boundary_trim() const#

Report whether the map carries an implicit true-boundary clip.

True only for TrimMode::boundary maps whose chart does not fill its logical rectangle; a rectangular chart has no boundary margin to clip.

std::optional<glm::vec3> inverse(const glm::vec3 &world, double tolerance = 1e-6, size_t max_iterations = 24) const#

Invert a world-space point into logical cell coordinates.

The requested tolerance is clamped to a scale-aware numerical floor because CellMap control points and interpolation use single-precision coordinates.

Parameters:
  • world – World-space point to invert.

  • tolerance – Requested Newton convergence tolerance.

  • max_iterations – Maximum damped Newton iterations per candidate element.

Returns:

Logical coordinates, or std::nullopt when the point is outside the active map.

glm::mat3 jacobian(const glm::vec3 &logical) const#
double jacobian_determinant(const glm::vec3 &logical) const#
std::optional<CellMapLocation> locate(const glm::vec3 &world, double tolerance = 1e-6, size_t max_iterations = 24) const#

Locate a world-space point and retain its deterministic cell ownership.

inline const glm::vec3 &maximum() const#
inline const glm::vec3 &minimum() const#
inline const std::array<bool, 3> &periodic() const#
glm::vec3 principal_stretches(const glm::vec3 &logical) const#
inline int subdivisions() const#
inline TrimMode trim_mode() const#

Return the trim strategy the map was built with.

CellMapDiagnostics validate() const#

Public Static Functions

static std::shared_ptr<CellMap> between_cad_faces(const std::shared_ptr<CADFace> &first, const std::shared_ptr<CADFace> &second, const glm::ivec3 &cells, bool linear = false, TrimMode trim = TrimMode::boundary, bool auto_align = true, bool flip_u = false, bool flip_v = false, bool exchange_uv = false, const std::optional<glm::vec2> &first_origin = std::nullopt, const std::optional<glm::vec2> &second_origin = std::nullopt)#

CAD-named compatibility wrapper delegating to between_surfaces().

static std::shared_ptr<CellMap> between_surfaces(const std::shared_ptr<ParametricSurface> &first, const std::shared_ptr<ParametricSurface> &second, const glm::ivec3 &cells, bool linear = false, TrimMode trim = TrimMode::boundary, bool auto_align = true, bool flip_u = false, bool flip_v = false, bool exchange_uv = false, const std::optional<glm::vec2> &first_origin = std::nullopt, const std::optional<glm::vec2> &second_origin = std::nullopt)#

Builds a map by interpolating between two parametric surfaces.

Any ordering of CAD faces and triangle-mesh patches is accepted. Surfaces whose periodicity is incompatible, or whose pairing folds the interpolated volume, still fail alignment or Jacobian validation with diagnostics.

Parameters:
  • first – The surface at logical w = 0.

  • second – The surface at logical w = 1.

  • cells – Logical cell counts along U, V, and the interpolation direction.

  • linear – True for one trilinear element per cell.

  • trim – How to restrict the map to the surfaces’ common valid domain.

  • auto_align – True to search flips, exchanges, and periodic origins for the best map.

  • flip_u – Manual U reversal applied to the second surface when auto_align is false.

  • flip_v – Manual V reversal applied to the second surface when auto_align is false.

  • exchange_uv – Manual UV exchange applied to the second surface when auto_align is false.

  • first_origin – Optional periodic seam origin for the first surface.

  • second_origin – Optional periodic seam origin for the second surface.

Returns:

The validated structured map.

static std::shared_ptr<CellMap> from_cad_face(const std::shared_ptr<CADFace> &face, const glm::ivec3 &cells, double height, bool linear = false, TrimMode trim = TrimMode::boundary)#

CAD-named compatibility wrapper delegating to from_surface().

static std::shared_ptr<CellMap> from_surface(const std::shared_ptr<ParametricSurface> &surface, const glm::ivec3 &cells, double height, bool linear = false, TrimMode trim = TrimMode::boundary)#

Builds a signed-height map by extruding a parametric surface along its normal.

This is the generic implementation shared by exact CAD faces and parameterized triangle-mesh patches. The sign of height follows the surface’s oriented normal, so input orientation determines which side of the surface is filled.

Parameters:
  • surface – The surface to extrude.

  • cells – Logical cell counts along U, V, and the height direction.

  • height – Signed offset distance along the surface normal.

  • linear – True for one trilinear element per cell, false to retain midpoint samples.

  • trim – How to restrict the map to the surface’s valid domain.

Returns:

The validated structured map.

static std::shared_ptr<CellMap> rectangular(const glm::vec3 &minimum, const glm::vec3 &maximum, const glm::ivec3 &cells, bool linear = true)#
static std::shared_ptr<CellMap> warp(const std::shared_ptr<CellMap> &base, const std::shared_ptr<FloatAttribute> &u_scale, const std::shared_ptr<FloatAttribute> &v_scale, const std::shared_ptr<FloatAttribute> &w_scale, bool lock_u_bounds = true, bool lock_v_bounds = true, bool lock_w_bounds = true)#

Private Functions

void append_boundary_face(int i, int j, int k, int axis, int side)#
int build_boundary_bvh(size_t begin, size_t end)#
void build_boundary_mesh()#
int build_bvh(size_t begin, size_t end)#
size_t control_index(int i, int j, int k) const#
size_t count_non_neighbor_overlaps() const#
Bounds element_bounds(size_t flat_index) const#
size_t element_index(int i, int j, int k) const#
bool element_is_active(const glm::ivec3 &element) const#
bool elements_are_neighbors(size_t first, size_t second) const#
void install_boundary_trim(BoundaryTrim &&trim)#
glm::vec3 interpolate(int i, int j, int k, const glm::vec3 &local) const#
glm::mat3 local_jacobian(int i, int j, int k, const glm::vec3 &local) const#
std::optional<CellMapLocation> locate_impl(const glm::vec3 &world, double tolerance, size_t max_iterations, bool apply_trim) const#
glm::ivec3 logical_to_element(const glm::vec3 &logical) const#
bool point_inside_element(size_t flat_index, const glm::vec3 &point, double tolerance) const#
void query_boundary_bvh(int node_index, const glm::vec3 &point, double &best_squared_distance) const#
double resolved_inverse_tolerance(double requested_tolerance) const#
bool trim_allows_logical(const glm::vec3 &logical) const#
double trim_field_value(double u_fraction, double v_fraction) const#

Private Members

std::vector<bool> m_active_elements#
std::vector<BoundaryBVHNode> m_boundary_bvh_nodes#
std::vector<size_t> m_boundary_indices#
std::vector<BoundaryTriangle> m_boundary_triangles#
std::vector<size_t> m_bvh_indices#
std::vector<BVHNode> m_bvh_nodes#
glm::ivec3 m_cells#
std::vector<glm::vec3> m_control_points#
std::vector<Bounds> m_element_bounds#
glm::ivec3 m_element_counts#
glm::vec3 m_maximum#
glm::vec3 m_minimum#
std::array<bool, 3> m_periodic#
int m_subdivisions#
BoundaryTrim m_trim#
TrimMode m_trim_mode = TrimMode::none#

Private Static Functions

static BoundaryTrim build_boundary_trim(const glm::ivec3 &elements, const std::function<bool(double, double)> &contains, std::vector<bool> &active)#
struct BoundaryBVHNode#

Public Members

size_t begin = 0#
Bounds bounds#
size_t end = 0#
int left = -1#
int right = -1#
struct BoundaryTriangle#

Public Members

Bounds bounds#
glm::vec3 first#
glm::vec3 second#
glm::vec3 third#
struct BoundaryTrim#

Implicit true-boundary clip data in normalized UV fraction space.

signed_field holds a node-sampled signed distance to the chart boundary in fraction units (negative inside the chart); segments is the boundary polyline used to build the world-space trim wall.

Public Members

std::vector<std::array<glm::vec2, 2>> segments#
std::vector<float> signed_field#
int u_nodes = 0#
int v_nodes = 0#
struct Bounds#

Public Members

glm::vec3 maximum#
glm::vec3 minimum#
struct BVHNode#

Public Members

size_t begin = 0#
Bounds bounds#
size_t end = 0#
int left = -1#
int right = -1#
class CellMapCollection#
#include <cell_map.h>

Immutable collection of independently parameterized cell maps.

Public Functions

std::shared_ptr<CellMap> at(size_t index) const#
explicit CellMapCollection(const std::vector<std::shared_ptr<CellMap>> &maps)#
inline const std::vector<std::shared_ptr<CellMap>> &maps() const#
inline size_t size() const#
std::vector<CellMapDiagnostics> validate() const#

Private Members

std::vector<std::shared_ptr<CellMap>> m_maps#
struct CellMapDiagnostics#
#include <cell_map.h>

Validation evidence for a structured curvilinear cell map.

Public Functions

inline bool valid() const#

Public Members

size_t active_element_count = 0#
size_t inverse_solver_failures = 0#
size_t inverted_cell_count = 0#
double maximum_aspect_ratio = 0.0#
double maximum_jacobian_determinant = -std::numeric_limits<double>::infinity()#
double minimum_jacobian_determinant = std::numeric_limits<double>::infinity()#
size_t non_neighbor_overlap_count = 0#
size_t trimmed_element_count = 0#
struct CellMapLocation#
#include <cell_map.h>

Authoritative result of locating a world point in a CellMap.

Public Members

glm::vec3 logical = {0.0f}#
glm::ivec3 logical_cell_index = {0}#
size_t structured_element_index = 0#
class FaceUnitCell#
#include <unit_cell.h>

A normalized indexed face cell with optional integer tags.

Static face cells tile vertices in [0, 1]. Native subclasses may emit parameterized logical patches that cross an individual cell boundary.

Subclassed by PlateUnitCell

Public Functions

virtual std::shared_ptr<FaceUnitCell> clone() const#
virtual std::vector<FaceUnitCellPatch> emit_faces(const glm::ivec3 &cell_index, const CellMap &cell_map) const#

Emit logical face patches for one tiled cell.

Parameters:
  • cell_index – Integer logical cell index.

  • cell_map – Map supplying cell counts and field context.

Returns:

Triangular or quadrilateral patches in logical map coordinates.

inline virtual bool extends_map_domain() const#

Whether emitted faces may continue beyond the finite map domain.

The default preserves CellMap clipping. Native cells with a deliberate overhanging footprint may opt into extended reference mapping and bounds.

inline const std::vector<int> &face_tags() const#
inline const std::vector<std::vector<size_t>> &faces() const#
FaceUnitCell(const std::vector<glm::vec3> &vertices, const std::vector<std::vector<size_t>> &faces, const std::vector<int> &vertex_tags = {}, const std::vector<int> &face_tags = {}, const std::vector<int> &orientation_tags = {}, const std::vector<int> &material_tags = {})#

Construct a reusable indexed static face cell.

Parameters:
  • vertices – Finite normalized vertices in [0, 1].

  • faces – Indexed triangles or quadrilaterals.

  • vertex_tags – Optional per-vertex provenance tags.

  • face_tags – Optional per-face provenance tags.

  • orientation_tags – Optional per-face orientation tags.

  • material_tags – Optional per-face material IDs.

inline const std::vector<int> &material_tags() const#
inline const std::vector<int> &orientation_tags() const#
inline virtual glm::ivec3 period() const#

Return the cell’s positive tiling period on U/V/W axes.

inline const std::vector<int> &vertex_tags() const#
inline const std::vector<glm::vec3> &vertices() const#
virtual ~FaceUnitCell() = default#

Protected Functions

FaceUnitCell() = default#

Protected Attributes

std::vector<int> m_face_tags#
std::vector<std::vector<size_t>> m_faces#
std::vector<int> m_material_tags#
std::vector<int> m_orientation_tags#
std::vector<int> m_vertex_tags#
std::vector<glm::vec3> m_vertices#
struct FaceUnitCellPatch#
#include <unit_cell.h>

One triangle or quadrilateral emitted in logical CellMap coordinates.

Public Members

int face_tag = -1#
int material_tag = -1#
int orientation_tag = -1#
int unit_cell_face_id = -1#
std::vector<int> vertex_tags#
std::vector<glm::vec3> vertices#
class GraphUnitCell#
#include <unit_cell.h>

A normalized graph cell with indexed edges and optional integer tags.

Public Functions

std::shared_ptr<GraphUnitCell> clone() const#
inline const std::vector<int> &edge_tags() const#
inline const std::vector<std::pair<size_t, size_t>> &edges() const#
GraphUnitCell(const std::vector<glm::vec3> &vertices, const std::vector<std::pair<size_t, size_t>> &edges, const std::vector<int> &vertex_tags = {}, const std::vector<int> &edge_tags = {}, const std::vector<int> &orientation_tags = {}, const std::vector<int> &material_tags = {})#
inline const std::vector<int> &material_tags() const#
inline const std::vector<int> &orientation_tags() const#
inline const std::vector<int> &vertex_tags() const#
inline const std::vector<glm::vec3> &vertices() const#

Private Members

std::vector<int> m_edge_tags#
std::vector<std::pair<size_t, size_t>> m_edges#
std::vector<int> m_material_tags#
std::vector<int> m_orientation_tags#
std::vector<int> m_vertex_tags#
std::vector<glm::vec3> m_vertices#
class ImplicitUnitCell#
#include <unit_cell.h>

A periodic scalar unit cell evaluated in normalized cell coordinates.

Public Types

typedef std::function<glm::vec3(double, double, double)> GradientFunction#
typedef std::function<double(double, double, double)> ValueFunction#

Public Functions

std::shared_ptr<ImplicitUnitCell> clone() const#
double evaluate(const glm::vec3 &logical) const#
double evaluate(const glm::vec3 &logical, const AttributeSampleContext &context) const#
glm::vec3 gradient(const glm::vec3 &logical) const#
glm::vec3 gradient(const glm::vec3 &logical, const AttributeSampleContext &context) const#
ImplicitUnitCell(const ValueFunction &value, const std::optional<GradientFunction> &gradient = std::nullopt, const std::string &name = "custom")#
inline const std::string &name() const#
bool validate_periodicity(double tolerance = 1e-6) const#
std::pair<double, glm::vec3> value_and_gradient(const glm::vec3 &logical) const#
std::pair<double, glm::vec3> value_and_gradient(const glm::vec3 &logical, const AttributeSampleContext &context) const#

Public Static Functions

static std::shared_ptr<ImplicitUnitCell> mixed(const std::shared_ptr<ImplicitUnitCell> &first, const std::shared_ptr<ImplicitUnitCell> &second, const std::shared_ptr<FloatAttribute> &weight)#

Construct an aperiodic field-level mix of two periodic implicit cells.

Both source cells are validated for periodicity before their raw fields are interpolated. The cell-space weight may vary over the full logical map.

Parameters:
  • first – Cell returned when the weight is zero.

  • second – Cell returned when the weight is one.

  • weight – Cell-space scalar weight field.

Returns:

A composite implicit unit cell using finite-difference gradients.

static std::shared_ptr<ImplicitUnitCell> standard(const std::string &name)#

Private Members

std::shared_ptr<ImplicitUnitCell> m_first#
std::optional<GradientFunction> m_gradient#
std::string m_name#
bool m_periodicity_exempt = false#
std::shared_ptr<ImplicitUnitCell> m_second#
ValueFunction m_value#
std::shared_ptr<FloatAttribute> m_weight#
class PlateUnitCell : public FaceUnitCell#
#include <unit_cell.h>

The period-two folded plate cell used by mapped plate lattices.

Eccentricity is sampled at undeformed cell centers and converted with the legacy relation (1-e)/(2(1+e)). Eccentricity must remain positive.

Public Functions

virtual std::shared_ptr<FaceUnitCell> clone() const override#
inline const std::shared_ptr<FloatAttribute> &eccentricity() const#
virtual std::vector<FaceUnitCellPatch> emit_faces(const glm::ivec3 &cell_index, const CellMap &cell_map) const override#

Emit logical face patches for one tiled cell.

Parameters:
  • cell_index – Integer logical cell index.

  • cell_map – Map supplying cell counts and field context.

Returns:

Triangular or quadrilateral patches in logical map coordinates.

inline virtual bool extends_map_domain() const override#

Whether emitted faces may continue beyond the finite map domain.

The default preserves CellMap clipping. Native cells with a deliberate overhanging footprint may opt into extended reference mapping and bounds.

inline virtual glm::ivec3 period() const override#

Return the cell’s positive tiling period on U/V/W axes.

explicit PlateUnitCell(const std::shared_ptr<FloatAttribute> &eccentricity)#

Construct a folded plate cell from a legacy eccentricity field.

Parameters:

eccentricity – Positive finite field; 1.0 is the flat state.

Private Functions

double sample_eccentricity(const glm::ivec3 &cell_index, const CellMap &cell_map) const#

Private Members

std::shared_ptr<FloatAttribute> m_eccentricity#

Private Static Functions

static double convert_eccentricity(double eccentricity)#

Typedefs

template<typename T>
using AABB_tetrahedron_traits = CGAL::AABB_traits_3<SC_Kernel, TetrahedronPrimitive<T>>#

Define the AABB traits for the TetrahedronPrimitive.

template<typename T>
using AABBTree = CGAL::AABB_tree<AABB_tetrahedron_traits<T>>#

Define the AABB tree for the TetrahedronPrimitive.

template<typename T>
class Tetrahedron#
#include <tetrahedron.h>

A class that represents a tetrahedron in 3D space.

This class is used to represent a tetrahedron in 3D space. The tetrahedron is defined by four points in 3D space. The class also stores a value (template) associated with each point in the tetrahedron. Methods are provided to interpolate given a point in space within the tetrahedron.

Public Functions

inline glm::vec3 a() const#

Get the first point of the tetrahedron.

inline T a_val() const#

Get the value associated with the first point.

inline glm::vec3 b() const#

Get the second point of the tetrahedron.

inline T b_val() const#

Get the value associated with the second point.

inline glm::vec3 barycenter() const#

Compute the barycenter of the tetrahedron.

Returns:

The barycenter or center of mass of the tetrahedron

inline glm::vec4 barycentric_coordinates(const glm::vec3 &point) const#

Compute the barycentric coordinates of a point in space within the tetrahedron.

Parameters:

point – The point in space to compute the barycentric coordinates for

Returns:

The barycentric coordinates of the point

inline std::pair<glm::vec3, glm::vec3> bounding_box() const#

Compute the bounding box of the tetrahedron.

Returns:

A pair of the minimum and maximum points of the bounding box

inline glm::vec3 c() const#

Get the third point of the tetrahedron.

inline T c_val() const#

Get the value associated with the third point.

inline glm::vec3 d() const#

Get the fourth point of the tetrahedron.

inline T d_val() const#

Get the value associated with the fourth point.

inline bool is_point_inside(const glm::vec3 &point) const#

Check if a point is inside the tetrahedron.

Note

depends on barycentric_coordinates()

Parameters:

point – The point to check

Returns:

True if the point is inside the tetrahedron, false otherwise

inline glm::vec3 max_point() const#

Compute the maximum point of the tetrahedron.

Returns:

The maximum point of the tetrahedron

inline glm::vec3 min_point() const#

Compute the minimum point of the tetrahedron.

Returns:

The minimum point of the tetrahedron

inline T sample(const glm::vec3 &point) const#

Interpolate a value at a point in space within the tetrahedron.

Parameters:

point – The point in space to interpolate the value at

Returns:

The interpolated value at the point

inline void set_a(const glm::vec3 &a)#

Set the first point of the tetrahedron.

inline void set_a_val(const T &val)#

Set the value associated with the first point.

inline void set_b(const glm::vec3 &b)#

Set the second point of the tetrahedron.

inline void set_b_val(const T &val)#

Set the value associated with the second point.

inline void set_c(const glm::vec3 &c)#

Set the third point of the tetrahedron.

inline void set_c_val(const T &val)#

Set the value associated with the third point.

inline void set_d(const glm::vec3 &d)#

Set the fourth point of the tetrahedron.

inline void set_d_val(const T &val)#

Set the value associated with the fourth point.

Tetrahedron() = default#

Constructor.

inline Tetrahedron(const glm::vec3 &a, const glm::vec3 &b, const glm::vec3 &c, const glm::vec3 &d, const T &a_val, const T &b_val, const T &c_val, const T &d_val)#

Constructor.

Parameters:
  • a – The first point of the tetrahedron

  • b – The second point of the tetrahedron

  • c – The third point of the tetrahedron

  • d – The fourth point of the tetrahedron

  • a_val – The value associated with the first point

  • b_val – The value associated with the second point

  • c_val – The value associated with the third point

  • d_val – The value associated with the fourth point

inline double volume() const#

Compute the volume of the tetrahedron.

Returns:

The volume of the tetrahedron in mm^3

Private Members

glm::vec3 m_a#
T m_a_val#
glm::vec3 m_b#
T m_b_val#
glm::vec3 m_c#
T m_c_val#
glm::vec3 m_d#
T m_d_val#
template<typename T>
class TetrahedronPrimitive#
#include <tetrahedron.h>

A geometric primitive formatting generalized 3D block layouts extracting values into CGAL traits representations.

Public Types

typedef SC_Kernel::Iso_cuboid_3 Datum#
typedef const Tetrahedron<T> *Id#
typedef SC_Point Point#

Public Functions

inline Datum datum() const#

Computes CGAL aligned block matching external spatial bounds containing inner mesh features.

Returns:

Extracted block constraint metrics wrapping nodes.

inline Id id() const#

Fetch mapping linking evaluation targets back to origin objects.

Returns:

Sourced instance reference pointing underlying representations.

inline Point reference_point() const#

Fetches the geometric core mass center evaluating origins.

Returns:

Localized vertex structure evaluation parameters.

inline TetrahedronPrimitive(Tetrahedron<T> *tet)#

Initializer assigning core tetra evaluations handling values attached.

Parameters:

tet – Wrapped object mapping primitive bounds.

Public Members

Tetrahedron<T> *m_ptr#
class TetrahedralMesh#
#include <tetrahedral_mesh.h>

Pure geometric tetrahedral mesh generated from an implicit OpenVCAD tree.

The mesh stores explicit node positions and tetrahedral connectivity. It contains no solver-specific or attribute-export logic.

Public Types

using Element = std::array<size_t, 4>#

Public Functions

inline std::pair<glm::vec3, glm::vec3> bounding_box() const#

Returns the prepared bounding box used for meshing.

inline const std::vector<glm::vec3> &cell_centroids() const#

Returns the centroid of each tetrahedral element.

inline const std::vector<Element> &elements() const#

Returns the tetrahedral element connectivity.

inline const std::vector<glm::vec3> &nodes() const#

Returns the mesh node coordinates.

inline size_t number_of_elements() const#

Returns the number of tetrahedral elements.

inline size_t number_of_nodes() const#

Returns the number of mesh nodes.

TetrahedralMesh() = default#
TetrahedralMesh(const std::vector<glm::vec3> &nodes, const std::vector<Element> &elements, const std::vector<glm::vec3> &cell_centroids, const std::pair<glm::vec3, glm::vec3> &bounding_box)#

Public Static Functions

static TetrahedralMesh from_prepared_tree(const std::shared_ptr<Node> &root, const AdaptiveSettings &settings, ThreadUsageTracker *thread_usage_tracker = nullptr)#

Builds a tetrahedral mesh from an already prepared implicit tree using adaptive cell sizing.

static TetrahedralMesh from_prepared_tree(const std::shared_ptr<Node> &root, const FixedSettings &settings, ThreadUsageTracker *thread_usage_tracker = nullptr)#

Builds a tetrahedral mesh from an already prepared implicit tree using fixed cell sizing.

static TetrahedralMesh from_tree(const std::shared_ptr<Node> &root, const AdaptiveSettings &settings)#

Builds a tetrahedral mesh from an implicit tree using adaptive cell sizing.

static TetrahedralMesh from_tree(const std::shared_ptr<Node> &root, const FixedSettings &settings)#

Builds a tetrahedral mesh from an implicit tree using fixed cell sizing.

Private Members

std::pair<glm::vec3, glm::vec3> m_bounding_box#
std::vector<glm::vec3> m_cell_centroids#
std::vector<Element> m_elements#
std::vector<glm::vec3> m_nodes#
struct AdaptiveSettings#
#include <tetrahedral_mesh.h>

Settings for an adaptive tetrahedral mesh.

Public Members

size_t cell_radius_edge_ratio = 3#
double cell_size_lower = 0.5#
double cell_size_upper = 2.0#
double facet_angle = 25.0#
double facet_distance = 0.25#
double facet_size = 1.0#
std::string variable_cell_size_expression = "min_cell + (max_cell - min_cell) * clamp(h, 0, 1)"#
struct FixedSettings#
#include <tetrahedral_mesh.h>

Settings for a fixed-size tetrahedral mesh.

Public Members

size_t cell_radius_edge_ratio = 3#
double cell_size = 1.0#
double facet_angle = 25.0#
double facet_distance = 0.25#
double facet_size = 1.0#
class HexahedralMesh#
#include <hexahedral_mesh.h>

Pure geometric structured hexahedral mesh generated from an implicit OpenVCAD tree.

The mesh stores explicit node positions and hexahedral connectivity. It contains no solver-specific or attribute-export logic.

Public Types

using Element = std::array<size_t, 8>#

Public Functions

inline std::pair<glm::vec3, glm::vec3> bounding_box() const#

Returns the prepared bounding box used for meshing.

inline const std::vector<glm::vec3> &cell_centroids() const#

Returns the centroid of each hexahedral element.

inline const std::vector<Element> &elements() const#

Returns the hexahedral element connectivity.

HexahedralMesh() = default#
HexahedralMesh(const std::vector<glm::vec3> &nodes, const std::vector<Element> &elements, const std::vector<glm::vec3> &cell_centroids, const std::pair<glm::vec3, glm::vec3> &bounding_box, const glm::vec3 &voxel_size)#
inline const std::vector<glm::vec3> &nodes() const#

Returns the mesh node coordinates.

inline size_t number_of_elements() const#

Returns the number of hexahedral elements.

inline size_t number_of_nodes() const#

Returns the number of mesh nodes.

inline glm::vec3 voxel_size() const#

Returns the voxel size used for structured meshing.

Public Static Functions

static HexahedralMesh from_prepared_tree(const std::shared_ptr<Node> &root, const Settings &settings, ThreadUsageTracker *thread_usage_tracker = nullptr)#

Builds a structured hexahedral mesh from a root that has already been prepared with settings.voxel_size.

static HexahedralMesh from_tree(const std::shared_ptr<Node> &root, const Settings &settings)#

Builds a structured hexahedral mesh from an implicit tree.

Private Members

std::pair<glm::vec3, glm::vec3> m_bounding_box#
std::vector<glm::vec3> m_cell_centroids#
std::vector<Element> m_elements#
std::vector<glm::vec3> m_nodes#
glm::vec3 m_voxel_size = glm::vec3(1.0f)#
struct Settings#
#include <hexahedral_mesh.h>

Settings for a structured voxel-aligned hexahedral mesh.

Public Members

glm::vec3 voxel_size = glm::vec3(1.0f)#

Lookup tables mapping edge and triangle topologies required for traditional Marching Cubes isosurface extraction implementations.

Variables

static int EdgeTable[256]#
static int TriangleTable[4096]#
class DICOMVolume#
#include <dicom_volume.h>

A grid-based volume generated from a directory of medical DICOM slice images representing spatial density (Hounsfield units).

Public Functions

std::pair<glm::vec3, glm::vec3> bounding_box() const#

Returns the bounds encompassing the internal OpenVDB storage limits.

Returns:

Defined coordinate constraints mapping [min, max].

std::shared_ptr<DICOMVolume> clone()#

Generates a discrete copy of the DICOM volume evaluation elements.

Returns:

A cloned DICOMVolume mapping pointer.

DICOMVolume() = default#

Default constructor.

DICOMVolume(const std::string &directory, double rescale_slope = -std::numeric_limits<double>::infinity(), double rescale_intercept = -std::numeric_limits<double>::infinity(), double slice_thickness = -std::numeric_limits<double>::infinity(), double x_pixel_spacing = -std::numeric_limits<double>::infinity(), double y_pixel_spacing = -std::numeric_limits<double>::infinity())#

Construct a DICOM volume from the given directory.

Parameters:

directory – The directory containing the DICOM stack.

double sample(double x, double y, double z) const#

Sample the volume at the given world coordinates.

Note

The coordinates are in world space, not voxel space. This will use interpolation to sample the volume.

Parameters:
  • x – The x-coordinate in mm.

  • y – The y-coordinate in mm.

  • z – The z-coordinate in mm.

Returns:

The Hounsfield value at the given coordinates.

void set(double hounsfield_value, size_t x, size_t y, size_t z)#

Set the Hounsfield value at the given voxel coordinates.

Note

This will set the value directly in the volume grid. This are in grid indices, not world space.

Parameters:
  • hounsfield_value – The Hounsfield value to set.

  • x – The x-coordinate in voxel space.

  • y – The y-coordinate in voxel space.

  • z – The z-coordinate in voxel space.

Private Types

using GridType = openvdb::DoubleGrid#

Private Functions

std::vector<std::vector<double>> load_dicom_image(const std::string &file_path)#

Load a single DICOM image from the given file path and return the pixel data as a 2D vector.

void load_dicom_stack(const std::string &directory)#

Load a DICOM stack from the given directory into an OpenVDB volume.

Parameters:

directory – The directory containing the DICOM stack.

Private Members

double m_rescale_intercept = -std::numeric_limits<double>::infinity()#
double m_rescale_slope = -std::numeric_limits<double>::infinity()#
openvdb::tools::GridSampler<GridType, openvdb::tools::BoxSampler>::Ptr m_sampler#
GridType::Ptr m_volume#
double m_x_size = 0#
double m_x_spacing = -std::numeric_limits<double>::infinity()#
double m_y_size = 0#
double m_y_spacing = -std::numeric_limits<double>::infinity()#
double m_z_size = 0#
double m_z_spacing = -std::numeric_limits<double>::infinity()#

Private Static Functions

static DICOM_Meta_Data GetDICOMMetaData(const std::string &file_path)#

Get the metadata for a DICOM image from the given file path.

static double GetRescaledValue(Uint16 pixel_value, double rescale_slope, double rescale_intercept)#
struct DICOM_Meta_Data#

Public Members

bool found_rescale_intercept = false#
bool found_rescale_slope = false#
bool found_thickness = false#
bool found_width_and_height = false#
bool found_xy_spacing = false#
size_t height = 0#
double rescale_intercept = 0.0#
double rescale_slope = 1.0#
double slice_thickness = 1#
size_t width = 0#
double x_pixel_spacing = -1#
double y_pixel_spacing = -1#

Typedefs

using AABB_node_traits = CGAL::AABB_traits<SC_Kernel, NodeBBoxPrimitive>#

Define the AABB traits for the NodeBBoxPrimitive.

using NodeAABBTree = CGAL::AABB_tree<AABB_node_traits>#

Define the AABB tree for the NodeBBoxPrimitive.

struct NodeBBoxPrimitive#
#include <node_bbox_primitive.h>

A geometric primitive wrapper converting internal OpenVCAD Node bounds to CGAL AABB tree compatible formats.

Public Types

typedef SC_Kernel::Iso_cuboid_3 Datum#
typedef std::shared_ptr<Node> Id#
typedef SC_Point Point#

Public Functions

inline Datum datum() const#

Generates local coordinate constraints matching the Node topology block.

Returns:

Formatted CGAL bounding box matching extraction sizes.

inline Id id() const#

Fetch the associated source node instance.

Returns:

Pointer reference mapping the original source Node.

inline NodeBBoxPrimitive(const std::shared_ptr<Node> &node)#

Initializes a generic primitive shell extracting evaluation constraints from a base Node.

Parameters:

node – Target geometry entity to bound.

inline Point reference_point() const#

Computes the centered evaluation point representing the primitive origin offset.

Returns:

Point matching geometric centroid layout.

Public Members

std::shared_ptr<Node> m_ptr#

Typedefs

using AABB_vcad_node_traits = CGAL::AABB_traits_3<SC_Kernel, VCADNodeBBoxPrimitive>#
using AABBVCADTree = CGAL::AABB_tree<AABB_vcad_node_traits>#
struct VCADNodeBBoxPrimitive#
#include <vcad_node_bbox_primitive.h>

A geometric primitive wrapper converting internal OpenVCAD Node bounds with an expanded padding bandwidth to CGAL AABB tree compatible formats.

Public Types

typedef SC_Kernel::Iso_cuboid_3 Datum#
typedef const Node *Id#
typedef SC_Point Point#

Public Functions

inline Datum datum() const#

Generates local coordinate constraints matching the Node topology block expanded by the bandwidth.

Returns:

Formatted CGAL bounding box matching extraction sizes.

inline Id id() const#

Fetch the associated source node instance.

Returns:

Pointer reference mapping the original source Node.

inline Point reference_point() const#

Computes the centered evaluation point representing the primitive origin offset.

Returns:

Point matching geometric centroid layout.

inline VCADNodeBBoxPrimitive(const std::shared_ptr<Node> &node, double bandwidth)#

Initializes a generic primitive shell extracting evaluation constraints from a base Node with an expanded bandwidth.

Parameters:
  • node – Target geometry entity to bound.

  • bandwidth – Padding threshold adjusting external bound scales.

Public Members

double m_bandwidth = {1.0}#
std::shared_ptr<Node> m_ptr#