zoukankan      html  css  js  c++  java
  • AutoCAD矩形交叉口框短边切圆二

    AutoCAD矩形交叉口框短边切圆二,代码如下。

    (defun c:test()
      (setvar "cmdecho" 0)
      (setq pt1 (getpoint "\n第一角点:"))
      (setq pt3 (getcorner pt1 "\n另一角点:"))
      (setq pt2 (list (car pt3) (cadr pt1)))
      (setq pt4 (list (car pt1) (cadr pt3)))
      (command "rectang" pt1 pt3)
      (setq int (inters pt1 pt3 pt2 pt4))
      (setq ww (distance pt1 pt2))
      (setq hh (distance pt2 pt3))
      (setq cir1 (/ (min ww hh) 2))
      (setq pt5 (polar int (angle int pt1) cir1))
      (setq pt6 (polar int (angle int pt2) cir1))
      (setq pt7 (polar int (angle int pt3) cir1))
      (setq pt8 (polar int (angle int pt4) cir1))
      (command "arc" pt5 "e" pt6 "r" cir1)
      (command "arc" pt7 "e" pt6 "r" cir1)
      (command "arc" pt7 "e" pt8 "r" cir1)
      (command "arc" pt5 "e" pt8 "r" cir1)
      (command "line" pt5 pt7 "")
      (command "line" pt6 pt8 "")
      (prin1)
      )

    代码完。

    第一点只能在左下,第三点在右上,并且高度应该大于宽度,不让有BUG。

    作者:codee
    文章千古事,得失寸心知。


  • 相关阅读:
    盘子序列
    最大矩形面积
    【模板】ST表
    排队
    map循环遍历
    vue循环遍历给div添加id
    正则 匹配
    字符串拼接
    js对象追加到数组里
    二级标题左侧加粗线条
  • 原文地址:https://www.cnblogs.com/bimgoo/p/2502960.html
Copyright © 2011-2022 走看看