iCAx开思工具箱

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 25641|回复: 1
打印 上一主题 下一主题

关于两线重合的判断思路

[复制链接]
跳转到指定楼层
楼主
发表于 2007-11-26 09:31:57 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式

马上注册登录,享用更多网站功能!

您需要 登录 才可以下载或查看,没有帐号?立即注册

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.
    晚上调试程序。哈哈,希望对大家有用。。
  • 分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
    收藏收藏 分享淘帖 支持支持
    沙发
    发表于 2010-11-21 17:11:18 | 只看该作者

    马上注册登录,享用更多网站功能!

    您需要 登录 才可以下载或查看,没有帐号?立即注册

    x
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    手板模型制作,在线3D打印服务

    QQ|小黑屋|手机版|开思工具箱 CAD工具箱_CAM工具箱  

    GMT+8, 2024-5-4 03:50 , Processed in 0.011084 second(s), 8 queries , Gzip On, Redis On.

    Powered by Discuz! X3.3

    © 2002-2024 www.iCAx.org

    快速回复 返回顶部 返回列表