mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-06 18:26:22 +03:00
0025175: avoid unsafe 3D curve usages
Test case for issue CR25175
This commit is contained in:
parent
9bf6baed3c
commit
de10d8b144
@ -1057,6 +1057,7 @@ void BRepBuilderAPI_Sewing::EvaluateDistances(TopTools_SequenceOfShape& sequence
|
|||||||
TopLoc_Location loc;
|
TopLoc_Location loc;
|
||||||
Standard_Real first, last;
|
Standard_Real first, last;
|
||||||
Handle(Geom_Curve) c3d = BRep_Tool::Curve(sec, loc, first, last);
|
Handle(Geom_Curve) c3d = BRep_Tool::Curve(sec, loc, first, last);
|
||||||
|
if (c3d.IsNull()) continue;
|
||||||
if (!loc.IsIdentity()) {
|
if (!loc.IsIdentity()) {
|
||||||
c3d = Handle(Geom_Curve)::DownCast(c3d->Copy());
|
c3d = Handle(Geom_Curve)::DownCast(c3d->Copy());
|
||||||
c3d->Transform(loc.Transformation());
|
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));
|
const TopoDS_Edge& bound = TopoDS::Edge(myBoundFaces.FindKey(i));
|
||||||
// Do not cut floating edges
|
// Do not cut floating edges
|
||||||
if (!myBoundFaces(i).Extent()) continue;
|
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
|
// Create cutting sections
|
||||||
TopTools_ListOfShape listSections;
|
TopTools_ListOfShape listSections;
|
||||||
{ //szv: Use brackets to destroy local variables
|
{ //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
|
// Obtain candidate vertices
|
||||||
TopoDS_Vertex V1, V2;
|
TopoDS_Vertex V1, V2;
|
||||||
TopTools_IndexedMapOfShape CandidateVertices;
|
TopTools_IndexedMapOfShape CandidateVertices;
|
||||||
|
16
tests/bugs/modalg_5/bug25175
Normal file
16
tests/bugs/modalg_5/bug25175
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
puts "============"
|
||||||
|
puts "OCC25175"
|
||||||
|
puts "============"
|
||||||
|
puts ""
|
||||||
|
###########################################################################
|
||||||
|
# BRepBuilderAPI_Sewing can crash if an edge without 3D curve is presented
|
||||||
|
###########################################################################
|
||||||
|
|
||||||
|
pload XSDRAW
|
||||||
|
|
||||||
|
igesread [locate_data_file bug25175_3.igs] a *
|
||||||
|
|
||||||
|
sewing result 0.1 a
|
||||||
|
|
||||||
|
set 2dviewer 1
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user