OpenCASCADE point projected onto the cylindrical surface

OpenCASCADE point projected onto the cylindrical surface

[email protected]

 

OpenCASCADE class Extrema_ExtPElS provides a projection calculation function points to the base surface, the distance may be maximum or minimum. Point as shown below to have a cylindrical projection projected two points P1 and P2 , the distance from the cylinder to a minimum value point is P to P1 in the distance, the maximum value is P to P2 distance. This article is for such mid-point projection algorithm to analyze cylinder.

 

Class Extrema_ExtPElS class calculation point source into the cylindrical projection are listed below:

 

Notes can be seen in conjunction with the source point P to the cylinder S projected by the following main steps:

l calculating points P to a cylinder S axis normal to the plane of projection point Pp ;

l If the point P on the axis, is calculated else return;

l calculated point Pp cylindrical U parameter direction Ul (angle);

l parameter Ul (angle) plus 180 degrees to obtain parameters U2 ;

l calculated parameters ( Ul , V ), ( U2 , V ) the corresponding point on the cylindrical surface;

The main operation is used to achieve the above-described vector, it is easy and high performance. Which holds the distance is distance squared value of this approach comes the main consideration is the square root function performance, unless used later to distance themselves will prescribe such treatment also provides a performance.

OpenCASCADE vector class gp_Vec provides a function AngleWithRef () , the function is mainly found View source is to calculate the angle between two vectors, wherein the parameter vector Ref is used to process the positive and negative angle. When the vector cross product of two vectors and reference vector Ref reverse also obtained value takes a negative angle.

Here a simple applet to the calculation result Draw Test Harness visualization, this can visually verify:

 

Generate a script file is loaded into the DRAW results obtained as shown below:

 

As can be seen from the figure, obtained by projecting two points Pl , P2 height value of the point P are the same.

Guess you like

Origin www.cnblogs.com/opencascade/p/Project_Point_Cylinder.html