找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 535|回复: 0

[教学] 【AcGe几何库(四十一)】求任意两平面曲线的公切圆弧

[复制链接]

已领礼包: 40个

财富等级: 招财进宝

发表于 2018-6-16 18:11:45 | 显示全部楼层 |阅读模式

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

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

×
使用AcGe几何库可以很方便的得到,使用ARX AcGeCircArc3d类的set方法

AcGeCircArc3d &
set(
const AcGeCurve3d& curve1,
const AcGeCurve3d& curve2,
double radius,
double& param1,
double& param2,
Adesk::Boolean& success);
curve1Input any 3D curve
curve2Input any 3D curve
radiusInput radius of arc
param1Input parameter value on curve1 where arc touches curve
param2Input parameter value on curve2 where arc touches curve
successOutput to indicate whether the arc was computed successfully
Changes the definition of the arc to be tangent to the two input curves and have the specified radius. The two input curves must be coplanar. This function always returns an arc whose endpoints are the points on the two input curves that correspond to param1 and param2. If this function returns a value for success that is Adesk::kFalse, then this function has not changed the object.

两曲线公切园.gif


下面是XDRX API的LISP实现代码:

  1. (defun c:tt ()
  2.   (if (setq r (getreal "\n输入半径:"))
  3.     (progn
  4.       (while (and
  5.                (setq e1        (xdrx_entsel
  6.                           "\n拾取曲线1<退出>:"
  7.                           '((0 . "*LINE,ARC,CIRCLE,ELLIPSE"))
  8.                         )
  9.                )
  10.                (setq e2        (xdrx_entsel
  11.                           "\n拾取曲线2<退出>:"
  12.                           '((0 . "*LINE,ARC,CIRCLE,ELLIPSE"))
  13.                         )
  14.                )
  15.              )
  16.         (if (and
  17.               (setq p1 (cadr e1))
  18.               (setq e1 (car e1))
  19.               (setq p2 (cadr e2))
  20.               (setq e2 (car e2))
  21.               (setq g1 (xdge::constructor e1));构建曲线1几何对象
  22.               (setq g2 (xdge::constructor e2));构建曲线2几何对象
  23.               (setq pa1 (xdge::getpropertyvalue g1 "paramof" p1));曲线1上拾取点的参数值
  24.               (setq pa2 (xdge::getpropertyvalue g2 "paramof" p2));曲线2上拾取点的参数值
  25.               (setq garc (xdge::constructor "kcircarc3d"));构建AcGeCircArc3d对象
  26.               (xdge::setpropertyvalue garc "set" g1 g2 r pa1 pa2);set方法,成功修改garc到公切圆弧
  27.             )
  28.           (progn
  29.             (xdge::entity:make garc);生成数据库圆弧实体
  30.             (xdrx_setpropertyvalue (entlast) "color" 2);设置颜色2
  31.           )
  32.         )
  33.         (xdge::free g1 g2 garc);释放创建的几何对象
  34.       )
  35.     )
  36.   )
  37.   (princ)
  38. )


论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

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

GMT+8, 2024-3-29 07:50 , Processed in 0.230550 second(s), 31 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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