注册 登录
明经CAD社区 返回首页

13648893846的个人空间 http://www.mjtd.com/?7322544 [收藏] [复制] [分享] [RSS]

日志

三点生成与之相切圆弧并标注参数

热度 1已有 342 次阅读2018-8-6 22:53 |系统分类:应用

;;[功能]三点生成与之相切圆弧并标注参数
;;[用法](LC:3pt-MAKARC-Label (getpoint "\n 请输入第一点") (getpoint "\n 请输入顶点") (getpoint "\n 请输入第三点")  (getreal "\n 请输入半径: "))
;;;(LC:3pt-MAKARC-Label (getpoint "\n 请输入第一点") (getpoint "\n 请输入顶点") (getpoint "\n 请输入第三点")  55.7909 )
;;[作者]BY 老仓测绘上班记
(defun LC:3pt-MAKARC-Label (p1 p2 p3 R / p1 p2 p3 R jiajiao CIRCLE-mid-ang T1 arcpt1  arcpt2 CIRCLEpt a
         arcBulge e arcmid arcptang1 arcptang2 arcang gonggao pt5)
;;;  (setq ptlst '() ANGlst '())
  (setq jiajiao (LC-3PT-Angle p1 p2 p3));多段线三点夹角
  (if (> jiajiao 0)
    (progn
      (setq CIRCLE-mid-ang (/ jiajiao 2))
      (setq T1 (abs (/ R (LC-tan CIRCLE-mid-ang))));切线
      (setq arcpt1 (polar p2 (angle p2 p1) T1));圆弧起点
      (setq arcpt2 (polar p2 (angle p2 p3) T1));圆弧终点
      (setq CIRCLEpt (polar arcpt1 (- (angle p1 arcpt1) (/ pi 2)) r));圆心坐标
      (setq a (- jiajiao pi))   ;转角
  )
    (progn
      (setq CIRCLE-mid-ang (/ jiajiao 2));夹角角平分线
      (setq T1 (abs (/ R (LC-tan CIRCLE-mid-ang))));切线
      (setq arcpt1 (polar p2 (angle p2 p1) T1));圆弧起点
      (setq arcpt2 (polar p2 (angle p2 p3) T1));圆弧终点
      (setq CIRCLEpt (polar arcpt1 (+ (angle p1 arcpt1) (/ pi 2)) r));圆心坐标
      (setq a (+ jiajiao pi))
    )
  )
  (setq e (- (distance p2 CIRCLEpt) R));外距
  (setq gonggao (- (distance p2 CIRCLEpt) (sqrt(- (* R R) (* (/ (distance arcpt1 arcpt2) 2) (/ (distance arcpt1 arcpt2) 2)))) e));弓高
  (setq arcmid (polar p2 (angle p2 CIRCLEpt) e));圆弧中点
  (setq arcptang1 (angle CIRCLEpt arcpt1));起点角度
  (setq arcptang2 (angle CIRCLEpt arcpt2));终点角度
  (setq arcang (LC-3PT-Angle arcpt1 CIRCLEpt arcpt2));圆心角
  (if (> jiajiao 0)
    (setq arcBulge (-(/ (* gonggao 2) (distance arcpt1 arcpt2))));凸度
    (setq arcBulge (/ (* gonggao 2) (distance arcpt1 arcpt2)));凸度
    )
  (setq ARCDIST (abs(* arcang r)));弧长
  (setq a (atof(LC:radian-angle a)))
  (LC:make-arcpline arcpt1 arcpt2 arcBulge);生成带凸度多段线
  (LC-MAK-QXBZ-TEXT (setq pt5 (getpoint "\n 请输入标注点: ")) A r T1 ARCDIST E)
)




路过

雷人

握手
1

鲜花

鸡蛋

刚表态过的朋友 (1 人)

评论 (0 个评论)

facelist doodle 涂鸦板

您需要登录后才可以评论 登录 | 注册

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号  
©2000-2017 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2018-12-11 04:38 , Processed in 0.129397 second(s), 18 queries , Gzip On.

Powered by Discuz! X3.3

© 2001-2013 Comsenz Inc.

返回顶部