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

Compare commits

...

3 Commits

Author SHA1 Message Date
gka
b378ae25c2 0029732: Sewing produces result with high tolerance
Added re-construction  2D curve having shift by parameter relative to 3D curve by projection of the 3D curve on the surface.
2018-05-03 12:38:14 +03:00
gka
40e759a3b8 0029732: Sewing produces result with high tolerance
Added rebuilding pcurves for case when tolerance of the result edge more than working precision specified for sewing.
2018-04-28 20:15:41 +03:00
gka
3277ba18fa Additional fix for 29713
0029713: Test Harness command "fixshape" can not fix attached face

Fix to reverse invalid oriented pcurves was made
2018-04-27 15:45:43 +03:00
2 changed files with 1003 additions and 981 deletions

View File

@@ -123,6 +123,9 @@
#include <TopTools_ListOfShape.hxx>
#include <TopTools_MapOfShape.hxx>
#include <TopTools_SequenceOfShape.hxx>
#include <ShapeFix_Edge.hxx>
#include <ShapeBuild_Edge.hxx>
#include <ShapeFix_ShapeTolerance.hxx>
IMPLEMENT_STANDARD_RTTIEXT(BRepBuilderAPI_Sewing, Standard_Transient)
@@ -919,7 +922,7 @@ TopoDS_Edge BRepBuilderAPI_Sewing::SameParameterEdge(const TopoDS_Edge& edgeFirs
{
Standard_Real tolReached_2 = BRep_Tool::Tolerance(s_edge);
second_ok = (BRep_Tool::SameParameter(s_edge) && tolReached_2 < tolReached);
if( second_ok)
if (second_ok && tolReached_2 < myTolerance)
{
edge = s_edge;
whichSec = whichSecn;
@@ -963,6 +966,25 @@ TopoDS_Edge BRepBuilderAPI_Sewing::SameParameterEdge(const TopoDS_Edge& edgeFirs
dist2 = dist;
}
maxTol = Max(sqrt(dist2) * (1. + 1e-7), Precision::Confusion());
if (maxTol > myTolerance)
{
ShapeBuild_Edge aSbe;
TopoDS_Edge edgeNew = aSbe.Copy(edge);
ShapeFix_Edge sfe;
ShapeBuild_Edge().RemovePCurve(edgeNew, surf2, loc2);
ShapeFix_ShapeTolerance aSft;
aSft.SetTolerance(edgeNew, Precision::Confusion());
sfe.FixAddPCurve(edgeNew, surf2, loc2, Standard_False, myTolerance);
aBuilder.SameParameter(edgeNew, Standard_False);
aBuilder.SameRange(edgeNew, Standard_False);
sfe.FixSameParameter(edgeNew, myTolerance);
Standard_Real aTolProj = BRep_Tool::Tolerance(edgeNew);
if (aTolProj < maxTol)
{
edge = edgeNew;
maxTol = aTolProj;
}
}
}
}
if (maxTol >= 0. && maxTol < tolReached)

View File

@@ -438,7 +438,7 @@ Standard_Boolean ShapeAnalysis_Edge::CheckCurve3dWithPCurve (const TopoDS_Edge&
TopoDS_Vertex aFirstVert = FirstVertex (edge);
TopoDS_Vertex aLastVert = LastVertex (edge);
if (aFirstVert.IsNull() || aLastVert.IsNull())
if (aFirstVert.IsNull() || aLastVert.IsNull() || aFirstVert.IsSame(aLastVert))
return Standard_False;
Standard_Real preci1 = BRep_Tool::Tolerance (aFirstVert),
@@ -469,14 +469,14 @@ Standard_Boolean ShapeAnalysis_Edge::CheckPoints (const gp_Pnt& P1A,
const Standard_Real preci2)
{
myStatus = ShapeExtend::EncodeStatus (ShapeExtend_OK);
if (P1A.SquareDistance (P2A) <= preci1 * preci1 &&
P1B.SquareDistance (P2B) <= preci2 * preci2)
return Standard_False;
else if (P1A.Distance (P2B) + (P1B.Distance (P2A)) <
if (P1A.Distance (P2B) + (P1B.Distance (P2A)) <
P1A.Distance (P2A) + (P1B.Distance (P2B)))
{
myStatus |= ShapeExtend::EncodeStatus(ShapeExtend_DONE1);
return Standard_True;
}
return Standard_False;
}
//=======================================================================