static const Standard_Real THE_EMPTY_LABEL_WIDTH = 0.0;
static const Standard_ExtCharacter THE_DEGREE_SYMBOL (0x00B0);
static const Standard_Real THE_3D_TEXT_MARGIN = 0.1;
+
+ //! Returns true if the given points lie on a same line.
+ static Standard_Boolean isSameLine (const gp_Pnt& theFirstPoint,
+ const gp_Pnt& theCenterPoint,
+ const gp_Pnt& theSecondPoint)
+ {
+ gp_Vec aVec1 (theFirstPoint, theCenterPoint);
+ gp_Vec aVec2 (theCenterPoint, theSecondPoint);
+
+ return aVec1.IsParallel (aVec2, Precision::Angular());
+ }
}
//=======================================================================
myGeometryType = GeometryType_Points;
myIsGeometryValid = IsValidPoints (myFirstPoint, myCenterPoint, mySecondPoint);
- if (myIsGeometryValid && !myIsPlaneCustom)
+ Standard_Boolean anIsSameLine = isSameLine (myFirstPoint, myCenterPoint, mySecondPoint);
+ if (myIsGeometryValid && !myIsPlaneCustom && !anIsSameLine)
{
ComputePlane();
}
myGeometryType = GeometryType_Points;
myIsGeometryValid = IsValidPoints (myFirstPoint, myCenterPoint, mySecondPoint);
- if (myIsGeometryValid && !myIsPlaneCustom)
+ Standard_Boolean anIsSameLine = isSameLine (myFirstPoint, myCenterPoint, mySecondPoint);
+ if (myIsGeometryValid && !myIsPlaneCustom && !anIsSameLine)
{
ComputePlane();
}
--- /dev/null
+#puts "============================================================================"
+#puts "OCC28244: Visualization - AIS_AngleDimension throws exception for 180 degree"
+#puts "============================================================================"
+
+vclear
+vclose all
+
+vinit
+
+vpoint p0 -100 0 0
+vpoint p1 0 0 0
+vpoint p2 100 0 0
+vdimension angle -angle -shapes p0 p1 p2
+vfit
+
+vdump $imagedir/${casename}.png