hexed 0.3.0
 
Loading...
Searching...
No Matches
hexed::Simplex_geom< n_dim > Class Template Reference

Represents discrete geometry composed of simplices. More...

#include <Simplex_geom.hpp>

Inheritance diagram for hexed::Simplex_geom< n_dim >:
hexed::Simplex_geom_nd hexed::Surface_geom

Public Member Functions

 Simplex_geom (const std::vector< Mat< n_dim, n_dim > > &sims, const std::vector< Mat< n_dim - 1, n_dim > > &params={}, const std::vector< int > &face={})
 
const std::vector< Mat< n_dim, n_dim > > & simplices () const
 
const std::vector< Mat< n_dim - 1, n_dim > > & parameters () const
 
const std::vector< int > & faces () const
 
Nearest_point< dynnearest_point (Mat<> point, double max_distance=huge, double distance_guess=huge) override
 
Intersections simplex_intersections (Mat<> point0, Mat<> point1) override
 
std::vector< double > intersections (Mat<> point0, Mat<> point1) override
 
void visualize (std::string format, std::string file_name) override
 Writes geometry to a visualization file with the specified name + file extension.
 

Public Attributes

double gap_tol = 1e-6
 extend triangles by this amount, relative to their original size, to fill gaps
 

Related Symbols

(Note that these are not member symbols.)

std::vector< Mat< 2, 2 > > segments (const Mat< dyn, dyn > &points)
 Creates simplices from an ordered array of points representing a polygonal curve.
 

Additional Inherited Members

- Static Public Member Functions inherited from hexed::Simplex_geom_nd
static std::string performance_report ()
 if compiled with HEXED_OBSESSIVE_TIMING ON, return a performance report. Otherwise, empty string.
 

Detailed Description

template<int n_dim>
class hexed::Simplex_geom< n_dim >

Represents discrete geometry composed of simplices.

This can be used as an interface for geometry derived from an STL file in 3D or a list of node coordinates in 2D. Each simplex is represented as an n_dim by n_dim matrix where each column is the coordinates of one vertex. The order of the vertices is arbitrary, and there are no requirements on inter-simplex continuity. Since the Surface_geom interface is so minimal, the geometry is simply viewed as a collection of unrelated simplices, so we do not care about orientation or watertightness. The you are free to modify the simplex list at will, since there are no requirements on it. All input points must have exactly n_dim entries.

See also
Occt::segments
Occt::triangles

Member Function Documentation

◆ intersections()

template<int n_dim>
std::vector< double > hexed::Simplex_geom< n_dim >::intersections ( Mat<> point0,
Mat<> point1 )
inlineoverridevirtual

Evaluates intersections with each individual element and assembles a global list. Intersections with the boundary of a simplex are always considered valid intersections, so if the line passes exactly through the shared boundary of multiple _simplices then duplicate intersections may be obtained.

Implements hexed::Surface_geom.

◆ nearest_point()

template<int n_dim>
Nearest_point< dyn > hexed::Simplex_geom< n_dim >::nearest_point ( Mat<> point,
double max_distance = huge,
double distance_guess = huge )
inlineoverridevirtual

Iterates through all _simplices and finds the nearest point on each, whether that point lies in the interior or on the edge or a vertex. Returns the global nearest of all those points. distance_guess is taken into account, and it is generally preferable to overestimate rather than underestimate.

Implements hexed::Surface_geom.

◆ simplex_intersections()

template<int n_dim>
Intersections hexed::Simplex_geom< n_dim >::simplex_intersections ( Mat<> point0,
Mat<> point1 )
inlineoverridevirtual

◆ visualize()

template<int n_dim>
void hexed::Simplex_geom< n_dim >::visualize ( std::string format,
std::string file_name )
overridevirtual

Writes geometry to a visualization file with the specified name + file extension.

Only for 3D. For 2D, does nothing.

Implements hexed::Simplex_geom_nd.

Friends And Related Symbol Documentation

◆ segments()

template<int n_dim>
std::vector< Mat< 2, 2 > > segments ( const Mat< dyn, dyn > & points)
related

Creates simplices from an ordered array of points representing a polygonal curve.

points must have exactly 2 rows. Each column of points is the coordinates of one point. The curve may or may not be closed. Each point represents a unique vertex – duplicate points are allowed, but you don't need to include each interior point twice. The result can be used to construct a Simplex_geom<2>.

See also
read_csv()

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