ScmTools 发表于 2013-5-4 16:44:57

已知一段弧的起点和终点以及其凸度,求其圆心

便于一些初学者学习,整理了网上的一些基础函数, 现在这里贴出来

已知一段弧的起点和终点以及其凸度,求其圆心
**** Hidden Message *****

XD0001 发表于 2013-5-4 18:37:16

支持LZ的学习专贴

HLCAD 发表于 2013-5-30 15:22:03

向您学习,回复看贴

wangdaobin 发表于 2013-7-22 04:40:08

不学习了!!!!

myfrankie 发表于 2013-9-13 14:51:39

路过,看看是什么东东

q3_2006 发表于 2013-9-13 18:03:07

回复一下要几分钟,真是无语!

zjsmlzp 发表于 2013-9-15 06:42:00

本帖最后由 zjsmlzp 于 2013-9-15 06:44 编辑

怎么试用呢?学习学习:)

francfang 发表于 2013-11-18 21:21:36

已知一段弧的起点和终点以及其凸度,求其圆心

why1025 发表于 2015-1-24 11:20:54

{:soso_e100:}{:soso_e101:}{:soso_e102:}{:soso_e102:}

kkt123 发表于 2015-3-1 03:35:59

;P向您学习,回复看;P

yywl 发表于 2015-6-9 17:53:52

已知一段弧的起点和终点以及其凸度,求其圆心

qqddgg123 发表于 2016-6-13 16:56:07

谢谢。学习了。

lhg 发表于 2017-1-20 21:56:26

啥也不说了,感谢楼主分享哇!

newer 发表于 2017-1-21 02:17:22

这个问题求出弧线中点,然后用几何库的AcGeCircArc3d 通过三点构造函数,得到几何实体,然后直接用center()方法求得。

AcGeCircArc3d(
const AcGePoint3d& startPoint,
const AcGePoint3d& pnt,
const AcGePoint3d& endPoint);
startPoint        Input start point of arc
pnt        Input point on arc
endPoint        Input endpoint of arc
Constructs an arc through three points. None of the three points may be coincindent and they may not be colinear. This constructor always constructs a bounded arc and cannot be used to construct a full circle.

114b864e-5e83-4733-9a4d-2f7f784da71b

下面是用LISP实现的这个过程


(defun c:tt ()
(if (and
        (setq p1 (getpoint "\nfirst point:"))
        (setq p2 (getpoint p1 "\nsecond point:"))
        (setq bulge (getreal "\n输入bulge:"))
      )
    (progn
      (setq dis (distance p1 p2)
          v (mapcar
                '-
                p2
                p1
              )
          vx (xdrx_vector_normalize v)
          pmid (mapcar
                   '+
                   p1
                   (xdrx_vector_product vx (/ dis 2.0))
               )
          vy (xdrx_vector_perpvector vx)
          h (* dis (/ (abs bulge) 2))
      )
      (if (> bulge 0.0)
        (setq vy (xdrx_vector_negate vy))
      )
      (setq pmid (mapcar
                   '+
                   pmid
                   (xdrx_vector_product vy h)
               )
      )
      (setq garc (xdge::constructor "kCircArc3d" p1 pmid p2)
          cen (xdge::getpropertyvalue garc "center")
          line1 (xdge::constructor "kLineSeg3d" cen p1)
          line2 (xdge::constructor "kLineSeg3d" p2 cen)
          poly (xdge::constructor "kCompositeCrv3d" (list line2 line1 garc))
      )
      (xdge::entity:make poly)
      (xdrx_setpropertyvalue (entlast) "color" (xdrx_math_rand 255))
      (xdge::free)
    )
)
(princ)
)

liuzpzp007 发表于 2017-2-6 10:42:21

谢谢楼主分享
页: [1] 2 3
查看完整版本: 已知一段弧的起点和终点以及其凸度,求其圆心