1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0025187: Document the algorithm used in the fixes for issues ## 0024915 and 25194

1. Algorithm of orthogonalize of the transformation matrix (in gp_Trsf(2d) classes) has been documented.

2. Algorithm of computation of intersection line in case of two intersected cylinders (implemented in the fix for issue #24915) has been documented. Additionally, I would like to tell about some advantages of new algorithm in compare with old one.

2.1. Both algorithm generates intersection points for Walking-line (WL), which will be approximated to B-spline curve(s) in the future. At that, new algo (in compare with old one) uses another method for step computation. It based on attempts to provide equal steps (if it is possible) along V-direction (instead of U-direction used in old algorithm). It allows obtaining set of points, which are more uniform distributed in compare with old algo (this problem is the main reason why case #24915 was failed). Of course, we will get non-uniform distribution along U-direction. However, it can be compensated by small range (its length is less or equal 2*PI) of U-parameter change, whereas range of V-parameter can be very big.

2.2. More simple estimation of curvature "jump". New algo aims at provide equidistant distribution of points along V-direction. If it requires "jump" of U-parameter then we have "jump" of curvature in this point. This check is implemented in function AddPointIntoWL(...) (see place where SeekAdditionalPoints(...) is called).

However, in OCCT 7.1.0, curvature jumping is analyzed (it was not earlier, when the bug #24915 was fixed) - see fix for issue #27431.

2.3. New algorithm allows obtaining 7D-intersection point immediately. At that, old algorithm computed only 2D-intersection point (on some one surface). After that, it computed 3D-intersection point and, finally, projected(!) 3D-point to the second surface in order to obtain second 2D-intersection point. This second projection results in some problems. One problem is described in the issue #27968 (see message ~0058807). Second problem is the process of cases with singularity (significant improvement in this direction has been made in the fix #27431). Third problem is difficulties in projection itself (e.g. if we project point to a sphere when V-coordinate of the projection is near to PI/2 - projection point is found but not precise; the reason is not singularity but small radius of V-isoline).

Method used in new algorithm allows avoiding these problems. However, at present, it is implemented for case of two cylinders intersection (where most of these problems are not actual).

2.4. Algorithm of search of intersection point on surface boundary(ies) has been changed, too. Old algorithm sought point on boundary irrespective of intersection line. It resulted in problems described in the issue #27252 and related. New algorithm looks for intersection point of intersection line with surface boundary. It requires rectangular domain. However, it is not problem for current OCCT-version.
This commit is contained in:
nbv
2016-11-24 15:07:52 +03:00
committed by apn
parent fcfda0392f
commit 4dba155d8e
3 changed files with 256 additions and 26 deletions

View File

@@ -774,9 +774,57 @@ Standard_Boolean gp_Trsf::GetRotation (gp_XYZ& theAxis,
//=======================================================================
//function : Orthogonalize
//purpose :
//ATTENTION!!!
// Orthogonalization is not equivalent transformation. Therefore,
// transformation with source matrix and with orthogonalized matrix can
// lead to different results for one shape. Consequently, source matrix must
// be close to orthogonalized matrix for reducing these differences.
//=======================================================================
void gp_Trsf::Orthogonalize()
{
//Matrix M is called orthogonal if and only if
// M*Transpose(M) == E
//where E is identity matrix.
//Set of all rows (as of all columns) of matrix M (for gp_Trsf class) is
//orthonormal basis. If this condition is not satisfied then the basis can be
//orthonormalized in accordance with below described algorithm.
//In 3D-space, we have the linear span of three basis vectors: V1, V2 and V3.
//Correspond orthonormalized basis is formed by vectors Vn1, Vn2 and Vn3.
//In this case,
// Vn_{i}*Vn_{j} = (i == j)? 1 : 0.
//The algorithm includes following steps:
//1. Normalize V1 vector:
// V1n=V1/|V1|;
//
//2. Let
// V2n=V2-m*V1n.
//
//After multiplication two parts of this equation by V1n,
//we will have following equation:
// 0=V2*V1n-m <==> m=V2*V1n.
//
//Consequently,
// V2n=V2-(V2*V1n)*V1n.
//3. Let
// V3n=V3-m1*V1n-m2*V2n.
//
//After multiplication two parts of this equation by V1n,
//we will have following equation:
// 0=V3*V1n-m1 <==> m1=V3*V1n.
//
//After multiplication two parts of main equation by V2n,
//we will have following equation:
// 0=V3*V2n-m2 <==> m2=V3*V2n.
//
//In conclusion,
// V3n=V3-(V3*V1n)*V1n-(V3*V2n)*V2n.
gp_Mat aTM(matrix);
gp_XYZ aV1 = aTM.Column(1);

View File

@@ -549,9 +549,17 @@ void gp_Trsf2d::SetValues(const Standard_Real a11,
//=======================================================================
//function : Orthogonalize
//purpose :
//ATTENTION!!!
// Orthogonalization is not equivalent transformation.Therefore, transformation with
// source matrix and with orthogonalized matrix can lead to different results for
// one shape. Consequently, source matrix must be close to orthogonalized
// matrix for reducing these differences.
//=======================================================================
void gp_Trsf2d::Orthogonalize()
{
//See correspond comment in gp_Trsf::Orthogonalize() method in order to make this
//algorithm clear.
gp_Mat2d aTM(matrix);
gp_XY aV1 = aTM.Column(1);