Part::Tools Class Reference

#include <Tools.h>

Public Member Functions

 Handle (Geom_Surface) makeSurface(const TColStd_ListOfTransient &theBoundaries
 

Static Public Member Functions

static void applyTransformationOnNormals (const TopLoc_Location &loc, std::vector< gp_Vec > &normals)
 applyTransformationOnNormals Apply the transformation to the vectors More...
 
static TopLoc_Location fromPlacement (const Base::Placement &)
 fromPlacement Converts a placement into a TopLoc_Location More...
 
static void getNormal (const Handle(Geom_Surface)&surf, double u, double v, const Standard_Real tol, gp_Dir &dir, Standard_Boolean &done)
 getNormal Returns the normal at the given parameters on the surface and the state of the calculation More...
 
static void getNormal (const TopoDS_Face &face, double u, double v, const Standard_Real tol, gp_Dir &dir, Standard_Boolean &done)
 getNormal Returns the normal at the given parameters on the face and the state of the calculation. The orientation is taken into account More...
 
static void getPointNormals (const std::vector< gp_Pnt > &points, const std::vector< Poly_Triangle > &facets, std::vector< gp_Vec > &vertexnormals)
 getPointNormals Calculate the point normals of the given triangulation. More...
 
static void getPointNormals (const std::vector< gp_Pnt > &points, const TopoDS_Face &face, std::vector< gp_Vec > &vertexnormals)
 getPointNormals Computes the more accurate surface normals for the points. If the calculation for a point fails then the precomputed point normal of the triangulation is used. More...
 
static void getPointNormals (const TopoDS_Face &face, Handle(Poly_Triangulation) aPoly, std::vector< gp_Vec > &normals)
 getPointNormals Computes the exact surface normals for the points by using the UV coordinates of the mesh vertexes. More...
 
static void getPointNormals (const TopoDS_Face &face, Handle(Poly_Triangulation) aPoly, TColgp_Array1OfDir &normals)
 getPointNormals Computes the exact surface normals for the points by using the UV coordinates of the mesh vertexes. More...
 
static bool getPolygon3D (const TopoDS_Edge &edge, std::vector< gp_Pnt > &points)
 getPolygon3D More...
 
static bool getPolygonOnTriangulation (const TopoDS_Edge &edge, const TopoDS_Face &face, std::vector< gp_Pnt > &points)
 getPolygonOnTriangulation Get the polygon of edge. More...
 
static bool getTriangulation (const TopoDS_Face &face, std::vector< gp_Pnt > &points, std::vector< Poly_Triangle > &facets)
 getTriangulation The indexes of the triangles are adjusted to the points vector. More...
 
static Handle (Poly_Polygon3D) polygonOfEdge(const TopoDS_Edge &edge
 polygonOfEdge Returns the polygon of the edge of the tessellated shape. In case the edge has infinite length the polygon of a limited parameter range is computed. More...
 
static Handle (Poly_Triangulation) triangulationOfFace(const TopoDS_Face &face)
 triangulationOfInfinite Returns the triangulation of the face of the tessellated shape. In case the face has infinite lengths the triangulation of a limited parameter range is computed. More...
 

Public Attributes

static TopLoc_Location & loc
 
const Standard_Real const Standard_Integer const Standard_Integer const Standard_Integer theMaxDeg
 
const Standard_Real const Standard_Integer const Standard_Integer theNbIter
 
const Standard_Real const Standard_Integer theNbPnts
 
const Standard_Real theTol
 

Member Function Documentation

◆ applyTransformationOnNormals()

void Part::Tools::applyTransformationOnNormals ( const TopLoc_Location &  loc,
std::vector< gp_Vec > &  normals 
)
static

applyTransformationOnNormals Apply the transformation to the vectors

Parameters
loc
normals

Referenced by PartDesignGui::ViewProviderAddSub::updateAddSubShapeIndicator().

◆ fromPlacement()

TopLoc_Location Part::Tools::fromPlacement ( const Base::Placement plm)
static

fromPlacement Converts a placement into a TopLoc_Location

Returns
TopLoc_Location

References Base::Placement::getPosition(), Base::Placement::getRotation(), and Base::Rotation::getValue().

◆ getNormal() [1/2]

void Part::Tools::getNormal ( const Handle(Geom_Surface)&  surf,
double  u,
double  v,
const Standard_Real  tol,
gp_Dir &  dir,
Standard_Boolean &  done 
)
static

getNormal Returns the normal at the given parameters on the surface and the state of the calculation

Parameters
surf
u
v
tol
dir
done

References draftgeoutils.general::v1().

Referenced by Part::GeomSurface::normal().

◆ getNormal() [2/2]

void Part::Tools::getNormal ( const TopoDS_Face &  face,
double  u,
double  v,
const Standard_Real  tol,
gp_Dir &  dir,
Standard_Boolean &  done 
)
static

getNormal Returns the normal at the given parameters on the face and the state of the calculation. The orientation is taken into account

Parameters
face
u
v
tol
dir
done

◆ getPointNormals() [1/4]

void Part::Tools::getPointNormals ( const std::vector< gp_Pnt > &  points,
const std::vector< Poly_Triangle > &  facets,
std::vector< gp_Vec > &  vertexnormals 
)
static

◆ getPointNormals() [2/4]

void Part::Tools::getPointNormals ( const std::vector< gp_Pnt > &  points,
const TopoDS_Face &  face,
std::vector< gp_Vec > &  vertexnormals 
)
static

getPointNormals Computes the more accurate surface normals for the points. If the calculation for a point fails then the precomputed point normal of the triangulation is used.

Parameters
points
face
vertexnormals

◆ getPointNormals() [3/4]

void Part::Tools::getPointNormals ( const TopoDS_Face &  face,
Handle(Poly_Triangulation)  aPoly,
std::vector< gp_Vec > &  normals 
)
static

getPointNormals Computes the exact surface normals for the points by using the UV coordinates of the mesh vertexes.

Parameters
face
aPoly
vertexnormals

◆ getPointNormals() [4/4]

void Part::Tools::getPointNormals ( const TopoDS_Face &  face,
Handle(Poly_Triangulation)  aPoly,
TColgp_Array1OfDir &  normals 
)
static

getPointNormals Computes the exact surface normals for the points by using the UV coordinates of the mesh vertexes.

Parameters
face
aPoly
vertexnormals

References draftgeoutils.general::v1().

◆ getPolygon3D()

bool Part::Tools::getPolygon3D ( const TopoDS_Edge &  edge,
std::vector< gp_Pnt > &  points 
)
static

getPolygon3D

Parameters
edge
points
Returns
true if a polygon exists or false otherwise

Referenced by Part::TopoShape::exportLineSet(), and Part::TopoShape::getLinesFromSubElement().

◆ getPolygonOnTriangulation()

bool Part::Tools::getPolygonOnTriangulation ( const TopoDS_Edge &  edge,
const TopoDS_Face &  face,
std::vector< gp_Pnt > &  points 
)
static

getPolygonOnTriangulation Get the polygon of edge.

Note
edge must belong to face.
Parameters
edge
face
points
Returns
true if a triangulation exists or false otherwise

Referenced by Part::TopoShape::exportLineSet(), and Part::TopoShape::getLinesFromSubElement().

◆ getTriangulation()

bool Part::Tools::getTriangulation ( const TopoDS_Face &  face,
std::vector< gp_Pnt > &  points,
std::vector< Poly_Triangle > &  facets 
)
static

getTriangulation The indexes of the triangles are adjusted to the points vector.

Parameters
face
points
facets
Returns
true if a triangulation exists or false otherwise

Referenced by Part::TopoShape::exportFaceSet(), Part::TopoShape::getDomains(), PartDesignGui::ViewProviderAddSub::updateAddSubShapeIndicator(), Raytracing::LuxTools::writeShape(), Raytracing::PovTools::writeShape(), and Raytracing::PovTools::writeShapeCSV().

◆ Handle() [1/3]

Part::Tools::Handle ( Geom_Surface  ) const &

◆ Handle() [2/3]

static Part::Tools::Handle ( Poly_Polygon3D  ) const &
static

polygonOfEdge Returns the polygon of the edge of the tessellated shape. In case the edge has infinite length the polygon of a limited parameter range is computed.

Parameters
edge
loc

◆ Handle() [3/3]

static Part::Tools::Handle ( Poly_Triangulation  ) const &
static

triangulationOfInfinite Returns the triangulation of the face of the tessellated shape. In case the face has infinite lengths the triangulation of a limited parameter range is computed.

Parameters
edge
loc

Member Data Documentation

◆ loc

TopLoc_Location& Part::Tools::loc

◆ theMaxDeg

const Standard_Real const Standard_Integer const Standard_Integer const Standard_Integer Part::Tools::theMaxDeg

◆ theNbIter

const Standard_Real const Standard_Integer const Standard_Integer Part::Tools::theNbIter

◆ theNbPnts

const Standard_Real const Standard_Integer Part::Tools::theNbPnts

◆ theTol

const Standard_Real Part::Tools::theTol

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