明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
楼主: 树櫴希德

利用GZXL程序:根据图面三角网查询任意点高程

  [复制链接]
发表于 2019-5-19 23:39 | 显示全部楼层
你好,提示(内插高程点; 错误: 除数为零),怎么处理啊?谢谢!!!
发表于 2019-10-30 00:40 | 显示全部楼层
今天一朋友说有这种方法加密,算法不同,各位按需研究

反距离加权插值方法研究   
https://wenku.baidu.com/view/ae6 ... l?qq-pf-to=pcqq.c2c
 楼主| 发表于 2023-5-26 15:53 | 显示全部楼层
73哥  另类(作图法)三角网内插高程点

  1. (defun PoInPl(pt lst / i p1 p2 an anl ret)
  2.     (setq i -1 p1 (last lst))
  3.     (while(and(not ret)(setq p2(nth(setq i(1+ i))lst)))
  4.       (cond((equal p2 pt 1e-6)(setq ret t))
  5.      (t(setq an(-(angle pt p1)(angle pt p2)))
  6.       (if(equal pi(abs an) 1e-6)
  7.         (setq ret t)
  8.         (setq anl(cons(rem an PI)anl)))))
  9.       (setq p1 p2))
  10.     (cond(ret 0);线上;
  11.    (t(if(equal PI(abs(apply'+ anl))1e-6)1 -1))))

  12. (defun xyofen(e / q p i)
  13.   (if(member(cdr(assoc 0(setq e(entget e))))'("LINE""TEXT""MTEXT""INSERT""SOLID"))
  14.     (vl-remove'nil(mapcar'(lambda(x)(cdr(assoc x e)))'(10 11 12 13 14)))
  15.     (progn(setq i -1 q(if(=(logand(cdr(assoc 70 e))1)1)0 1)e(cdr(assoc -1 e)))
  16.       (repeat(fix(+(vlax-curve-getEndParam e)q))
  17. (setq i(1+ i)q(vlax-curve-getPointAtParam e i)
  18.       p(if(or(equal(last p)q 1e-5)(equal(car p)q 1e-5))p(cons q p))))
  19.       (reverse p)
  20.     )))

  21. (defun c:tt(/ p e q q1 a);;另类(作图法)三角网内插高程点
  22.   (while(setq p(getpoint))
  23.     (if(and(setq e(ssget"F"(list'(-1e18 0)p)'((0 . "polyline")(100 . "AcDb3dPolyline"))))
  24.    (setq e(car(vl-remove-if'(lambda(x)(=(poinpl p(setq pl(xyofen(cadr x))))-1))(ssnamex e)))));;p点所在三角网图元e
  25.       (setq q(osnap(inters p(polar p(angle(mapcar'+(car pl)'(0 0))(cadr pl))(distance(mapcar'+(car pl)'(0 0))(cadr pl)))
  26.    (mapcar'+(cadr pl)'(0 0))(mapcar'+(last pl)'(0 0))nil)"nea");;过p作1,2点的平行线相交于2,3所在边q
  27.     q1(osnap(polar(cadr pl)(angle(cadr pl)(mapcar'+(car pl)'(0 0)))(distance(mapcar'+'(0 0)p)q))"nea");;在2 1边上截取pq长度于q1
  28.     a(entmakex(list'(0 . "text")(cons 10 p)(cons 1(rtos(+(last q)(last q1)(-(last(cadr pl))));q点高程加上2,q1高差
  29.        2 3))'(40 . 2)'(7 . "standard")))))))

发表于 2023-5-26 18:46 | 显示全部楼层
树櫴希德 发表于 2023-5-26 15:53
73哥  另类(作图法)三角网内插高程点

高程展点,对齐到中线,要是考虑到三角网,有何更好的思路?
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-4-25 19:20 , Processed in 0.350377 second(s), 17 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表