找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 735|回复: 3

[编程申请]:在ARX编程中如何用直线模拟画圆弧

[复制链接]
发表于 2004-5-19 19:01:21 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

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

×
请教诸位高手,在ARX编程中如何用复合线模拟画圆弧?!
本人经过多次尝试均未成功,特请诸位赐教!
尤其使用startAngle()和endAngle()函数返回圆弧的起始角大于终止角时,不知如何计算圆弧上的坐标点,片段程序如下:
   double  satrtangle;  // 圆弧起始角
      double  endangle;  //原户终止角
      double   angle ,ang;  //计算圆弧上点坐标用到的角度、角度步长
      ads_point startpt ,endpt,centerpt;    //
      ang = (startangle-endangle)/100.0  //
      .......
      for( angle=startangle;angle<endangle;angle=angle+ang)
      {
          startpt[X]=centerpt[X]+0.707*cos(angle);
          startpt[Y]=centerpt[Y]+0.707*sin(angle);
          startpt[Z]=centerpt[Z];

          endpt[X]=centerpt[X]+0.707*cos(angle+ang);
          endpt[Y]=centerpt[Y]+0.707*sin(angle+ang);
          sendpt[Z]=centerpt[Z];
          ......
         }
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
发表于 2004-5-19 19:09:28 | 显示全部楼层
为什么要用直线模拟画圆弧?你把圆弧的弦计算出来,用直线连起来不就行了。
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

发表于 2004-5-19 19:41:37 | 显示全部楼层

  1.   [FONT=courier new]
  2. void

  3. getSamplePoints(

  4. double fromParam,

  5. double toParam,

  6. double approxEps,

  7. AcGePoint2dArray& pointArray,

  8. AcGeDoubleArray& paramArray) const;

  9. fromParam Input starting parameter
  10. toParam Input ending parameter
  11. approxEps Input chord-height tolerance
  12. pointArray Output array of points on curve between fromParam and toParam
  13. paramArray Output array of parameters corresponding to points in pointArray

  14. Returns a list of points on the curve between fromParam and toParam. The line segment between any two consecutive points returned in pointArray does not deviate by more than approxEps from the curve.


  15. --------------------------------------------------------------------------------

  16. void

  17. getSamplePoints(

  18. int numSample,

  19. AcGePoint2dArray& unnamed) const;

  20. numSample Input number of points that are to be returned
  21. unnamed Output array of sampled points

  22. Returns the specified number of points on the curve. The points are equally spaced by parameter value. So if the interval of the curve [0,1] and numSample is 5, the parameter values of the returned points will be 0, 0.25, 0.5, 0.75, and 1.


  23.   [/FONT]
复制代码
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

 楼主| 发表于 2004-5-21 18:55:48 | 显示全部楼层
请问斑竹,能否详细介绍getSamplePoints的用法?
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

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

本版积分规则

QQ|申请友链|Archiver|手机版|小黑屋|辽公网安备|晓东CAD家园 ( 辽ICP备15016793号 )

GMT+8, 2024-6-3 17:30 , Processed in 0.181548 second(s), 37 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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