A Surface_geom
that interacts with a CAD object directly.
More...
#include <Occt.hpp>
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< dyn > | nearest_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. | |
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:
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
.
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.
|
overridevirtual |
Implements hexed::Surface_geom.
|
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
.
point | The point you want to find the nearest point to. |
max_distance | Only consider points within max_distance of point . |
distance_guess | If 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.