XDSoft 发表于 2014-9-19 12:24:13

XDGE几何库应用(九) ---抠出曲线内的部分

ARX函数原型
AcGeNurbCurve3d::hardTrimByParams Function AcGeNurbCurve3d &hardTrimByParams(double newStartParam,double newEndParam);
newStartParam输入样条曲线起点的新参数
newEndParam输入样条曲线终点的新参数
使用新的起点和终点参数裁剪样条曲线。这通过添加和删除控制点和节点,而不是重设定义样条曲线的间距来实现。

AcGeCurve3d::setInterval Function Adesk::BooleansetInterval(
const AcGeInterval& intrvl);

主要函数: (xdge::setpropertyvalue ge "hardTrimByParams" from to)(xdge::setpropertyvalue ge "setInterval" in)
(defun c:tt (/ e ge p1 p2 pam1 pam2 in typ from to)
(if
    (and (setq
   e (xdrx_entsel
         "\nPick Curve: "
         '((0 . "LWPOLYLINE,ARC,LINE,ELLIPSE,CIRCLE,SPLINE"))
       )
   )
   (setq ge (xdge::constructor (car e)))
   (setq p1 (cadr e))
   (setq p2 (getpoint p1 "\nSecond Point: "))
   (setq pam1 (xdge::getpropertyvalue
          ge
          "paramOf"
          (xdge::getpropertyvalue ge "closestPointTo" p1)
      )
         pam2 (xdge::getpropertyvalue
          ge
          "paramOf"
          (xdge::getpropertyvalue ge "closestPointTo" p2)
      )
   )
   (setq typ (xdge::type ge))
    )
   (progn
       (if (= typ "kNurbCurve3d")
   (progn
   (mapcar 'set '(from to) (vl-sort (list pam1 pam2) '<))
   (xdge::setpropertyvalue ge "hardTrimByParams" from to)
   (xdge::entity:make ge)
   (xdrx_entity_setcolor (entlast) 1)
   )
   (progn
   ;;(mapcar 'set '(from to) (vl-sort (list pam1 pam2) '<))
   (setq in (xdge::constructor "AcGeInterval" pam1 pam2))
   (xdge::setpropertyvalue ge "setInterval" in)
   (xdge::entity:make ge)
   (xdrx_entity_setcolor (entlast) 1)
   )
       )
       (vl-cmdf ".move" "l" "" p1)
   )
   (xdge::free)
)
(princ)
)

XDSoft 发表于 2014-9-19 12:27:29

请下载最新的 XDRX_API 0919以上版本测试上面代码。

csharp 发表于 2014-9-19 12:37:39

这个对参数排序了,闭合线就不能抠出跨越起点的线段

yangpeng0718 发表于 2014-9-19 22:16:34

样条线也能弄啊帅啊

XDSoft 发表于 2016-6-5 21:23:44

csharp 发表于 2014-9-19 12:37
这个对参数排序了,闭合线就不能抠出跨越起点的线段

闭合曲线可以扣除两部分,然后用 xdrx_curve_join

树櫴希德 发表于 2024-8-16 11:49:04

太牛了   请问XDRX API 收费吗 ?是ARX能支持CAD2025吗?
页: [1]
查看完整版本: XDGE几何库应用(九) ---抠出曲线内的部分