BW1.MakeWire(newW1);
BW2.MakeWire(newW2);
+ GeomAdaptor_Curve aC1Adaptor(C1);
+ GeomAdaptor_Curve aC2Adaptor(C2);
// calculate the surface
Handle(Geom_Surface) surface;
Standard_Real V, Rad;
if (IType==1) {
// cylindrical surface
- gp_Circ c1 = (Handle(Geom_Circle)::DownCast(C1))->Circ();
- gp_Circ c2 = (Handle(Geom_Circle)::DownCast(C2))->Circ();
+ gp_Circ c1 = aC1Adaptor.Circle();
+ gp_Circ c2 = aC2Adaptor.Circle();
gp_Ax3 Ac1 = c1.Position();
V = gp_Vec( c1.Location(),c2.Location()).Dot(gp_Vec(Ac1.Direction()));
if ( V < 0.) {
}
else if (IType==2) {
// conical surface
- gp_Circ k1 = (Handle(Geom_Circle)::DownCast(C1))->Circ();
+ gp_Circ k1 = aC1Adaptor.Circle();
gp_Ax3 Ak1 = k1.Position();
if (degen2) {
V = gp_Vec( k1.Location(),BRep_Tool::Pnt(v2f))
Rad = - k1.Radius();
}
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()));
Rad = k2.Radius() - k1.Radius();
}
}
else if (IType==-2) {
// 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();
Ak2.SetLocation(BRep_Tool::Pnt(v1f));
V = gp_Vec(BRep_Tool::Pnt(v1f),k2.Location())
// surface plane
gp_Lin L1, L2, aLine;
if (!degen1)
- {
- L1 = (Handle(Geom_Line)::DownCast(C1))->Lin();
- aLine = L1;
- }
+ {
+ L1 = aC1Adaptor.Line();
+ aLine = L1;
+ }
if (!degen2)
- {
- L2 = (Handle(Geom_Line)::DownCast(C2))->Lin();
- aLine = L2;
- }
+ {
+ L2 = aC2Adaptor.Line();
+ aLine = L2;
+ }
gp_Pnt P1 = (degen1)? BRep_Tool::Pnt(v1f) : L1.Location();
gp_Pnt P2 = (degen2)? BRep_Tool::Pnt(v2f) : L2.Location();
--- /dev/null
+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