明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 2465|回复: 1

样条曲线的绘制方法?

[复制链接]
发表于 2010-1-6 09:26:00 | 显示全部楼层 |阅读模式

我从cad另存的dxf文件中获取到了

样条曲线的 控制点、节点、阶数

我需要再C#中把样条曲线绘制出来

dxf文件里这个节点指的是什么啊?

怎么把这些参数转换成控制点和权因子???

另外有没有高手给个程序,通过控制点、节点、阶数绘制样条曲线

发表于 2010-1-6 16:49:00 | 显示全部楼层
public
		Spline(
    int
		degree, 
    [MarshalAs(UnmanagedType.U1)] bool
		rational, 
    [MarshalAs(UnmanagedType.U1)] bool
		closed, 
    [MarshalAs(UnmanagedType.U1)] bool
		periodic, 
    Point3dCollection controlPoints, 
    DoubleCollection knots, 
    DoubleCollection weights, 
    double
		controlPointTolerance, 
    double
		knotTolerance
);

Creates a spline using the parameters passed in. 

If the spline is to be rational, then isRational should be true. 

If the spline is to be closed (that is, a closed loop), then isClosed should be true. 

If the spline is to be periodic, then isPeriodic should be true. This parameter should only be set to true if the spline is closed. A periodic spline is a spline with period T such that the point at parameter value t + T is the same as the point at parameter t for any value of t. 

The weights array is only used when isRational == true. If used, it must have the same number of entries as the controlPoints collection. All weight values must be greater than 0.0. 

The knots collection must have ((number of controlPoints) + degree + 1) entries and each knot must have a value greater than or equal to the value of its predecessor in the collection. 

The knotTolerance value is used to determine which knot values are to be treated as the same. If the difference between two knot values is less than knotTolerance, then the two values will be treated as the same (and the first of the two values will be used for both). 

The controlPointTolerance value is used to determine if two control points are to be treated as the same point. If the distance (in drawing units) between two control points is less than controlPointTolerance, then those two control points will be treated as the same point. If the first and last control points are within controlPointTolerance of each other, the spline will be closed regardless of the isClosed value. 

If any of the parameters are not acceptable, then the gelib object for the spline is not created and this constructor behaves like the default constructor (that is, the passed in values will not be used and the data query methods on the spline returns invalid values). 

Use Spline.IsNull to determine if this constructor succeeded in initializing the spline to the values passed in. If Spline.IsNull returns false, then the initialization succeeded.

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

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-11-25 20:41 , Processed in 0.144896 second(s), 24 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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