hexed 0.3.0
 
Loading...
Searching...
No Matches
hexed::Occt::Geom Class Reference

A Surface_geom that interacts with a CAD object directly. More...

#include <Occt.hpp>

Inheritance diagram for hexed::Occt::Geom:
hexed::Surface_geom

Public Member Functions

 Geom (const TopoDS_Shape &, int n_dim, double angle=10 *constants::degree, double deflection=huge, int n_segments=1000)
 Construct directly from an OCCT shape object.
 
Nearest_point< dynnearest_point (Mat<> point, double max_distance=huge, double distance_guess=huge) override
 Computes the point on the surface which is nearest to point within max_distance.
 
std::vector< double > intersections (Mat<> point0, Mat<> point1) override
 
void visualize (std::string format, std::string file_name)
 Visualizes the triangulated geometry.
 

Detailed Description

A Surface_geom that interacts with a CAD object directly.

Represents a CAD object defined with the OCCT interface as a Surface_geom. Implements nearest_point and intersections by directly working with the OCCT projection and intersection functions, which can in principle be faster than working with triangulations when high accuracy is desired. However, it has two important drawbacks:

  • Projections and intersections are not very robust, which defeats the whole purpose of Hexed which is robust and automated meshing.
  • It cannot understand face trimming, which is required to correctly represent some 3D shapes defined with BRep Topology. It only supports curves and faces that are purely parametric (they are not trimmed by any curves).

As a result, the preferred way to interact with CAD geometry is to discretize it with triangles() and then convert it to a Simplex geom.

Constructor & Destructor Documentation

◆ Geom()

hexed::Occt::Geom::Geom ( const TopoDS_Shape & shape,
int n_dim,
double angle = 10*constants::degree,
double deflection = huge,
int n_segments = 1000 )

Construct directly from an OCCT shape object.

The shape is interpreted to have dimensionality specified by n_dim, which may be either 2 or 3. All input points must have n_dim elements, as will all output points. If 3D, only faces are considered. If 2D, only edges are considered, and all are projected onto the \( x_2 = 0 \) plane (i.e. xy-plane). Coordinates are interpreted dimensionally and automatically converted to m.

Member Function Documentation

◆ intersections()

std::vector< double > hexed::Occt::Geom::intersections ( Mat<> point0,
Mat<> point1 )
overridevirtual
Note
May return duplicate points if intersection is on the boundary of multiple faces.

Implements hexed::Surface_geom.

◆ nearest_point()

Nearest_point< dyn > hexed::Occt::Geom::nearest_point ( Mat<> point,
double max_distance = huge,
double distance_guess = huge )
overridevirtual

Computes the point on the surface which is nearest to point within max_distance.

If no point is found, returns an empty Nearest_point.

Parameters
pointThe point you want to find the nearest point to.
max_distanceOnly consider points within max_distance of point.
distance_guessIf you have some reason to suspect the nearest point is within a certain distance of the input point, you can pass it to this parameter as a hint to possibly improve performance.

Implements hexed::Surface_geom.


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