马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
本帖最后由 Lispboy 于 2013-9-1 14:21 编辑
 - ;|
- 判断给定顶点索引前后直线段是否同该段都垂直
- 参数:
- e --- POLY实体
- index-顶点索引
- 返回值:
- 如果垂直,返回各段的单位方向向量(沿着POLYLINE的方向)
- 否返回NIL
- |;
- (defun XD::Polyline:IsPerpAt-Seg+ (e index / indexs n_index p_index segtype0 segtype1 segtype2 v vl x)
- (setq indexs (XD::PolyLine:-Index+ e index)
- n_index (last indexs)
- p_index (car indexs)
- segType1 (xdrx_polyline_segType e index)
- segType0 (xdrx_polyline_segType e p_index)
- segType2 (xdrx_polyline_segType e n_index)
- )
- (if (and
- (= "kLine" segType0)
- (= "kLine" segType1)
- (= "kLine" segType2)
- )
- (progn
- (setq v (mapcar
- '(lambda (x)
- (apply
- 'mapcar
- (cons '- x)
- )
- )
- (mapcar
- '(lambda (x)
- (xdrx_polyline_getLineSegAt e x)
- )
- (list p_index index n_index)
- )
- )
- )
- (if (and
- (xdrx_vector_IsPerpendicular (car v) (cadr v))
- (xdrx_vector_IsPerpendicular (cadr v) (caddr v))
- )
- (setq vl (mapcar
- '(lambda (x)
- (trans (xdrx_vector_normalize x) 1 0 1)
- )
- v
- )
- )
- )
- )
- )
- vl
- )
|