|
马上注册登录,享用更多网站功能!
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
关于判断两条线是否重合
每条线都是由点而生成,它们固有自己的类型,自己的特征。要判断两者是否重合,需从这两点出发:
1.先判断两线的类型是否相同;
2.对两线的控制点或特征进行控制;
Curve类型:
UF_point_type;UF_line_type;UF_circle_type;UF_conic_type;UF_spline_type
数据类型:struct UF_CURVE_struct_s
struct UF_CURVE_struct_s
{
void *crv_data; /* A pointer to a void structure. This structure
should be appropriately typecast to get the
correct curve structure. The different curve
structures are:
POINT_DATA, LINE_DATA, ARC_DATA, CONIC_DATA
or BEZ_DATA */
int crv_type; /* Curve object type. Valid types are:
UF_point_type
UF_line_type
UF_circle_type
UF_conic_type
UF_spline_type
这个参数就是我们所需要的。
*/
double crv_t0; /* the start parameter of the curve */
double crv_tscale; /* Difference between the start and end
parameters of the curve for example:
tend = crv_t0 + crv_tscale
*/
int curve_periodic; /* Periodic flag for the curve
0 = nonperiodic
1 = periodic
*/
} ;
使用函数:
1.UF_CURVE_ask_curve_struct();
获得crv_type;然后判断类型是否相同;相同着进行下一步。
2.UF_CURVE_ask_curve_struct_data();
获得curve_data;然后逐一比较即可。
curve_data may have the following data:
POINT curve_data[0 - 2]
LINE curve_data[0] = t0
curve_data[1] = tscale
curve_data[2] = periodicity
curve_data[3 - 5] = first point
curve_data[6 - 8] = second point
ARC curve_data[0] = t0
curve_data[1] = tscale
curve_data[2] = periodicity
curve_data[3] = start angle
curve_data[4] = end angle (radians)
curve_data[5] = radius
curve_data[6 - 8] = center
curve_data[9 - 11] = X axis of the
construction plane
curve_data[12 - 14] = Y axis of the
construction plane
CONIC curve_data[0] = t0
curve_data[1] = tscale
curve_data[2] = periodicity
curve_data[3] = T1
curve_data[4] = T2
curve_data[5] = K1
curve_data[6] = K2
curve_data[7] = conic type
curve_data[8 - 10] = center
curve_data[11 - 13] = axis1
curve_data[14 - 16] = axis2
B-CURVE curve_data[0] = t0
curve_data[1] = tscale
curve_data[2] = periodicity
curve_data[3] = number of poles
curve_data[4] = order
curve_data = knot sequence
( curve_data[3] +
curve_data[4] )
curve_data = array of homogeneous
poles (wx, wy, wz, w), for
each pole.
晚上调试程序。哈哈,希望对大家有用。。 |
|