SDK

Functions

int SPI_CAL_speed (int iFlag, double diam, double *vc, double *vr)
 Calculates cutting speed or rotation.
 
int SPI_CAL_feedrate (int iFlag, int nbTeeth, double vr, double *vteeth, double *vfeed)
 Calculates feedrate value.
 
double SPI_CAL_read_length_accuracy ()
 Reads the length tolerance value used by GO2cam.
 
double SPI_CAL_angle (double x, double y)
 Calculates the angle of the triangle whose adjacent dimension is x and
the opposite side is worth y.
 
double SPI_CAL_dist_2pts (double *pt1, double *pt2)
 Calculate the distance between two points.
 
void SPI_CAL_step_and_number (int flagEven, double length, double *lengthBegin, double *lengthEnd, double *step, int *number)
 Calculatee number and reason / total height (sequence)
 
double SPI_CAL_read_facet_accuracy ()
 Reads the tolerance of the curve (for decomposition into segments)
 
double SPI_CAL_read_unit_ratio ()
 Reads the ratio between mm/user unit (ex inch :1/INCHCOEF)
 
double SPI_CAL_read_dimension_ratio ()
 Reads the ratio between mm/user unit (ex inch :1/INCHCOEF)
 
double SPI_CAL_acosinus (double x)
 Calculates the arcosine of an angle.
 
void SPI_CAL_angle_arc (double *elt, double *radius, double *angBeg, double *angEnd, double *dAngle)
 Calculates starting and ending angle and radius of an arc.
 
int SPI_CAL_fillet_2lines (double *line1, int side1, double *line2, int side2, double radius, double *fillet)
 Calculate the fillet between two lines.
 
void SPI_CAL_mat_coo (double *mat, double *pt, double *ps)
 Calculates the coordinates of a point transformed by a matrix.
 
void SPI_CAL_mat_pro (double *mat1, double *mat2, double *mat)
 calculates the product of 2 3X3 matrices
 
void SPI_CAL_mat_inv (double *mat1, double *mat2)
 calculates the inverse matrix
 
void SPI_CAL_mat_vnorm (double *vec, double *mat)
 calculates matrix of plane which has this normal vector
 
int SPI_CAL_intersection_elt (int type1, double *param1, int type2, double *param2, int *nbInter, double *pt1, double *pt2)
 calculates the intersection between 2 entities
 
int SPI_CAL_intersection (int ind1, int ind2, int unlimit, int *nbInter, int *indloc)
 calculates the intersection between 2 entities
 
int SPI_CAL_facet_arc (int way, double *eltParam, double toler, int *indloc)
 Facetizes an arc / toler into a list of segments.
 
void SPI_CAL_change_reference_elt (int refPlane, int ptPlane, int nbPt, double *listPt)
 Changes points coordinates ( from one plane to another one)
 
void SPI_CAL_change_reference_point (int refPlane, int ptPlane, double *ptIn, double *ptOut)
 Calculates the coordinates of the point in another plane.
 
int SPI_CAL_pt_stock_lathe (int iFlag, double *ptRef, double angle, double *ptStock)
 Calculates intersection between rought and a line ( point + direction)
 
int SPI_CAL_max_stock_lathe (double *ptMin, double *ptMax)
 calculates minimum/maximum value for the current lathe stock
Ptmax
 

Detailed Description

Basic

Function Documentation

◆ SPI_CAL_acosinus()

double SPI_CAL_acosinus ( double x)

Calculates the arcosine of an angle.

Returns
angle (radian) corresponding to arcosine of x
angle := RCALL(SPI_CAL_acosinus,0.7);
double SPI_CAL_acosinus(double x)
Calculates the arcosine of an angle.
Definition sp_cal01.c:376

◆ SPI_CAL_angle()

double SPI_CAL_angle ( double x,
double y )

Calculates the angle of the triangle whose adjacent dimension is x and
the opposite side is worth y.

Parameters
[in]xAdjacent dimension
[in]yOpposite side
Returns
Angle value
Remarks
The angle returned is always between 0 and 2 * pi in Radian
angle := RCALL(SPI_CAL_angle,10,20);
double SPI_CAL_angle(double x, double y)
Calculates the angle of the triangle whose adjacent dimension is x and the opposite side is worth y...
Definition sp_cal01.c:172

◆ SPI_CAL_angle_arc()

void SPI_CAL_angle_arc ( double * elt,
double * radius,
double * angBeg,
double * angEnd,
double * dAngle )

Calculates starting and ending angle and radius of an arc.

Parameters
[in]eltcharacteristics of the circle starting point, ending point and cente (TR9)
[out]radiuscircle or arc radius
[out]angBegstarting angle in radian between 0 and 2Pi
[out]angEndending angle in radian between 0 and 2Pi
[out]dAngleangular difference
PCALL(SPI_CAL_angle_arc,tab9,radius,ang_begin,ang_end,dang);
void SPI_CAL_angle_arc(double *elt, double *radius, double *angBeg, double *angEnd, double *dAngle)
Calculates starting and ending angle and radius of an arc.
Definition sp_cal01.c:399

◆ SPI_CAL_change_reference_elt()

void SPI_CAL_change_reference_elt ( int refPlane,
int ptPlane,
int nbPt,
double * listPt )

Changes points coordinates ( from one plane to another one)

Parameters
[in]refPlanereference plane
[in]ptPlanetarget plane
[in]nbPtpoints number to treat
[in,out]listPtpoints list to treat (nbpt*TR3)
Remarks
To calculate a point SPI_CAL_change_reference_elt(0,5,1,TR3)
To calculate an arc SPI_CAL_change_reference_elt(0,5,3,TR9)
PCALL(SPI_CAL_change_reference_elt,1,3,10,list_pt);
void SPI_CAL_change_reference_elt(int refPlane, int ptPlane, int nbPt, double *listPt)
Changes points coordinates ( from one plane to another one)
Definition sp_cal01.c:831

◆ SPI_CAL_change_reference_point()

void SPI_CAL_change_reference_point ( int refPlane,
int ptPlane,
double * ptIn,
double * ptOut )

Calculates the coordinates of the point in another plane.

Version
5.8
Parameters
[in]refPlanereference plane
[in]ptPlaneplane of point
[in]ptInpoint coordinates in its ref plane
[in,out]ptOutpoints coordinates in target plane
PCALL(SPI_CAL_change_reference_point,1,3,pt_in,pt_out);
void SPI_CAL_change_reference_point(int refPlane, int ptPlane, double *ptIn, double *ptOut)
Calculates the coordinates of the point in another plane.
Definition sp_cal01.c:876

◆ SPI_CAL_dist_2pts()

double SPI_CAL_dist_2pts ( double * pt1,
double * pt2 )

Calculate the distance between two points.

Version
6.04
Parameters
[in]pt1first point (TR3)
[in]pt2second point (TR3)
Returns
Distance
dist := RCALL(SPI_CAL_dist_2pts,pt1,pt2);
double SPI_CAL_dist_2pts(double *pt1, double *pt2)
Calculate the distance between two points.
Definition sp_cal01.c:211

◆ SPI_CAL_facet_arc()

int SPI_CAL_facet_arc ( int way,
double * eltParam,
double toler,
int * indloc )

Facetizes an arc / toler into a list of segments.

Parameters
[in]waydirection of the arc 1 Trigo | 0 clockwise
[in]eltParamcanonical form of the arc (starting point, ending point, center point)
[in]tolerarc cutting tolerance
[out]indlocindex of the allocated table containing the list of points
Returns
SPI_YES if Ok | SPI_NO if error
Remarks
Use allocation functions with a SPI_LOC_TYPTR3
ier := ICALL(SPI_CAL_facet_arc,1,tab9,0.001,indloc);
int SPI_CAL_facet_arc(int way, double *eltParam, double toler, int *indloc)
Facetizes an arc / toler into a list of segments.
Definition sp_cal01.c:771
See also
SPI_LOC_find_first_array,
SPI_LOC_alloc_array, SPI_LOC_free_array,
SPI_LOC_write_one_in_array, SPI_LOC_read_one_in_array

◆ SPI_CAL_feedrate()

int SPI_CAL_feedrate ( int iFlag,
int nbTeeth,
double vr,
double * vteeth,
double * vfeed )

Calculates feedrate value.

Version
5.1
Parameters
[in]iFlag0 vfeed = vr * vteeth * nbteeth ,
1 vteeth = vfeed / vr / nbteeth
[in]nbTeethNumber of teeth
[in]vrspindle speed
[in,out]vteethfeedrate / teeth
[in,out]vfeedfeedrate
Returns
SPI_YES if OK | SPI_NO

◆ SPI_CAL_fillet_2lines()

int SPI_CAL_fillet_2lines ( double * line1,
int side1,
double * line2,
int side2,
double radius,
double * fillet )

Calculate the fillet between two lines.

Version
6.08
Parameters
[in]line1first line (TR9)
[in]side1first side to tangency (-1, +1)
[in]line2second line (TR9)
[in]side2second side to tangency (-1, +1)
[in]radiusradius of a filet
[out]fillet
Returns
error
ierr := ICALL(SPI_CAL_fillet_2lines,line1,1,line2,1,10.0,fillet);
int SPI_CAL_fillet_2lines(double *line1, int side1, double *line2, int side2, double radius, double *fillet)
Calculate the fillet between two lines.
Definition sp_cal01.c:434

◆ SPI_CAL_intersection()

int SPI_CAL_intersection ( int ind1,
int ind2,
int unlimit,
int * nbInter,
int * indloc )

calculates the intersection between 2 entities

Parameters
[in]ind1index in the database of the 1st geometrical entity
[in]ind2index in the database of the 2nd geometrical entity
[in]unlimitif 1, consider consider limited entities as unlimited
[out]nbInternumber of intersections between the 2 elements
[out]indlocindex of the allocated table containing the list of points
Returns
0 : OK intersection found
51 : Parallel lines separated
52 : Parallel Lines equal
53 : Line and Circle tangents
54 : Line and Circle with no intersection
55 : Tangent Circles (external)
56 : Tangent Circles (internal)
57 : Separated external circles
58 : Separated internal circles
59 : Confused circles
60 : Concentrics circles
66 : Other errors

◆ SPI_CAL_intersection_elt()

int SPI_CAL_intersection_elt ( int type1,
double * param1,
int type2,
double * param2,
int * nbInter,
double * pt1,
double * pt2 )

calculates the intersection between 2 entities

Parameters
[in]type11st entity type (SPI_ELTTYPE_SEGMENT, SPI_ELTTYPE_ARC)
[in]param11st entity coordinates (TR9)
[in]type22nd entity type (SPI_ELTTYPE_SEGMENT, SPI_ELTTYPE_ARC)
[in]param22nd entity coordinates (TR9)
[out]nbInternumber of intersections between the 2 elements (2 MAXI)
[out]pt11st intersection point (TR3)
[out]pt22nd intersection point (TR3)
Returns
0 : OK intersection found
51 : Parallel lines separated
52 : Parallel Lines equal
53 : Line and Circle tangents
54 : Line and Circle with no intersection
55 : Tangent Circles (external)
56 : Tangent Circles (internal)
57 : Separated external circles
58 : Separated internal circles
59 : Confused circles
60 : Concentrics circles
66 : Other errors
ier := ICALL(SPI_CAL_intersection_elt,SPI_ELTTYPE_SEGMENT,tab9_1,
SPI_ELTTYPE_SEGMENT,tab9_2,nbinter,pt1,pt2);
int SPI_CAL_intersection_elt(int type1, double *param1, int type2, double *param2, int *nbInter, double *pt1, double *pt2)
calculates the intersection between 2 entities
Definition sp_cal01.c:623

◆ SPI_CAL_mat_coo()

void SPI_CAL_mat_coo ( double * mat,
double * pt,
double * ps )

Calculates the coordinates of a point transformed by a matrix.

Parameters
[in]mattransformation matrix (TR9)
[in]ptpoint to transform (TR3)
[out]pspoint from the transformation.
Remarks
pt and ps can be the same
PCALL(SPI_CAL_mat_coo,mat,pt_in,pt_out);
void SPI_CAL_mat_coo(double *mat, double *pt, double *ps)
Calculates the coordinates of a point transformed by a matrix.
Definition sp_cal01.c:474

◆ SPI_CAL_mat_inv()

void SPI_CAL_mat_inv ( double * mat1,
double * mat2 )

calculates the inverse matrix

Parameters
[in]mat1reference matrix
[out]mat2reverse matrix
PCALL(SPI_CAL_mat_inv,mat_int,mat_out);
void SPI_CAL_mat_inv(double *mat1, double *mat2)
calculates the inverse matrix
Definition sp_cal01.c:555

◆ SPI_CAL_mat_pro()

void SPI_CAL_mat_pro ( double * mat1,
double * mat2,
double * mat )

calculates the product of 2 3X3 matrices

Parameters
[in]mat1,mat2matrices 3X3
[out]matcalculated matrix
Remarks
mat can be one of the 2 input matrices
PCALL(SPI_CAL_mat_pro,mat1,mat2,mat_out);
void SPI_CAL_mat_pro(double *mat1, double *mat2, double *mat)
calculates the product of 2 3X3 matrices
Definition sp_cal01.c:515

◆ SPI_CAL_mat_vnorm()

void SPI_CAL_mat_vnorm ( double * vec,
double * mat )

calculates matrix of plane which has this normal vector

Parameters
[in]vecnormal vector
[out]matcalculated matrice
PCALL(SPI_CAL_mat_vnorm,vec,mat);
void SPI_CAL_mat_vnorm(double *vec, double *mat)
calculates matrix of plane which has this normal vector
Definition sp_cal01.c:589

◆ SPI_CAL_max_stock_lathe()

int SPI_CAL_max_stock_lathe ( double * ptMin,
double * ptMax )

calculates minimum/maximum value for the current lathe stock
Ptmax

Version
4.5
Parameters
[out]ptMinStock point min
[out]ptMaxStock point max
Returns
SPI_YES if OK | SPI_NO : no stock
ier := ICALL(SPI_CAL_max_stock_lathe,ptmin,ptmax);
int SPI_CAL_max_stock_lathe(double *ptMin, double *ptMax)
calculates minimum/maximum value for the current lathe stock Ptmax
Definition sp_cal01.c:991

◆ SPI_CAL_pt_stock_lathe()

int SPI_CAL_pt_stock_lathe ( int iFlag,
double * ptRef,
double angle,
double * ptStock )

Calculates intersection between rought and a line ( point + direction)

Version
4.5
Parameters
[in]iFlag0 nearest point , 1 farest point
[in]ptRefsearch direction
[in]angle(angle in degrees)
[out]ptStockFound point
Returns
SPI_YES if OK | SPI_NO : no rought or calculation error
ier := ICALL(SPI_CAL_pt_stock_lathe,0,ptref,180,ptbrut);
int SPI_CAL_pt_stock_lathe(int iFlag, double *ptRef, double angle, double *ptStock)
Calculates intersection between rought and a line ( point + direction)
Definition sp_cal01.c:922

◆ SPI_CAL_read_dimension_ratio()

double SPI_CAL_read_dimension_ratio ( )

Reads the ratio between mm/user unit (ex inch :1/INCHCOEF)

Returns
ratio value for dimensions
double SPI_CAL_read_dimension_ratio()
Reads the ratio between mm/user unit (ex inch :1/INCHCOEF)
Definition sp_cal01.c:353

◆ SPI_CAL_read_facet_accuracy()

double SPI_CAL_read_facet_accuracy ( )

Reads the tolerance of the curve (for decomposition into segments)

Returns
Tolerance value
double SPI_CAL_read_facet_accuracy()
Reads the tolerance of the curve (for decomposition into segments)
Definition sp_cal01.c:307

◆ SPI_CAL_read_length_accuracy()

double SPI_CAL_read_length_accuracy ( )

Reads the length tolerance value used by GO2cam.

Returns
Tolerance value
double SPI_CAL_read_length_accuracy()
Reads the length tolerance value used by GO2cam.
Definition sp_cal01.c:149

◆ SPI_CAL_read_unit_ratio()

double SPI_CAL_read_unit_ratio ( )

Reads the ratio between mm/user unit (ex inch :1/INCHCOEF)

Returns
ratio value
rate := RCALL(SPI_CAL_read_unit_ratio);
double SPI_CAL_read_unit_ratio()
Reads the ratio between mm/user unit (ex inch :1/INCHCOEF)
Definition sp_cal01.c:330

◆ SPI_CAL_speed()

int SPI_CAL_speed ( int iFlag,
double diam,
double * vc,
double * vr )

Calculates cutting speed or rotation.

Version
5.1
Parameters
[in]iFlag0 vr = 1000*vc/pi/diam , 1 vc = vr*pi*diam/1000 milling
10 vr = 1000*vc/pi/diam ,11 vc = vr*pi*diam/1000 lathe
[in]diamtool diameter
[in,out]vccutting speed
[in,out]vrspindle speed
Returns
SPI_YES if OK | SPI_NO

◆ SPI_CAL_step_and_number()

void SPI_CAL_step_and_number ( int flagEven,
double length,
double * lengthBegin,
double * lengthEnd,
double * step,
int * number )

Calculatee number and reason / total height (sequence)

Parameters
[in]flagEven0 Any number | 1 Even number only
[in]lengthtotal length to decompose
[in,out]lengthBeginstart length
[in,out]lengthEndend length
[out]stepreason for decomposition calculation
[out]numbernumber of decomposition (steps)
Remarks
If length_begin = length_end ==> decomposition with a step
Otherwise ==> compute the arithmetical reason
to have a start and end length
length_begin := 2;
length_end := 5;
PCALL(SPI_CAL_step_and_number,0,50,length_begin,length_end,step,nb);
void SPI_CAL_step_and_number(int flagEven, double length, double *lengthBegin, double *lengthEnd, double *step, int *number)
Calculatee number and reason / total height (sequence)
Definition sp_cal01.c:244