#include <TopTools_ListIteratorOfListOfShape.hxx>
#include <TopTools_ListOfShape.hxx>
#include <TColStd_Array1OfReal.hxx>
-
+#include <TopExp.hxx>
IMPLEMENT_STANDARD_RTTIEXT(BRepMesh_EdgeTessellator,BRepMesh_IEdgeTool)
const Standard_Real theMinSize)
: mySurface(theFaceAttribute->Surface())
{
+ TopExp::Vertices (theEdge, myFirstVertex, myLastVertex);
+
Standard_Real aPreciseAngDef = 0.5 * theAngDeflection;
Standard_Real aPreciseLinDef = 0.5 * theLinDeflection;
if (theEdge.Orientation() == TopAbs_INTERNAL)
myFaceRangeV[1] = mySurface->LastVParameter() + aDv;
}
+//=======================================================================
+//function : isInToleranceOfVertex
+//purpose :
+//=======================================================================
+Standard_Boolean BRepMesh_EdgeTessellator::isInToleranceOfVertex (
+ const gp_Pnt& thePoint,
+ const TopoDS_Vertex& theVertex)
+{
+ const gp_Pnt aPoint = BRep_Tool::Pnt (theVertex);
+ const Standard_Real aTolerance = BRep_Tool::Tolerance (theVertex);
+
+ return (thePoint.SquareDistance (aPoint) < aTolerance * aTolerance);
+}
+
//=======================================================================
//function : Value
//purpose :
{
myTool->Value(theIndex, mySurface, theParameter, thePoint, theUV);
+ if (isInToleranceOfVertex (thePoint, myFirstVertex) ||
+ isInToleranceOfVertex (thePoint, myLastVertex))
+ {
+ return Standard_False;
+ }
+
// If point coordinates are out of surface range,
// it is necessary to re-project point.
if (mySurface->GetType() != GeomAbs_BSplineSurface &&
#include <BRepMesh_FaceAttribute.hxx>
#include <BRepAdaptor_Curve.hxx>
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
+#include <TopoDS_Vertex.hxx>
class Geom_Surface;
class Geom2d_Curve;
const Standard_Real theLast,
const Standard_Integer theNbIter);
+ //! Checks whether the given point lies within tolerance of the vertex.
+ Standard_Boolean isInToleranceOfVertex (
+ const gp_Pnt& thePoint,
+ const TopoDS_Vertex& theVertex);
+
private:
NCollection_Handle<BRepMesh_GeomTool> myTool;
Handle(BRepAdaptor_HSurface) mySurface;
Standard_Real myEdgeSqTol;
Standard_Real myFaceRangeU[2];
Standard_Real myFaceRangeV[2];
+ TopoDS_Vertex myFirstVertex;
+ TopoDS_Vertex myLastVertex;
};
DEFINE_STANDARD_HANDLE(BRepMesh_EdgeTessellator, BRepMesh_IEdgeTool)