const gp_Cone aCone = BRepAdaptor_Surface (theFace).Cone();
gp_Trsf aTrsf;
- aTrsf.SetTransformation (aCone.Position(), gp::XOY());
-
Standard_Real aRad1;
Standard_Real aRad2;
Standard_Real aHeight;
aRad1 = 0.0;
aRad2 = aCircles.First().Radius();
aHeight = aRad2 * Tan (aCone.SemiAngle());
+ aTrsf.SetTransformation (aCone.Position(), gp::XOY());
}
else
{
- aRad1 = aCone.RefRadius();
- aRad2 = IsEqual (aRad1, aCircles.First().Radius())
- ? aCircles.Last().Radius()
- : aCircles.First().Radius();
+ aRad1 = aCircles.First().Radius();
+ aRad2 = aCircles.Last().Radius();
aHeight = aCircles.First().Location().Distance (aCircles.Last().Location());
+
+ const gp_Pnt aPos = aCircles.First().Location();
+ const gp_Dir aDirection (aCircles.Last().Location().XYZ() - aPos.XYZ());
+
+ aTrsf.SetTransformation (gp_Ax3(aPos, aDirection), gp::XOY());
}
Handle(Select3D_SensitiveCylinder) aSensSCyl = new Select3D_SensitiveCylinder (theOwner, aRad1, aRad2, aHeight, aTrsf, true);
+++ /dev/null
-puts "============"
-puts "0033664: Visualization - Selection does not work for simple shape"
-puts "============"
-puts ""
-
-pload MODELING VISUALIZATION
-vclear
-vinit View1
-
-restore [locate_data_file cylinder_surface.brep] b
-vdisplay -dispMode 1 b
-vfit
-vsensdis
-
-vselect 200 200
-if {[vnbselected] != "1"} {
- puts "ERROR: wrong sensitive area"
-}
-
-vselect 0 0
-vdump $::imagedir/${::casename}.png
--- /dev/null
+puts "============"
+puts "0033664: Visualization - Selection does not work for simple shape"
+puts "============"
+puts ""
+
+pload MODELING VISUALIZATION
+vclear
+vinit View1
+
+restore [locate_data_file cylinder_surface.brep] b
+vdisplay -dispMode 1 b
+vfit
+vsensdis
+
+vselect 200 200
+if {[vnbselected] != "1"} {
+ puts "ERROR: wrong sensitive area"
+}
+
+vselect 0 0
+vdump $::imagedir/${::casename}_cylinder.png
--- /dev/null
+puts "============"
+puts "0033664: Visualization - Selection does not work for simple shape"
+puts "============"
+puts ""
+
+pload MODELING VISUALIZATION
+vclear
+vinit View1
+
+pcone c1 50 100 100
+ttranslate c1 100 0 100
+explode c1
+explode c1_1
+
+pcone c2 100 50 100
+ttranslate c2 -100 0 100
+explode c2
+explode c2_1
+
+pcone c3 0 100 100
+ttranslate c3 100 0 -100
+explode c3
+explode c3_1
+
+pcone c4 100 0 100
+ttranslate c4 -100 0 -100
+explode c4
+explode c4_1
+
+vdisplay c1_1_1 c2_1_1 c3_1_1 c4_1_1 -dispmode 1
+vsensdis
+
+vfront
+vfit
+
+vdump $::imagedir/${::casename}_cone.png