贴子标题/内容
看了几十篇论文,实现了个专业算法,用threejs做了个三维人员定位系统示例(已开源)
<h2><span style="font-size: 15px;"><strong>需求</strong></span></h2><p><span style="font-size: 15px;"> &nbsp;“threejs中能不能给定几组三维坐标(或者CAD绘制的三维多段线),给一个断面形状,直接生成三维管道?”</span></p><p><span style="font-size: 15px;">例如原始CAD图如下:</span></p><p><img src="https://pica.zhimg.com/v2-60d5fd51c949276c06c33153361d1c98_1440w.jpg" alt="" data-href="" style="width: 100%;"/></p><p><br></p><p><span style="font-size: 15px;">要求用threejs获取线的三维坐标数据自动生成的三维管道效果图如下:</span></p><p><img src="https://pic4.zhimg.com/v2-a2dcd59ee5ff783ee0fbe97a0c5bbc17_1440w.jpg" alt="" data-href="" style="width: 100%;"/></p><p><br></p><p><br></p><h2><span style="font-size: 15px;"><strong>分析</strong></span></h2><p><span style="font-size: 15px;">如果直接对每条线用</span><span style="font-size: 15px;"><code>threejs</code></span><span style="font-size: 15px;">中的 </span><span style="font-size: 15px;"><code>THREE.TubeGeometry</code></span><span style="font-size: 15px;"> 去绘制的话,会出现交岔口出现缝隙的情况,如下图所示:</span></p><p><img src="https://pic3.zhimg.com/v2-b301992058e9714e708bff7a0820397a_1440w.jpg" alt="" data-href="" style="width: 100%;"/></p><p><br></p><p><span style="font-size: 15px;">如何解决交岔口出现缝隙的问题成为了难题。</span></p><p><span style="font-size: 15px;">上网一搜索,发现与之类似的问题,在能源行业,“矿井巷道三维自动建模“这个很热门的话题,很多硕士博士都在研究。</span></p><p><span style="font-size: 15px;">于是果断的在淘宝花了几块大洋买了90天下载文献的账号,开始了下载论文,拜读论文,研究算法的苦逼过程 ...</span></p><p><img src="https://pic4.zhimg.com/v2-6004323f77824a8fb1c4bfc0e58e9037_1440w.jpg" alt="" data-href="" style=""/></p><p><br></p><p><span style="font-size: 15px;">研究了很多天后,很少有论文能把整个算法流程说的很透彻,都是说个大概原理,细节自己去琢磨吧。。。</span></p><p><span style="font-size: 15px;">直到偶然间发现一本专业书 &lt;&lt;矿山巷道三维网络模型构建及空间网络分析技术&gt;&gt;</span></p><p><img src="https://pic2.zhimg.com/v2-2895872ae0f99c51a62d7364a8e6ec4d_1440w.jpg" alt="" data-href="" style="width: 100%;"/></p><p><br></p><p><img src="https://pica.zhimg.com/v2-94655bbfc9dfccac11d695f565455f12_1440w.jpg" alt="" data-href="" style=""/></p><p><br></p><p><span style="font-size: 15px;">看了后很有启发,用”半巷道模型“进行处理交叉口,对一些细节进行优化后,终于达到了比较满意的结果。</span></p><p><img src="https://picx.zhimg.com/v2-dd2d6ca59d12a551d974ad1cc9c90065_1440w.jpg" alt="" data-href="" style=""/></p><p><br></p><p><span style="font-size: 15px;">在线效果地址 </span><a href="https://link.zhihu.com/?target=https%3A//vjmap.com/map3d/demo/%23/demo/map/builtin/objects/03builtinobjtubepathauto" target="_blank"><span style="font-size: 15px;">https://vjmap.com/map3d/demo/#/demo/map/builtin/objects/03builtinobjtubepathauto</span></a></p><p><br></p><h2><span style="font-size: 15px;"><strong>三维人员定位系统(示例已开源)</strong></span></h2><p><span style="font-size: 15px;">解决了上面的难题后,基于三维巷道可以做很多应用开发,比如“三维人员定位系统”</span></p><p><span style="font-size: 15px;">实现的功能有:</span></p><ul><li><span style="font-size: 15px;">解析CAD图中的三维多段线对象,获取三维线的坐标 (CAD图来源于 </span><a href="https://link.zhihu.com/?target=https%3A//vjmap.com/app/cloud/%23/map/sys_tube%3Fversion%3Dv1%26mapopenway%3DGeomRender%26vector%3Dfalse" target="_blank"><span style="font-size: 15px;">https://vjmap.com/app/cloud/#/map/sys_tube?version=v1&amp;mapopenway=GeomRender&amp;vector=false</span></a></li><li><span style="font-size: 15px;">根据三维线坐标自动建立拓扑关系。(因为绘制的时候是一整条绘制的,需要处理成按节点进行关系分析来处理交叉口)</span></li><li><span style="font-size: 15px;">根据数据自动生成三维巷道和处理交叉口</span></li><li><span style="font-size: 15px;">模拟人员移动数据,在三维图上实时展示人员位置 </span></li><li><span style="font-size: 15px;">点击人员可查看详细</span></li><li><span style="font-size: 15px;">可查看人员历史轨迹</span></li><li><span style="font-size: 15px;">可根据一个坐标自动查找最近的出口</span></li></ul><p><span style="font-size: 15px;">实现效果如下:</span></p><p><img src="https://pic2.zhimg.com/v2-342a025719ec54e45f405645b25305cb_1440w.jpg" alt="" data-href="" style="width: 100%;"/></p><p><br></p><p><img src="https://pic2.zhimg.com/v2-e6e3883d7028e8ca2675d4207635cad3_1440w.jpg" alt="" data-href="" style=""/></p><p><br></p><p><img src="https://pic4.zhimg.com/v2-58a5c700e1d2ce99ee4c2e442e3106ef_1440w.jpg" alt="" data-href="" style=""/></p><p><br></p><p><span style="font-size: 15px;">此示例代码已开源,可访问 </span><a href="https://link.zhihu.com/?target=https%3A//vjmap.com/effect/person/" target="_blank"><span style="font-size: 15px;">https://vjmap.com/effect/person/</span></a><span style="font-size: 15px;"> 在线查看。</span></p><p><span style="font-size: 15px;">更多示例可查看 </span><a href="https://link.zhihu.com/?target=https%3A//vjmap.com/map3d/example.html" target="_blank"><span style="font-size: 15px;">https://vjmap.com/map3d/example</span></a></p><p><br></p>