1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-04 13:13:25 +03:00

0026656: ShapeFix_Face introduces extremely high vertex tolerance in the input shape

Added set of methods CopyVertex in BRepTools_ReShape. Usage of this non-modifying methods added in ShapeFix_Wire, ShapeFix_Edge.
Test case for issue 26656.
Test cases updated to the new behavior.

Correction of test cases for issue CR26656

Changed access by value to access by reference in method CopyVertex.
This commit is contained in:
aml
2015-09-24 15:01:44 +03:00
committed by bugmaster
parent 10a4116e31
commit ed5ca017c7
64 changed files with 308 additions and 121 deletions

View File

@@ -573,3 +573,37 @@ Standard_Boolean& BRepTools_ReShape::ModeConsiderOrientation()
{
return myConsiderOrientation;
}
//=======================================================================
//function : CopyVertex
//purpose :
//=======================================================================
TopoDS_Vertex BRepTools_ReShape::CopyVertex(const TopoDS_Vertex& theV,
const Standard_Real theTol)
{
return CopyVertex(theV, BRep_Tool::Pnt(theV), theTol);
}
//=======================================================================
//function : CopyVertex
//purpose :
//=======================================================================
TopoDS_Vertex BRepTools_ReShape::CopyVertex(const TopoDS_Vertex& theV,
const gp_Pnt& theNewPos,
const Standard_Real theTol)
{
TopoDS_Vertex aVertexCopy;
Standard_Boolean isRecorded = IsRecorded(theV);
aVertexCopy = isRecorded ? TopoDS::Vertex(Apply(theV)) : TopoDS::Vertex(theV.EmptyCopied());
BRep_Builder B;
Standard_Real aNewTol = theTol > 0.0 ? theTol : BRep_Tool::Tolerance(theV);
B.UpdateVertex(aVertexCopy, theNewPos, aNewTol);
if (!isRecorded)
Replace(theV, aVertexCopy);
return aVertexCopy;
}

View File

@@ -26,6 +26,7 @@
#include <MMgt_TShared.hxx>
#include <TopAbs_ShapeEnum.hxx>
class TopoDS_Shape;
class TopoDS_Vertex;
class BRepTools_ReShape;
@@ -123,7 +124,19 @@ public:
//! during replacing shapes.
Standard_EXPORT virtual Standard_Boolean& ModeConsiderOrientation();
//! Returns modified copy of vertex if original one is not recorded or returns modified original vertex otherwise.
//@param theV - original vertex.
//@param theTol - new tolerance of vertex, optional.
Standard_EXPORT TopoDS_Vertex CopyVertex(const TopoDS_Vertex& theV,
const Standard_Real theTol = -1.0);
//! Returns modified copy of vertex if original one is not recorded or returns modified original vertex otherwise.
//@param theV - original vertex.
//@param theNewPos - new position for vertex copy.
//@param theTol - new tolerance of vertex.
Standard_EXPORT TopoDS_Vertex CopyVertex(const TopoDS_Vertex& theV,
const gp_Pnt& theNewPos,
const Standard_Real aTol);
DEFINE_STANDARD_RTTI(BRepTools_ReShape,MMgt_TShared)