hexed 0.4.0
 
Loading...
Searching...
No Matches
hexed::brep::Geom_3d Class Reference

a Surface_geom consisting of a set of 3D Trimmed_surfaces More...

#include <brep.hpp>

Inheritance diagram for hexed::brep::Geom_3d:
hexed::Surface_geom

Public Member Functions

 Geom_3d (std::string file_name, Int n_div_min, Int n_div_max, double coincidence_bbox_tol, double coincidence_abs_tol, double coincidence_precision_tol, double tangency_angle_tol, double tangency_precision_tol)
 
void visualize (std::string format, std::string file_name, Int n_div=100, bool vis_volume=true, Mat< 3, 2 > bounds=Mat< 3 >::Ones() *Mat< 2 >::Unit(1).transpose())
 Writes visualization files of the geometry to help diagnose import/translation bugs.
 
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, bool high_prec=true) override
 Computes the set of intersection points between a line and the surface.
 
next::Sequence< const Geom_edge & > edges () override
 Returns a list of any geometry edges that require mesh edges to be snapped to them.
 
next::Sequence< const Trimmed_surface & > surfaces ()
 
- Public Member Functions inherited from hexed::Surface_geom
virtual next::Sequence< Mat< 3 > > points ()
 

Detailed Description

a Surface_geom consisting of a set of 3D Trimmed_surfaces

Constructor & Destructor Documentation

◆ Geom_3d()

hexed::brep::Geom_3d::Geom_3d ( std::string file_name,
Int n_div_min,
Int n_div_max,
double coincidence_bbox_tol,
double coincidence_abs_tol,
double coincidence_precision_tol,
double tangency_angle_tol,
double tangency_precision_tol )
Parameters
file_nameName of file containing geometry. Must be in IGES format.
n_div_minSee Trimmed_surface::Trimmed_surface
n_div_maxSee Trimmed_surface::Trimmed_surface
coincidence_bbox_tolTolerance for determining whether features are coincident, relative to the size of the overall bounding box.
coincidence_abs_tolAbsolute (dimensional) tolerance for determining coincidence. relative to the size of the overall bounding box.
coincidence_precision_tolCoincidence_tolerance relative to the length of descretized edge segments.
tangency_angle_tolAbsolute tolerance on the angle (in radians) at which features join for determining whether they are tangent.
tangency_precision_tolTangency angle tolerance as a fraction of \(2\pi/\)n_div_max.
Note
All tolerances in the same category (coincidence or tangency) are additive, so the least-strict tolerance dominates.

Member Function Documentation

◆ edges()

next::Sequence< const Geom_edge & > hexed::brep::Geom_3d::edges ( )
overridevirtual

Returns a list of any geometry edges that require mesh edges to be snapped to them.

Only used in 3D. Default implementation returns an empty sequence, but derived classes may override.

Reimplemented from hexed::Surface_geom.

◆ intersections()

std::vector< double > hexed::brep::Geom_3d::intersections ( Mat<> point0,
Mat<> point1,
bool high_precision = true )
overridevirtual

Computes the set of intersection points between a line and the surface.

The line is defined parametrically to be the set of points \( [\text{point0}] + t [\text{point1}] \) for all \( t \in \mathbb{R} \). Returns the (potentially empty) set of \( t \) values where the line intersects the surface.

Deprecated
Newer methods should be based purely on nearest point projections.

Implements hexed::Surface_geom.

◆ nearest_point()

Nearest_point< dyn > hexed::brep::Geom_3d::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.

◆ visualize()

void hexed::brep::Geom_3d::visualize ( std::string format,
std::string file_name,
Int n_div = 100,
bool vis_volume = true,
Mat< 3, 2 > bounds = Mat< 3 >::Ones() *Mat< 2 >::Unit(1).transpose() )

Writes visualization files of the geometry to help diagnose import/translation bugs.

For visualization purposes, entities will be discretized with n_div segments. This is not the same as the n_div passed to the constructor, and need not be a power of 2. It should usually be much less than the n_div passed to the constructor, because visualization is more expensive than nearest-point calculations and requires less precision.

If the input file is named INPUT_FILE and the file extension of the specified visualization format is EXT, the visualization files are:

  • FILE_NAME_curves.EXT: Contains all bounding curves of all surfaces.
  • FILE_NAME_surfaces.EXT: Contains all parametric surfaces (for all parameters in \( [0, 1] \times [0, 1] \)). The surfaces have a field variable "inside" which is set to 1 for all points that are inside the bounding curves and 0 for all that are outside. Pro tip: In Paraview, you can get a sense of the actual geometry by enabling opacity mapping so that the trimmed regions are transparent.
  • FILE_NAME_distance.EXT (only if vis_volume = true): A 3D block with corners given by the columns of bounds and a field variable indicating the distance from the nearest point on the surface. This can be a good way to debug the distance calculations, assuming the geometry is correct.

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