iCAx开思工具箱

标题: 请解释一个结构体 [打印本页]

作者: Elos1982    时间: 2006-3-5 10:06
标题: 请解释一个结构体
在api中有结构体,比如:
struct UF_MODL_bsurface_s
{
    int num_poles_u;
    int num_poles_v;
    int order_u;
    int order_v;
    int is_rational;
    double *knots_u;
    double *knots_v;
    double (*poles)[4];
} ;
UG对其中的几个参数没有做具体的解释,请大侠帮忙解释一下各个参数代表什么意义,谢谢。
然后就是各位大侠如何搞明白的这些结构体的呀?有书籍吗?再谢。
作者: 深夜摔键盘    时间: 2006-3-6 09:33
struct UF_MODL_bsurface_s
{
    int num_poles_u;//曲面u向控制点数
    int num_poles_v;//曲面v向控制点数
    int order_u;//曲面u向阶数
    int order_v;//曲面v向阶数
    int is_rational;//是否为有理曲面的标识
    double *knots_u;//曲面u向节点数
    double *knots_v;//曲面v向节点数
    double (*poles)[4];//控制点数组,二维数组,n行4列的,n值可以由u,v向阶数和节点数计算得到,4列是控制点在格拉斯曼空间中的坐标值。
} ;
作者: Elos1982    时间: 2006-3-6 13:54
解释的很清楚,谢谢!
作者: iam5840544    时间: 2006-5-20 17:12
原帖由  于 2006-3-6 09:33 发表
struct UF_MODL_bsurface_s
{
    int num_poles_u;//曲面u向控制点数
    int num_poles_v;//曲面v向控制点数
    int order_u;//曲面u向阶数
    int order_v;//曲面v向阶数
    int is_rational;//是否为有理曲面的标识
    double *knots_u;//曲面u向节点数
    double *knots_v;//曲面v向节点数
    double (*poles)[4];//控制点数组,二维数组,n行4列的,n值可以由u,v向阶数和节点数计算得到,4列是控制点在格拉斯曼空间中的坐标值。
} ;

我是个初学者,虽然如此解释,我还不是很明白。
什么是格拉斯曼空间呢?

以下是从UG文档中copy来的
struct UF_BREP_bsurface_s
Overview
A non-uniform rational b-spline (NURBS) surface is represented. The poles
array is constructed as follows. Each row is a u spline and each column is a
v spline, stored in row-major order. U indexes the columns and v indexes the
rows. The subscript into the poles array for any given pole defining the
surface is obtained as follows:

subscr = (num_poles_u * v + u)
poles[subscr][0] = x coordinate
poles[subscr][1] = y coordinate
poles[subscr][2] = z coordinate
poles[subscr][3] = weight

In each direction, the number of knots = num_poles + order. The x, y, and z
coordinates are weighted.

A periodic NURBS surface in one or both directions is one that closes with
the same location and tangent vectors at the matching edges. UG/Open
determines periodicity from the bsurface data.

Note that this structure is identical to UF_MODL_bsurface_s.



Data Members
num_poles_u
int num_poles_u
The number of control points(poles) in the u direction.

num_poles_v
int num_poles_v
The number of control points(poles) in the v direction.

order_u
int order_u
The order (degree +1) of the basis functions in the u direction.

order_v
int order_v
The order (degree +1) of the basis functions in the v direction.

is_rational
logical is_rational
True if the surface is rational (the weights are not all equal).

knots_u
double* knots_u
Knot vector for the u direction.

knots_v
double* knots_v
Knot vector for the v direction.

poles
double(* poles)[ 4 ]
An array of the control points (poles).




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