马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
- ;;;根据新y值形成新的偏移点表,新点均在基点右侧 by PEACE 2013/06/28
- ;;;plst=原始点表 vy=y坐标 ang=角度(弧度)
- (defun PEACE:PointList_OffsetPointYR(plst vy ang / n newplst i p newp x0 y0)
- (setq n (length plst)
- newplst '()
- i 0
- )
- (repeat n
- (setq p (nth i plst)
- x0 (car p)
- y0 (cadr p)
- )
- (if (> x0 (+ x0 (* (- vy y0) (/ (cos ang) (sin ang)))))
- (setq ang (- pi ang))
- )
- (setq x (+ x0 (* (- vy y0) (/ (cos ang) (sin ang))))
- newp (list x vy)
- newplst (cons newp newplst)
- i (1+ i)
- )
- )
- (setq newplst (reverse newplst))
- newplst
- )
- ;;;根据新y值形成新的偏移点表,新点均在基点左侧 by PEACE 2013/06/28
- ;;;plst=原始点表 vy=y坐标 ang=角度(弧度)
- (defun PEACE:PointList_OffsetPointYL(plst vy ang / n newplst i p newp x0 y0)
- (setq n (length plst)
- newplst '()
- i 0
- )
- (repeat n
- (setq p (nth i plst)
- x0 (car p)
- y0 (cadr p)
- )
- (if (< x0 (+ x0 (* (- vy y0) (/ (cos ang) (sin ang)))))
- (setq ang (- pi ang))
- )
- (setq x (+ x0 (* (- vy y0) (/ (cos ang) (sin ang))))
- newp (list x vy)
- newplst (cons newp newplst)
- i (1+ i)
- )
- )
- (setq newplst (reverse newplst))
- newplst
- )
|