mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0025175: avoid unsafe 3D curve usages
Test case for issue CR25175
This commit is contained in:
@@ -1057,6 +1057,7 @@ void BRepBuilderAPI_Sewing::EvaluateDistances(TopTools_SequenceOfShape& sequence
|
||||
TopLoc_Location loc;
|
||||
Standard_Real first, last;
|
||||
Handle(Geom_Curve) c3d = BRep_Tool::Curve(sec, loc, first, last);
|
||||
if (c3d.IsNull()) continue;
|
||||
if (!loc.IsIdentity()) {
|
||||
c3d = Handle(Geom_Curve)::DownCast(c3d->Copy());
|
||||
c3d->Transform(loc.Transformation());
|
||||
@@ -3604,15 +3605,16 @@ void BRepBuilderAPI_Sewing::Cutting(const Handle(Message_ProgressIndicator)& the
|
||||
const TopoDS_Edge& bound = TopoDS::Edge(myBoundFaces.FindKey(i));
|
||||
// Do not cut floating edges
|
||||
if (!myBoundFaces(i).Extent()) continue;
|
||||
// Obtain bound curve
|
||||
c3d = BRep_Tool::Curve(bound, loc, first, last);
|
||||
if (c3d.IsNull()) continue;
|
||||
if (!loc.IsIdentity()) {
|
||||
c3d = Handle(Geom_Curve)::DownCast(c3d->Copy());
|
||||
c3d->Transform(loc.Transformation());
|
||||
}
|
||||
// Create cutting sections
|
||||
TopTools_ListOfShape listSections;
|
||||
{ //szv: Use brackets to destroy local variables
|
||||
// Obtain bound curve
|
||||
c3d = BRep_Tool::Curve(bound, loc, first, last);
|
||||
if (!loc.IsIdentity()) {
|
||||
c3d = Handle(Geom_Curve)::DownCast(c3d->Copy());
|
||||
c3d->Transform(loc.Transformation());
|
||||
}
|
||||
// Obtain candidate vertices
|
||||
TopoDS_Vertex V1, V2;
|
||||
TopTools_IndexedMapOfShape CandidateVertices;
|
||||
|
Reference in New Issue
Block a user