mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-08-09 13:22:24 +03:00
0028599: Replacement of old Boolean operations with new ones in BRepProj_Projection algorithm
The usage of *BRepAlgo_Section* has been replaced with the usage of *BRepAlgoAPI_Section* in *BRepProj_Projection* algorithm. The TODO statements have been removed from the failing test case in the "prj" grid as they are working correctly now. The following changes have been made to improve the performance *BRepAlgoAPI_Section*: 1. Revision of the *IntPolyh_Intersection* class to avoid repeated calculation of the deflection of the same triangulation. 2. Small revision of the Edge/Face intersection algorithm to perform Extrema computation on the whole intersection range of the edge instead of discrete ranges. 3. Implementation of the extrema computation for the Circle and Sphere. 4. Correct computation of the parameter of the point on the Circle.
This commit is contained in:
@@ -1308,14 +1308,24 @@ Standard_Real ElCLib::LineParameter (const gp_Ax1& L, const gp_Pnt& P)
|
||||
//function : CircleParameter
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
Standard_Real ElCLib::CircleParameter (const gp_Ax2& Pos,
|
||||
const gp_Pnt& P)
|
||||
Standard_Real ElCLib::CircleParameter(const gp_Ax2& Pos,
|
||||
const gp_Pnt& P)
|
||||
{
|
||||
gp_Vec aVec(Pos.Location(), P);
|
||||
Standard_Real Teta = 0.0;
|
||||
if (aVec.SquareMagnitude() > gp::Resolution())
|
||||
Teta = (Pos.XDirection()).AngleWithRef(aVec, Pos.Direction());
|
||||
if (aVec.SquareMagnitude() < gp::Resolution())
|
||||
// coinciding points -> infinite number of parameters
|
||||
return 0.0;
|
||||
|
||||
const gp_Dir& dir = Pos.Direction();
|
||||
// Project vector on circle's plane
|
||||
gp_XYZ aVProj = dir.XYZ().CrossCrossed(aVec.XYZ(), dir.XYZ());
|
||||
|
||||
if (aVProj.SquareModulus() < gp::Resolution())
|
||||
return 0.0;
|
||||
|
||||
// Angle between X direction and projected vector
|
||||
Standard_Real Teta = (Pos.XDirection()).AngleWithRef(aVProj, dir);
|
||||
|
||||
if (Teta < -1.e-16) Teta += PIPI;
|
||||
else if (Teta < 0) Teta = 0;
|
||||
return Teta;
|
||||
|
Reference in New Issue
Block a user