|
发表于 2022-7-5 18:53:52
|
显示全部楼层
This looked like an interesting program to write - please try the following (adjust the settings at the top to suit):
[code];;----------------------=={ Isometric Triangle }==----------------------;;;; ;;;; Prompts the user to pick two points at a non-isometric angle and ;;;; proceeds to construct a hatched isometric right-angled triangle, ;;;; offset from the two given points by a distance specified in the ;;;; code. ;;;;----------------------------------------------------------------------;;;; Author: Lee Mac, Copyright © 2015 - www.lee-mac.com ;;;;----------------------------------------------------------------------;;;; Version 1.0 - 2015-10-06 ;;;; ;;;; - First release. ;;;;----------------------------------------------------------------------;;;; Version 1.1 - 2015-10-10 ;;;; ;;;; - Removed restriction on non-isometric angles (e.g. 60 deg). ;;;;----------------------------------------------------------------------;;(defun c:isotri ( / an1 an2 div err hat hpa off pat pi6 ply pt1 pt2 scl spc vt1 vt2 vt3 ) (setq off 1.0 ;; Triangle offset pat "ANSI31" ;; Hatch pattern name hpa (/ pi 4.0) ;; Hatch angle scl 0.1 ;; Hatch scale ) (cond ( (not (and (setq pt1 (getpoint "\nPick 1st point: ")) (setq pt2 (getpoint "\nPick 2nd point: " pt1)) ) ) ) ( (progn (defun div ( x m / r ) (setq r (rem x m)) (or (equal 0.0 r 1e-6) (equal m r 1e-6)) ) (setq an1 (angle pt1 pt2) pi6 (/ pi 6.0) ) (and (div an1 pi6) (not (div an1 (+ pi6 pi6)))) ) (princ "\nCannot generate triangle for isometric angle.") ) ( (or ( |
|