mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-04-11 13:47:28 +05:00
Bug 0020228: [CEA 331] the geompy.RemoveExtraEdges crash with the attached brep shape file.
This commit is contained in:
parent
040e6077ee
commit
9d1cc3492c
@ -22,7 +22,7 @@
|
|||||||
// File: BlockFix_UnionEdges.cxx
|
// File: BlockFix_UnionEdges.cxx
|
||||||
// Created: 07.12.04 15:27:30
|
// Created: 07.12.04 15:27:30
|
||||||
// Author: Sergey KUUL
|
// Author: Sergey KUUL
|
||||||
//
|
|
||||||
#include <BlockFix_UnionEdges.ixx>
|
#include <BlockFix_UnionEdges.ixx>
|
||||||
|
|
||||||
#include <Approx_Curve3d.hxx>
|
#include <Approx_Curve3d.hxx>
|
||||||
@ -179,17 +179,29 @@ static Standard_Boolean MergeEdges(const TopTools_SequenceOfShape& SeqEdges,
|
|||||||
gp_Pnt PVM = BRep_Tool::Pnt(VM);
|
gp_Pnt PVM = BRep_Tool::Pnt(VM);
|
||||||
GC_MakeCircle MC (PV1,PVM,PV2);
|
GC_MakeCircle MC (PV1,PVM,PV2);
|
||||||
Handle(Geom_Circle) C = MC.Value();
|
Handle(Geom_Circle) C = MC.Value();
|
||||||
|
TopoDS_Edge E;
|
||||||
|
if (!MC.IsDone() || C.IsNull()) {
|
||||||
|
// jfa for Mantis issue 0020228
|
||||||
|
if (PV1.Distance(PV2) > Precision::Confusion()) continue;
|
||||||
|
// closed chain
|
||||||
|
C = C1;
|
||||||
|
B.MakeEdge (E,C,Precision::Confusion());
|
||||||
|
B.Add(E,V1);
|
||||||
|
B.Add(E,V2);
|
||||||
|
}
|
||||||
|
else {
|
||||||
gp_Pnt P0 = C->Location();
|
gp_Pnt P0 = C->Location();
|
||||||
gp_Dir D1(gp_Vec(P0,PV1));
|
gp_Dir D1(gp_Vec(P0,PV1));
|
||||||
gp_Dir D2(gp_Vec(P0,PV2));
|
gp_Dir D2(gp_Vec(P0,PV2));
|
||||||
Standard_Real fpar = C->XAxis().Direction().Angle(D1);
|
Standard_Real fpar = C->XAxis().Direction().Angle(D1);
|
||||||
Standard_Real lpar = C->XAxis().Direction().Angle(D2);
|
Standard_Real lpar = C->XAxis().Direction().Angle(D2);
|
||||||
Handle(Geom_TrimmedCurve) tc = new Geom_TrimmedCurve(C,fpar,lpar);
|
Handle(Geom_TrimmedCurve) tc = new Geom_TrimmedCurve(C,fpar,lpar);
|
||||||
TopoDS_Edge E;
|
|
||||||
B.MakeEdge (E,tc,Precision::Confusion());
|
B.MakeEdge (E,tc,Precision::Confusion());
|
||||||
B.Add (E,V1); B.Add (E,V2);
|
B.Add(E,V1);
|
||||||
|
B.Add(E,V2);
|
||||||
B.UpdateVertex(V1, fpar, E, 0.);
|
B.UpdateVertex(V1, fpar, E, 0.);
|
||||||
B.UpdateVertex(V2, lpar, E, 0.);
|
B.UpdateVertex(V2, lpar, E, 0.);
|
||||||
|
}
|
||||||
ShapeFix_Edge sfe;
|
ShapeFix_Edge sfe;
|
||||||
sfe.FixAddPCurve(E,aFace,Standard_False);
|
sfe.FixAddPCurve(E,aFace,Standard_False);
|
||||||
sfe.FixSameParameter(E);
|
sfe.FixSameParameter(E);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user