satishrajdev 发表于 2022-7-5 16:42:24

断开圆弧

你好
 
请看下图,我想在交点处打断圆弧,我知道这可以使用Visual LISP函数完成,但我想在纯AutoLISP函数中完成。
 
我使用了inters函数来获得直线和多段线的交点,但在圆弧和圆的情况下,这是行不通的。
 
我需要你的建议,找出弧的交点。
 
当做
萨蒂什。
 

gS7 发表于 2022-7-5 16:47:41

萨蒂什看看这个帖子,也许你会得到一些提示
http://www.cadtutor.net/forum/showthread.php?t=82348
 
 
使用Tapatalk从我的SM-E700H发送

Grrr 发表于 2022-7-5 16:51:18

李有一些很好的数学子函数。
在交叉口类别中查找以下内容:

;; Line-Circle Intersection-Lee Mac
;; Returns the point(s) of intersection between an infinite line defined by
;; points p,q and circle with centre c and radius r

(defun LM:inters-line-circle ( p q c r / a d n s )
(setq n (mapcar '- q p)
   p (trans p 0 n)
   c (trans c 0 n)
   a (list (car p) (cadr p) (caddr c))
)
(cond
   (   (equal r (setq d (distance c a)))
   (list (trans a n 0))
   )
   (   (< d r)
   (setq s (sqrt (- (* r r) (* d d))))
   (list
       (trans (list (car p) (cadr p) (- (caddr c) s)) n 0)
       (trans (list (car p) (cadr p) (+ (caddr c) s)) n 0)
   )
   )
)
)
数学家太棒了!

satishrajdev 发表于 2022-7-5 16:53:23

谢谢大家,这是一个很好的例子开始。。。。
 
如果我发现任何问题,我会发布。

satishrajdev 发表于 2022-7-5 16:56:47

大家好,
 
有没有办法确定点是否在多段线上?当然,仅使用autolisp函数。
 
请参见下图。
 

gS7 发表于 2022-7-5 16:58:53

(vlax curve getdistatpoint polyobj pointpos)如果是,则给出距离或零
 
使用Tapatalk从我的SM-E700H发送

satishrajdev 发表于 2022-7-5 17:03:26

我知道我们可以使用vlax曲线函数来实现这一点,但有什么方法可以通过使用autolisp函数来实现吗?

gS7 发表于 2022-7-5 17:07:20

哦,对不起,萨提斯

Grrr 发表于 2022-7-5 17:10:27

 
我会使用nentselp。

Stefan BMR 发表于 2022-7-5 17:13:31

可以尝试此操作,但如果点位于任何对象上,而不是特定对象上,则返回True。
(defun point_on_object (p / m)
(and
   (setq m (osnap p "_nea"))
   (equal p m 1e-
)
)
页: [1] 2
查看完整版本: 断开圆弧