yjycad
发表于 2019-5-19 23:39:39
你好,提示(内插高程点; 错误: 除数为零),怎么处理啊?谢谢!!!
skg123
发表于 2019-10-30 00:40:08
今天一朋友说有这种方法加密,算法不同,各位按需研究
反距离加权插值方法研究
https://wenku.baidu.com/view/ae6a4a3131126edb6f1a1060.html?qq-pf-to=pcqq.c2c
树櫴希德
发表于 2023-5-26 15:53:54
73哥另类(作图法)三角网内插高程点
(defun PoInPl(pt lst / i p1 p2 an anl ret)
(setq i -1 p1 (last lst))
(while(and(not ret)(setq p2(nth(setq i(1+ i))lst)))
(cond((equal p2 pt 1e-6)(setq ret t))
(t(setq an(-(angle pt p1)(angle pt p2)))
(if(equal pi(abs an) 1e-6)
(setq ret t)
(setq anl(cons(rem an PI)anl)))))
(setq p1 p2))
(cond(ret 0);线上;
(t(if(equal PI(abs(apply'+ anl))1e-6)1 -1))))
(defun xyofen(e / q p i)
(if(member(cdr(assoc 0(setq e(entget e))))'("LINE""TEXT""MTEXT""INSERT""SOLID"))
(vl-remove'nil(mapcar'(lambda(x)(cdr(assoc x e)))'(10 11 12 13 14)))
(progn(setq i -1 q(if(=(logand(cdr(assoc 70 e))1)1)0 1)e(cdr(assoc -1 e)))
(repeat(fix(+(vlax-curve-getEndParam e)q))
(setq i(1+ i)q(vlax-curve-getPointAtParam e i)
p(if(or(equal(last p)q 1e-5)(equal(car p)q 1e-5))p(cons q p))))
(reverse p)
)))
(defun c:tt(/ p e q q1 a);;另类(作图法)三角网内插高程点
(while(setq p(getpoint))
(if(and(setq e(ssget"F"(list'(-1e18 0)p)'((0 . "polyline")(100 . "AcDb3dPolyline"))))
(setq e(car(vl-remove-if'(lambda(x)(=(poinpl p(setq pl(xyofen(cadr x))))-1))(ssnamex e)))));;p点所在三角网图元e
(setq q(osnap(inters p(polar p(angle(mapcar'+(car pl)'(0 0))(cadr pl))(distance(mapcar'+(car pl)'(0 0))(cadr pl)))
(mapcar'+(cadr pl)'(0 0))(mapcar'+(last pl)'(0 0))nil)"nea");;过p作1,2点的平行线相交于2,3所在边q
q1(osnap(polar(cadr pl)(angle(cadr pl)(mapcar'+(car pl)'(0 0)))(distance(mapcar'+'(0 0)p)q))"nea");;在2 1边上截取pq长度于q1
a(entmakex(list'(0 . "text")(cons 10 p)(cons 1(rtos(+(last q)(last q1)(-(last(cadr pl))));q点高程加上2,q1高差
2 3))'(40 . 2)'(7 . "standard")))))))
zxvy
发表于 2023-5-26 18:46:33
树櫴希德 发表于 2023-5-26 15:53
73哥另类(作图法)三角网内插高程点
高程展点,对齐到中线,要是考虑到三角网,有何更好的思路?