Open CASCADE Technology
7.4.0
|
Tool class accumulating common geometrical functions as well as functionality using shape geometry to produce data necessary for tessellation. General aim is to calculate discretization points for the given curve or iso curve of surface according to the specified parameters. More...
#include <BRepMesh_GeomTool.hxx>
Public Types | |
enum | IntFlag { NoIntersection, Cross, EndPointTouch, PointOnSegment, Glued, Same } |
Enumerates states of segments intersection check. More... | |
Public Member Functions | |
BRepMesh_GeomTool (const BRepAdaptor_Curve &theCurve, const Standard_Real theFirstParam, const Standard_Real theLastParam, const Standard_Real theLinDeflection, const Standard_Real theAngDeflection, const Standard_Integer theMinPointsNb=2, const Standard_Real theMinSize=Precision::Confusion()) | |
Constructor. Initiates discretization of the given geometric curve. More... | |
BRepMesh_GeomTool (const Handle< BRepAdaptor_HSurface > &theSurface, const GeomAbs_IsoType theIsoType, const Standard_Real theParamIso, const Standard_Real theFirstParam, const Standard_Real theLastParam, const Standard_Real theLinDeflection, const Standard_Real theAngDeflection, const Standard_Integer theMinPointsNb=2, const Standard_Real theMinSize=Precision::Confusion()) | |
Constructor. Initiates discretization of geometric curve corresponding to iso curve of the given surface. More... | |
Standard_Integer | AddPoint (const gp_Pnt &thePoint, const Standard_Real theParam, const Standard_Boolean theIsReplace=Standard_True) |
Adds point to already calculated points (or replaces existing). More... | |
Standard_Integer | NbPoints () const |
Returns number of discretization points. More... | |
Standard_Boolean | Value (const Standard_Integer theIndex, const Standard_Real theIsoParam, Standard_Real &theParam, gp_Pnt &thePoint, gp_Pnt2d &theUV) const |
Gets parameters of discretization point with the given index. More... | |
Standard_Boolean | Value (const Standard_Integer theIndex, const Handle< BRepAdaptor_HSurface > &theSurface, Standard_Real &theParam, gp_Pnt &thePoint, gp_Pnt2d &theUV) const |
Gets parameters of discretization point with the given index. More... | |
static API | |
static Standard_Boolean | Normal (const Handle< BRepAdaptor_HSurface > &theSurface, const Standard_Real theParamU, const Standard_Real theParamV, gp_Pnt &thePoint, gp_Dir &theNormal) |
Computes normal to the given surface at the specified position in parametric space. More... | |
static IntFlag | IntLinLin (const gp_XY &theStartPnt1, const gp_XY &theEndPnt1, const gp_XY &theStartPnt2, const gp_XY &theEndPnt2, gp_XY &theIntPnt, Standard_Real(&theParamOnSegment)[2]) |
Checks intersection between two lines defined by two points. More... | |
static IntFlag | IntSegSeg (const gp_XY &theStartPnt1, const gp_XY &theEndPnt1, const gp_XY &theStartPnt2, const gp_XY &theEndPnt2, const Standard_Boolean isConsiderEndPointTouch, const Standard_Boolean isConsiderPointOnSegment, gp_Pnt2d &theIntPnt) |
Checks intersection between the two segments. Checks that intersection point lies within ranges of both segments. More... | |
static Standard_Real | SquareDeflectionOfSegment (const gp_Pnt &theFirstPoint, const gp_Pnt &theLastPoint, const gp_Pnt &theMidPoint) |
Compute deflection of the given segment. More... | |
static std::pair< Standard_Integer, Standard_Integer > | CellsCount (const Handle< Adaptor3d_HSurface > &theSurface, const Standard_Integer theVerticesNb, const Standard_Real theDeflection, const BRepMesh_DefaultRangeSplitter *theRangeSplitter) |
Computes normal to the given surface at the specified position in parametric space. More... | |
Tool class accumulating common geometrical functions as well as functionality using shape geometry to produce data necessary for tessellation. General aim is to calculate discretization points for the given curve or iso curve of surface according to the specified parameters.
BRepMesh_GeomTool::BRepMesh_GeomTool | ( | const BRepAdaptor_Curve & | theCurve, |
const Standard_Real | theFirstParam, | ||
const Standard_Real | theLastParam, | ||
const Standard_Real | theLinDeflection, | ||
const Standard_Real | theAngDeflection, | ||
const Standard_Integer | theMinPointsNb = 2 , |
||
const Standard_Real | theMinSize = Precision::Confusion() |
||
) |
Constructor. Initiates discretization of the given geometric curve.
theCurve | curve to be discretized. |
theFirstParam | first parameter of the curve. |
theLastParam | last parameter of the curve. |
theLinDeflection | linear deflection. |
theAngDeflection | angular deflection. |
theMinPointsNb | minimum nuber of points to be produced. |
BRepMesh_GeomTool::BRepMesh_GeomTool | ( | const Handle< BRepAdaptor_HSurface > & | theSurface, |
const GeomAbs_IsoType | theIsoType, | ||
const Standard_Real | theParamIso, | ||
const Standard_Real | theFirstParam, | ||
const Standard_Real | theLastParam, | ||
const Standard_Real | theLinDeflection, | ||
const Standard_Real | theAngDeflection, | ||
const Standard_Integer | theMinPointsNb = 2 , |
||
const Standard_Real | theMinSize = Precision::Confusion() |
||
) |
Constructor. Initiates discretization of geometric curve corresponding to iso curve of the given surface.
theSurface | surface the iso curve to be taken from. |
theIsoType | type of iso curve to be used, U or V. |
theParamIso | parameter on the surface specifying the iso curve. |
theFirstParam | first parameter of the curve. |
theLastParam | last parameter of the curve. |
theLinDeflection | linear deflection. |
theAngDeflection | angular deflection. |
theMinPointsNb | minimum nuber of points to be produced. |
|
inline |
Adds point to already calculated points (or replaces existing).
thePoint | point to be added. |
theParam | parameter on the curve corresponding to the given point. |
theIsReplace | if TRUE replaces existing point lying within parameteric tolerance of the given point. |
|
static |
Computes normal to the given surface at the specified position in parametric space.
theSurface | surface the normal should be found for. | |
theParamU | U parameter in parametric space of the surface. | |
theParamV | V parameter in parametric space of the surface. | |
[out] | thePoint | 3d point corresponding to the given parameters. |
[out] | theNormal | normal vector at the point specified by the parameters. |
|
static |
Checks intersection between two lines defined by two points.
theStartPnt1 | start point of first line. | |
theEndPnt1 | end point of first line. | |
theStartPnt2 | start point of second line. | |
theEndPnt2 | end point of second line. | |
[out] | theIntPnt | point of intersection. |
[out] | theParamOnSegment | parameters of intersection point corresponding to first and second segment. |
|
static |
Checks intersection between the two segments. Checks that intersection point lies within ranges of both segments.
theStartPnt1 | start point of first segment. | |
theEndPnt1 | end point of first segment. | |
theStartPnt2 | start point of second segment. | |
theEndPnt2 | end point of second segment. | |
isConsiderEndPointTouch | if TRUE EndPointTouch status will be returned in case if segments are touching by end points, if FALSE returns NoIntersection flag. | |
isConsiderPointOnSegment | if TRUE PointOnSegment status will be returned in case if end point of one segment lies onto another one, if FALSE returns NoIntersection flag. | |
[out] | theIntPnt | point of intersection. |
|
inline |
Returns number of discretization points.
|
static |
Computes normal to the given surface at the specified position in parametric space.
theSurface | surface the normal should be found for. | |
theParamU | U parameter in parametric space of the surface. | |
theParamV | V parameter in parametric space of the surface. | |
[out] | thePoint | 3d point corresponding to the given parameters. |
[out] | theNormal | normal vector at the point specified by the parameters. |
|
inlinestatic |
Compute deflection of the given segment.
Standard_Boolean BRepMesh_GeomTool::Value | ( | const Standard_Integer | theIndex, |
const Standard_Real | theIsoParam, | ||
Standard_Real & | theParam, | ||
gp_Pnt & | thePoint, | ||
gp_Pnt2d & | theUV | ||
) | const |
Gets parameters of discretization point with the given index.
theIndex | index of discretization point. |
theIsoParam | parameter on surface to be used as second coordinate of resulting 2d point. |
theParam[out] | parameter of the point on the iso curve. |
thePoint[out] | discretization point. |
theUV[out] | discretization point in parametric space of the surface. |
Standard_Boolean BRepMesh_GeomTool::Value | ( | const Standard_Integer | theIndex, |
const Handle< BRepAdaptor_HSurface > & | theSurface, | ||
Standard_Real & | theParam, | ||
gp_Pnt & | thePoint, | ||
gp_Pnt2d & | theUV | ||
) | const |
Gets parameters of discretization point with the given index.
theIndex | index of discretization point. |
theSurface | surface the curve is lying onto. |
theParam[out] | parameter of the point on the curve. |
thePoint[out] | discretization point. |
theUV[out] | discretization point in parametric space of the surface. |