{
Standard_Real TolConf = Precision::Confusion();
Standard_Real TolAng = Precision::Angular();
+ Standard_Real TolConeSemiAng = Precision::Confusion();
switch (myBasisCurve->GetType()) {
case GeomAbs_Line: {
gp_Ax1 Axe = myBasisCurve->Line().Position();
if (myAxis.IsParallel(Axe, TolAng))
- return GeomAbs_Cylinder;
+ {
+ gp_Pnt P = Value(0., 0.);
+ Standard_Real R = gp_Vec(myAxeRev.Location(), P) * myAxeRev.XDirection();
+ if (R > TolConf)
+ {
+ return GeomAbs_Cylinder;
+ }
+ }
else if (myAxis.IsNormal(Axe, TolAng))
return GeomAbs_Plane;
else
gp_Vec vlin(pf,pl);
gp_Vec vaxe(myAxis.Direction());
Standard_Real projlen = Abs(vaxe.Dot(vlin));
- Standard_Real aTolConf = len*TolAng;
- if ((len - projlen) <= aTolConf)
- return GeomAbs_Cylinder;
- else if (projlen <= aTolConf)
+ if ((len - projlen) <= TolConf)
+ {
+ gp_Pnt P = Value(0., 0.);
+ Standard_Real R = gp_Vec(myAxeRev.Location(), P) * myAxeRev.XDirection();
+ if (R > TolConf)
+ {
+ return GeomAbs_Cylinder;
+ }
+ }
+ else if (projlen <= TolConf)
return GeomAbs_Plane;
}
gp_Vec V(myAxis.Location(), myBasisCurve->Line().Location());
gp_Vec W(Axe.Direction());
- if (Abs(V.DotCross(myAxis.Direction(), W)) <= TolConf)
+ gp_Vec AxisDir(myAxis.Direction());
+ Standard_Real proj = Abs(W.Dot(AxisDir));
+ if (Abs(V.DotCross(AxisDir, W)) <= TolConf &&
+ (proj >= TolConeSemiAng && proj <= 1. - TolConeSemiAng))
+ {
return GeomAbs_Cone;
+ }
}
break;
}//case GeomAbs_Line:
--- /dev/null
+puts "========"
+puts "OCC28261"
+puts "========"
+puts ""
+#################################################
+# Chamfer fails on edges placed on quasi-planar cone
+#################################################
+
+brestore [locate_data_file bug28261_face.brep] f
+brestore [locate_data_file bug28261_hexaprism.brep] h
+
+explode f E
+mkcurve c f_1
+cvalue c 0 x y z dx dy dz
+revol rev f $x $y $z $dx $dy $dz 360
+
+bcut r rev h
+
+explode r F
+explode r_9 E
+chamf r r r_9_1 r_9 0.1 0.1 r_9_2 r_9 0.1 0.1 r_9_3 r_9 0.1 0.1 r_9_4 r_9 0.1 0.1 r_9_5 r_9 0.1 0.1 r_9_6 r_9 0.1 0.1
+
+explode r F
+explode r_4 E
+chamf result r r_4_1 r_4 0.1 0.1 r_4_2 r_4 0.1 0.1 r_4_3 r_4 0.1 0.1 r_4_4 r_4 0.1 0.1 r_4_5 r_4 0.1 0.1 r_4_6 r_4 0.1 0.1 r_4_8 r_4 0.1 0.1
+
+checkshape result
+checknbshapes result -solid 1 -face 18 -edge 36 -vertex 22
+checkprops result -v 17158.1 -s 4073.25
\ No newline at end of file
--- /dev/null
+puts "========"
+puts "OCC28266"
+puts "========"
+puts ""
+#################################################
+# Boolean CUT produces incorrect result with quasi-planar cone
+#################################################
+
+brestore [locate_data_file bug28261_face.brep] f
+brestore [locate_data_file bug28266_tool1.brep] t1
+brestore [locate_data_file bug28266_tool2.brep] t2
+
+explode f E
+mkcurve c f_1
+cvalue c 0 x y z dx dy dz
+revol rev f $x $y $z $dx $dy $dz 360
+
+bcut r rev t1
+
+checkshape r
+checknbshapes r -solid 1 -face 86 -edge 267 -vertex 184
+checkprops r -v 17215.5 -s 4033.34
+
+bcut result r t2
+
+checkshape result
+checknbshapes result -solid 1 -face 90 -edge 278 -vertex 190
+checkprops result -v 17215.5 -s 4033.52
\ No newline at end of file