Class t8_cad
Defined in File t8_cad.hxx
Class Documentation
-
class t8_cad
This class manages OpenCASCADE shapes and implements helper functions for working with the shapes.
Public Functions
-
t8_cad(std::string fileprefix)
Constructor of the cad shape. The shape is initialized based on a .brep file with the given prefix. The internal structure extracts and stores geometric information such as vertices, edges, and faces from this file. The number and type of vertices should match the tree type (quad/hex/tri), and the cad data must be valid. This constructor is intended for general use, including file-based mesh creation.
- Parameters:
fileprefix – [in] Prefix of a .brep file from which to extract cad geometry.
-
t8_cad(const TopoDS_Shape cad_shape)
Constructor of the cad shape. The shape is initialized directly from an existing TopoDS_Shape. This constructor is especially useful for use in scripts, testing, or integration with mesh generators that already provide geometry in memory. It avoids file I/O and allows full control over the CAD input.
- Parameters:
cad_shape – [in] cad shape geometry object.
-
t8_cad()
Constructor of the cad shape for testing purposes. Sets an invalid cad_shape.
-
int t8_geom_is_line(const int curve_index) const
Check if a cad_curve is a line.
- Parameters:
curve_index – [in] The index of the cad_curve.
- Returns:
1 if curve is a line, 0 if curve is not a line.
-
int t8_geom_is_plane(const int surface_index) const
Check if a cad_surface is a plane.
- Parameters:
surface_index – [in] The index of the cad_surface.
- Returns:
1 if surface is a plane linear, 0 if surface is not a plane.
-
const gp_Pnt t8_geom_get_cad_point(const int index) const
Get an cad point from the cad_shape.
- Parameters:
index – [in] The index of the point in the cad_shape.
- Returns:
The cad point.
-
const Handle_Geom_Curve t8_geom_get_cad_curve(const int index) const
Get an cad curve from the cad_shape.
- Parameters:
index – [in] The index of the curve in the cad_shape.
- Returns:
The cad curve.
-
const Handle_Geom_Surface t8_geom_get_cad_surface(const int index) const
Get an cad surface from the cad_shape.
- Parameters:
index – [in] The index of the surface in the cad_shape.
- Returns:
The cad surface.
-
const TopTools_IndexedMapOfShape t8_geom_get_cad_shape_vertex_map() const
Get the cad_shape_vertex2edge_map.
- Returns:
The cad_shape_vertex_map.
-
const TopTools_IndexedMapOfShape t8_geom_get_cad_shape_edge_map() const
Get the cad_shape_edge2face_map.
- Returns:
The cad_shape_edge_map.
-
const TopTools_IndexedMapOfShape t8_geom_get_cad_shape_face_map() const
Get the cad_shape_face_map.
- Returns:
The cad_shape_face_map.
-
int t8_geom_get_common_edge(const int vertex1_index, const int vertex2_index) const
Check if two cad points share a common cad edge.
- Parameters:
vertex1_index – [in] The index of the first cad point.
vertex2_index – [in] The index of the second cad point.
- Returns:
Index of the shared edge. 0 if there is no shared edge.
-
int t8_geom_get_common_face(const int edge1_index, const int edge2_index) const
Check if two cad edges share a common cad face.
- Parameters:
edge1_index – [in] The index of the first cad edge.
edge2_index – [in] The index of the second cad edge.
- Returns:
Index of the shared face. 0 if there is no shared face.
-
int t8_geom_is_vertex_on_edge(const int vertex_index, const int edge_index) const
Check if a cad vertex lies on an cad edge.
- Parameters:
vertex_index – [in] The index of the cad vertex.
edge_index – [in] The index of the cad edge.
- Returns:
1 if vertex lies on edge, otherwise 0.
-
int t8_geom_is_edge_on_face(const int edge_index, const int face_index) const
Check if a cad vertex lies on an cad edge.
- Parameters:
edge_index – [in] The index of the cad vertex.
face_index – [in] The index of the cad edge.
- Returns:
1 if vertex lies on edge, otherwise 0.
-
int t8_geom_is_vertex_on_face(const int vertex_index, const int face_index) const
Check if a cad vertex lies on an cad face.
- Parameters:
vertex_index – [in] The index of the cad vertex.
face_index – [in] The index of the cad face.
- Returns:
1 if vertex lies on face, otherwise 0.
-
void t8_geom_get_parameter_of_vertex_on_edge(const int vertex_index, const int edge_index, double *edge_param) const
Retrieves the parameter of an cad vertex on an cad edge. The vertex has to lie on the edge.
- Parameters:
vertex_index – [in] The index of the cad vertex.
edge_index – [in] The index of the cad edge.
edge_param – [out] The parameter of the vertex on the edge.
-
void t8_geom_get_parameters_of_vertex_on_face(const int vertex_index, const int face_index, double *face_params) const
Retrieves the parameters of an cad vertex on a cad face. The vertex has to lie on the face.
- Parameters:
vertex_index – [in] The index of the cad vertex.
face_index – [in] The index of the cad face.
face_params – [out] The parameters of the vertex on the face.
-
void t8_geom_edge_parameter_to_face_parameters(const int edge_index, const int face_index, const int num_face_nodes, const double edge_param, const double *surface_params, double *face_params) const
Converts the parameters of an cad edge to the corresponding parameters on an cad face. The edge has to lie on the face. For the conversion of edge parameters of mesh elements to topological face parameters of a closed surface, it is additionally checked, whether the conversion was correct, to prevent disorted elements.
- Parameters:
edge_index – [in] The index of the cad edge, which parameters should be converted to face parameters.
face_index – [in] The index of the cad face, on to which the edge parameters should be converted.
num_face_nodes – [in] The number of the face nodes of the evaluated element. Only needed for closed surface check, otherwise NULL.
edge_param – [in] The parameter on the edge.
surface_params – [in] The parameters of the surface nodes. When provided, there are additional checks for closed geometries. If there are no surface parameter to pass in to the function, you can pass NULL.
face_params – [out] The corresponding parameters on the face.
-
void t8_geom_get_face_parametric_bounds(const int surface_index, double *bounds) const
Finds the parametric bounds of an cad face.
- Parameters:
surface_index – [in] The index of the cad face.
bounds – [out] The parametric bounds of the cad face.
-
void t8_geom_get_edge_parametric_bounds(const int edge_index, double *bounds) const
Finds the parametric bounds of an cad edge.
- Parameters:
edge_index – [in] The index of the cad edge.
bounds – [out] The parametric bounds of the cad edge.
-
int t8_geom_is_edge_closed(int edge_index) const
Checks if an edge is closed in its U parameter.
- Parameters:
edge_index – [in] The index of the closed edge.
- Returns:
1 if edge is closed in U. 0 if edge is not closed in U.
-
int t8_geom_is_surface_closed(int geometry_index, int parameter) const
Checks if a surface is closed in its U parameter or V parameter.
- Parameters:
geometry_index – [in] The index of the closed geometry.
parameter – [in] The parameter, which should be check for closeness. 0 stands for the U parameter and 1 for the V parameter.
- Returns:
1 if geometry is closed in U. 0 if geometry is not closed in U.
-
t8_cad(std::string fileprefix)