• 这是一个错误的程序


    (defun c:dp (/ os dist e pt1 pt2 pt3 a)
        (command "cmdecho" 0)   
        (setq lwe (getvar "useril"))
        (if    (= lwe 0)
        (progn
            (initget (+ 2 4))
            (setq lwe (getint "出图比例[1:?]:"))
            (if    (= lwe nil)
            (setq lwe 100)
            )
            (setvar "useril" lwe)
        )
        )
        (setq lwe (/ lwe 2))
        (command "pline" '(0 0) "w" lwe lwe "")
        (setvar "osmode" 695)
        (setq pt (getpoint "\n起点:"))
        (if    (= pt nil)
        (prompt "\空格与或回车结束!")
        )
        (initget (+ 2 4))
        (setq dist (getdist pt "\n宽度<240>:"))
        (if    (= dist nil)
        (setq dist 240)
        )
        (setq dist (/ dist 2.0))
        (if (= pt nil) (prompt "\ndddddddd"))
        (setq po (getpoint pt "\n下一点:"))
        (setq ang (angle pt po))
        (setq pt1 (polar pt (+ ang (/ pi 2)) dist))
        (setq pt2 (polar pt (- ang (/ pi 2)) dist))
        (setq po1 (polar po (+ ang (/ pi 2)) dist))
        (setq po2 (polar po (- ang (/ pi 2)) dist))
        (setvar "osmode" 0)
        (command "pline" pt1 po1 "" "pline" pt2 po2 "")
        (setq e 1)
        (while e
        (setvar "osmode" 695)
        (setq pb (getpoint po "\n下一点:"))
        (if (= pb nil)
            (exit)
        )
        (setq ang1 (angle po pb))
        (setq pn1 (polar po (+ ang1 (/ pi 2)) dist))
        (setq pn2 (polar po (- ang1 (/ pi 2)) dist))
        (setq pb1 (polar pb (+ ang1 (/ pi 2)) dist))
        (setq pb2 (polar pb (- ang1 (/ pi 2)) dist))
        (setq pe1 (inters pt1 po1 pn1 pb1 nil))
        (setq pe2 (inters pt2 po2 pn2 pb2 nil))
        (setq ent (ssget po1))
        (command "erase" ent "")
        (setvar "osmode" 0)
        (command "pline" pt1 pe1 "" "pline" pt2 pe2 "")
        (command "pline" pe1 pb1 "" "pline" pe2 pb2 "")
        (setq po  pb
              pt1 pe1
              pt2
              pe2
              po1
              pb1
              po2
              pb2
        )
        )
        (command "cmdecho" 1)
    )

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


  • 相关阅读:
    hdu4722Good Numbers(dp)
    poj3373Changing Digits(dp)
    URAL1244. Gentlemen(背包)
    URAL1658. Sum of Digits(DP)
    URAL1635. Mnemonics and Palindromes(DP)
    URAL(DP集)
    URAL1036. Lucky Tickets
    关于int类型的赋值语句正确的有
    float、double的有效位数
    浮点型常量又称实型常量,用于表示有小数部分的十进制数,他有两种表示形式,分别为:
  • 原文地址:https://www.cnblogs.com/bimgoo/p/2503163.html
Copyright © 2020-2023  润新知