mirror of
https://git.salome-platform.org/gitpub/modules/geom.git
synced 2025-01-01 04:10:34 +05:00
Updated for bug 0020052 from Mantis.
This commit is contained in:
parent
014f092f46
commit
951bb21f99
@ -203,21 +203,44 @@ static Standard_Boolean MergeEdges(const TopTools_SequenceOfShape& SeqEdges,
|
|||||||
}
|
}
|
||||||
if(aChain.Length()>1) {
|
if(aChain.Length()>1) {
|
||||||
// second step: union edges with various curves
|
// second step: union edges with various curves
|
||||||
MESSAGE ("can not make analitical union => make approximation");
|
// skl for bug 0020052 from Mantis: perform such unions
|
||||||
TopoDS_Wire W;
|
// only if curves are bspline or bezier
|
||||||
B.MakeWire(W);
|
bool NeedUnion = true;
|
||||||
for(j=1; j<=aChain.Length(); j++) {
|
for(j=1; j<=aChain.Length(); j++) {
|
||||||
TopoDS_Edge edge = TopoDS::Edge(aChain.Value(j));
|
TopoDS_Edge edge = TopoDS::Edge(aChain.Value(j));
|
||||||
B.Add(W,edge);
|
Handle(Geom_Curve) c3d = BRep_Tool::Curve(edge,Loc,fp1,lp1);
|
||||||
|
if(c3d.IsNull()) continue;
|
||||||
|
while(c3d->IsKind(STANDARD_TYPE(Geom_TrimmedCurve))) {
|
||||||
|
Handle(Geom_TrimmedCurve) tc =
|
||||||
|
Handle(Geom_TrimmedCurve)::DownCast(c3d);
|
||||||
|
c3d = tc->BasisCurve();
|
||||||
|
}
|
||||||
|
if( ( c3d->IsKind(STANDARD_TYPE(Geom_BSplineCurve)) ||
|
||||||
|
c3d->IsKind(STANDARD_TYPE(Geom_BezierCurve)) ) ) continue;
|
||||||
|
NeedUnion = false;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if(NeedUnion) {
|
||||||
|
MESSAGE ("can not make analitical union => make approximation");
|
||||||
|
TopoDS_Wire W;
|
||||||
|
B.MakeWire(W);
|
||||||
|
for(j=1; j<=aChain.Length(); j++) {
|
||||||
|
TopoDS_Edge edge = TopoDS::Edge(aChain.Value(j));
|
||||||
|
B.Add(W,edge);
|
||||||
|
}
|
||||||
|
Handle(BRepAdaptor_HCompCurve) Adapt = new BRepAdaptor_HCompCurve(W);
|
||||||
|
Approx_Curve3d Conv(Adapt,Tol,GeomAbs_C1,9,1000);
|
||||||
|
Handle(Geom_BSplineCurve) bc = Conv.Curve();
|
||||||
|
TopoDS_Edge E;
|
||||||
|
B.MakeEdge (E,bc,Precision::Confusion());
|
||||||
|
B.Add (E,VF);
|
||||||
|
B.Add (E,VL);
|
||||||
|
aChain.SetValue(1,E);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
MESSAGE ("can not make approximation for such types of curves");
|
||||||
|
return Standard_False;
|
||||||
}
|
}
|
||||||
Handle(BRepAdaptor_HCompCurve) Adapt = new BRepAdaptor_HCompCurve(W);
|
|
||||||
Approx_Curve3d Conv(Adapt,Tol,GeomAbs_C1,9,1000);
|
|
||||||
Handle(Geom_BSplineCurve) bc = Conv.Curve();
|
|
||||||
TopoDS_Edge E;
|
|
||||||
B.MakeEdge (E,bc,Precision::Confusion());
|
|
||||||
B.Add (E,VF);
|
|
||||||
B.Add (E,VL);
|
|
||||||
aChain.SetValue(1,E);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
anEdge = TopoDS::Edge(aChain.Value(1));
|
anEdge = TopoDS::Edge(aChain.Value(1));
|
||||||
|
Loading…
Reference in New Issue
Block a user