iCAx开思工具箱

标题: 求助! [打印本页]

作者: liyan    时间: 2003-9-24 17:14
标题: 求助!
请问如果已经用UF_MODL_ask_body_faces 获得一个物体的面链表
接着如何利用该链表去查询面的信息?
例如,我想在部件中查找一个直径为20的圆柱面,如何实现?:?)
作者: liberty000    时间: 2003-9-25 09:08
用这个函数:extern int UF_MODL_ask_face_data (
tag_t face,  
int * type,  
double point[ ],  
double dir[ ],  
double box[ ],  
double * radius,  
double * rad_data,  
int * norm_dir );
  
tag_t  face Input Face obj_id  
int *  type Output Face type is UG surface type code
16 = cylinder
17 = cone
18 = sphere
19 = revolved
20 = extruded
22 = bounded plane
23 = fillet (blend)
43 = b-surface
65 = offset surface
66 = foreign surface  
double  point[ ] Output Point information is returned according to the value
of type as follows.
Plane = Position in plane
Cylinder= Position on axis
Cone = Position on axis
Sphere = Center position
Torus = Center position
Revolved = Position on axis  
double  dir[ ] Output Direction information is returned according to the
value of type as follows.
Plane = Normal direction
Cylinder= Axis direction
Cone = Axis direction
Torus = Axis direction
Revolved = Axis direction  
double  box[ ] Output Face boundary. The coordinates of the opposite
corners of a rectangular box with sides parallel to X,
Y, and Z axes (Absolute Coordinate System) are
returned. The box contains the specified face and is
usually close to the minimum possible size, but this
is not guaranteed.
box[0] = Xmin
box[1] = Ymin
box[2] = Zmin
box[3] = Xmax
box[4] = Ymax
box[5] = Zmax  
double *  radius Output Face major radius:
For a cone, the radius is taken at the point[3]
position on the axis.
For a torus, the radius is taken at the major axis.  
double *  rad_data Output Face minor radius: only a torus or cone has rad_data as
a minor radius.
For a cone, rad_data is the half angle in radians.
For a torus, rad_data is taken at the minor axis.  
int *  norm_dir Output Face normal direction: +1 if the face normal is in the
same direction as the surface normal (cross product of
the U- and V-derivative vectors), -1 if reversed.
作者: liyan    时间: 2003-9-25 15:19
谢谢了




欢迎光临 iCAx开思工具箱 (https://t.icax.org/) Powered by Discuz! X3.3