mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-04-07 18:30:55 +03:00
0025582: SIGSEGV in thrusections of circle segments
1. Implemented using of trimmed circular curve 2. Added test case
This commit is contained in:
parent
79186c39b3
commit
0fe1715f01
@ -398,14 +398,16 @@ void CreateKPart(const TopoDS_Edge& Edge1,const TopoDS_Edge& Edge2,
|
|||||||
BW1.MakeWire(newW1);
|
BW1.MakeWire(newW1);
|
||||||
BW2.MakeWire(newW2);
|
BW2.MakeWire(newW2);
|
||||||
|
|
||||||
|
GeomAdaptor_Curve aC1Adaptor(C1);
|
||||||
|
GeomAdaptor_Curve aC2Adaptor(C2);
|
||||||
|
|
||||||
// calculate the surface
|
// calculate the surface
|
||||||
Handle(Geom_Surface) surface;
|
Handle(Geom_Surface) surface;
|
||||||
Standard_Real V, Rad;
|
Standard_Real V, Rad;
|
||||||
if (IType==1) {
|
if (IType==1) {
|
||||||
// cylindrical surface
|
// cylindrical surface
|
||||||
gp_Circ c1 = (Handle(Geom_Circle)::DownCast(C1))->Circ();
|
gp_Circ c1 = aC1Adaptor.Circle();
|
||||||
gp_Circ c2 = (Handle(Geom_Circle)::DownCast(C2))->Circ();
|
gp_Circ c2 = aC2Adaptor.Circle();
|
||||||
gp_Ax3 Ac1 = c1.Position();
|
gp_Ax3 Ac1 = c1.Position();
|
||||||
V = gp_Vec( c1.Location(),c2.Location()).Dot(gp_Vec(Ac1.Direction()));
|
V = gp_Vec( c1.Location(),c2.Location()).Dot(gp_Vec(Ac1.Direction()));
|
||||||
if ( V < 0.) {
|
if ( V < 0.) {
|
||||||
@ -419,7 +421,7 @@ void CreateKPart(const TopoDS_Edge& Edge1,const TopoDS_Edge& Edge2,
|
|||||||
}
|
}
|
||||||
else if (IType==2) {
|
else if (IType==2) {
|
||||||
// conical surface
|
// conical surface
|
||||||
gp_Circ k1 = (Handle(Geom_Circle)::DownCast(C1))->Circ();
|
gp_Circ k1 = aC1Adaptor.Circle();
|
||||||
gp_Ax3 Ak1 = k1.Position();
|
gp_Ax3 Ak1 = k1.Position();
|
||||||
if (degen2) {
|
if (degen2) {
|
||||||
V = gp_Vec( k1.Location(),BRep_Tool::Pnt(v2f))
|
V = gp_Vec( k1.Location(),BRep_Tool::Pnt(v2f))
|
||||||
@ -427,7 +429,7 @@ void CreateKPart(const TopoDS_Edge& Edge1,const TopoDS_Edge& Edge2,
|
|||||||
Rad = - k1.Radius();
|
Rad = - k1.Radius();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
gp_Circ k2 = (Handle(Geom_Circle)::DownCast(C2))->Circ();
|
gp_Circ k2 = aC2Adaptor.Circle();
|
||||||
V = gp_Vec( k1.Location(),k2.Location()).Dot(gp_Vec(Ak1.Direction()));
|
V = gp_Vec( k1.Location(),k2.Location()).Dot(gp_Vec(Ak1.Direction()));
|
||||||
Rad = k2.Radius() - k1.Radius();
|
Rad = k2.Radius() - k1.Radius();
|
||||||
}
|
}
|
||||||
@ -445,7 +447,7 @@ void CreateKPart(const TopoDS_Edge& Edge1,const TopoDS_Edge& Edge2,
|
|||||||
}
|
}
|
||||||
else if (IType==-2) {
|
else if (IType==-2) {
|
||||||
// conical surface with the top at the beginning (degen1 is true)
|
// conical surface with the top at the beginning (degen1 is true)
|
||||||
gp_Circ k2 = (Handle(Geom_Circle)::DownCast(C2))->Circ();
|
gp_Circ k2 = aC2Adaptor.Circle();
|
||||||
gp_Ax3 Ak2 = k2.Position();
|
gp_Ax3 Ak2 = k2.Position();
|
||||||
Ak2.SetLocation(BRep_Tool::Pnt(v1f));
|
Ak2.SetLocation(BRep_Tool::Pnt(v1f));
|
||||||
V = gp_Vec(BRep_Tool::Pnt(v1f),k2.Location())
|
V = gp_Vec(BRep_Tool::Pnt(v1f),k2.Location())
|
||||||
@ -470,12 +472,12 @@ void CreateKPart(const TopoDS_Edge& Edge1,const TopoDS_Edge& Edge2,
|
|||||||
gp_Lin L1, L2, aLine;
|
gp_Lin L1, L2, aLine;
|
||||||
if (!degen1)
|
if (!degen1)
|
||||||
{
|
{
|
||||||
L1 = (Handle(Geom_Line)::DownCast(C1))->Lin();
|
L1 = aC1Adaptor.Line();
|
||||||
aLine = L1;
|
aLine = L1;
|
||||||
}
|
}
|
||||||
if (!degen2)
|
if (!degen2)
|
||||||
{
|
{
|
||||||
L2 = (Handle(Geom_Line)::DownCast(C2))->Lin();
|
L2 = aC2Adaptor.Line();
|
||||||
aLine = L2;
|
aLine = L2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
19
tests/bugs/modalg_5/bug25582
Normal file
19
tests/bugs/modalg_5/bug25582
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
puts "============"
|
||||||
|
puts "OCC25582"
|
||||||
|
puts "============"
|
||||||
|
puts ""
|
||||||
|
#########################################################################
|
||||||
|
# SIGSEGV in thrusections on coaxial circlular segments
|
||||||
|
#########################################################################
|
||||||
|
|
||||||
|
restore [locate_data_file bug25582_filletloft-draw-Loft-00-section.brep] Loft-00-section
|
||||||
|
restore [locate_data_file bug25582_filletloft-draw-Loft-01-section.brep] Loft-01-section
|
||||||
|
|
||||||
|
thrusections result 0 0 Loft-00-section Loft-01-section
|
||||||
|
|
||||||
|
if ![isdraw result] {
|
||||||
|
puts "Error : thrusections failed"
|
||||||
|
}
|
||||||
|
|
||||||
|
set square 1.5708
|
||||||
|
set 2dviewer 0
|
Loading…
x
Reference in New Issue
Block a user