当前位置:网站首页>Three. Based on ply format point cloud voxel model JS upload interface writing
Three. Based on ply format point cloud voxel model JS upload interface writing
2022-04-23 20:21:00 【Install a sound 77】
I checked the relevant materials and found the content of voxels , May be studied more thoroughly , The relevant documents are too few to find .
With a point cloud PLY File as an example ,ply You can save some clouds and his patches , It can also be used to preserve voxels .
But in three.js in Although it comes with one PLYloader As shown in the figure below :

But this PLYloader Load only Faceted ply file , For voxelized ply The file can read relevant information , But it can't be displayed in the browser . The reason is that voxels ply And dough ply The data form of is a little different .
Let's open two different ply File comparison ( Be careful ,ply The document needs to be binary Binary to ascii Format , Otherwise, it can't be used txt open )

On the left is voxelized ply file , Relatively normal in the back Ply A few parameters are missing, and the connection information of the patch is useless .( Open this and see for yourself )
Point out Voxel model focuses on that 6 In figures The first three digits represent XYZ, The last three digits represent 255 Of RGB.
Now there are coordinates and colors In fact, voxels can be generated , Of course, we need to generate in the browser .
const file_loader = new THREE.FileLoader();
file_loader.load("LOOK.ply",function (data){
ply_data.file_data =data
ply_data.point_list = ply_data.file_data.split('end_header\n')[1].split("\n")
//console.log(ply_data.point_list)
let positons = []
let colors= []
let num;
num = ply_data.point_list[1]
// in the light of ply_data.point_list Data cleansing
ply_data.point_list.length -= 1;
// Delete two items
ply_data.point_list.shift();
ply_data.point_list.shift();
for (let point_str of ply_data.point_list){
//console.log(point_str)
let str_list = point_str.split(" ")
positons.push(str_list[0],str_list[1],str_list[2])
colors.push(str_list[3]/255,str_list[4]/255,str_list[5]/255)
// Make a rectangle
var material2 = new THREE.MeshBasicMaterial( );
var cubeGeometry2 = new THREE.BoxGeometry(1,1,1);
var cube =new THREE.Mesh(cubeGeometry2, material2)
cube.position.x =str_list[0]
cube.position.y =str_list[1]
cube.position.z =str_list[2]
cube.material.color.r=str_list[3]/255
cube.material.color.g=str_list[4]/255
cube.material.color.b=str_list[5]/255
scene.add(cube)
}
So with three.js Write an interface , The principle is right txt File segmentation , Find the content of each paragraph , The rectangle is generated by itself , I used it here mesh Generate , Can't find setAttribute This method of , I think PCDloader This method is used to load point clouds in batch , But in the mesh I didn't find it in the cube ... So loop generated , It should affect the speed of loading .
The result of the last load :

Disadvantages of voxel model , Because the browser load is too stretched , Without optimization Can't generate too many small squares ( Optimization estimation is also important ), Otherwise, it's easy to get stuck , This is also three.js The reason why voxels are not used very much in .
版权声明
本文为[Install a sound 77]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204210551491079.html
边栏推荐
- R language ggplot2 visual facet_wrap, and use the lineheight parameter to customize the height of the facet icon tab (gray label bar)
- Notes of Tang Shu's grammar class in postgraduate entrance examination English
- Computing the intersection of two planes in PCL point cloud processing (51)
- Intersection calculation of straight line and plane in PCL point cloud processing (53)
- Azkaban recompile, solve: could not connect to SMTP host: SMTP 163.com, port: 465 [January 10, 2022]
- Introduction to link database function of cadence OrCAD capture CIS replacement components, graphic tutorial and video demonstration
- star
- NC basic usage 3
- 【PTA】L2-011 玩转二叉树
- BMP JPEG 图片转换为矢量图像 ContourTrace
猜你喜欢

selenium. common. exceptions. WebDriverException: Message: ‘chromedriver‘ executable needs to be in PAT

A useless confession artifact

堡垒机、跳板机JumpServer的搭建,以及使用,图文详细

SQL Server Connectors By Thread Pool | DTSQLServerTP plugin instructions

Operation of numpy array
![[latex] 5 how to quickly write out the latex formula corresponding to the formula](/img/1f/3c5a332ce1d6852dde38040faea5bf.png)
[latex] 5 how to quickly write out the latex formula corresponding to the formula

16MySQL之DCL 中 COMMIT和ROllBACK

DTMF dual tone multi frequency signal simulation demonstration system
Handwritten Google's first generation distributed computing framework MapReduce

WordPress plug-in: WP CHINA Yes solution to slow domestic access to the official website
随机推荐
nc基础用法1
Confusion about thread blocking after calling the read () method of wrapper flow
The market share of the financial industry exceeds 50%, and zdns has built a solid foundation for the financial technology network
Building the tide, building the foundation and winning the future -- the successful holding of zdns Partner Conference
Alicloud: could not connect to SMTP host: SMTP 163.com, port: 25
DNS cloud school rising posture! Three advanced uses of authoritative DNS
論文寫作 19: 會議論文與期刊論文的區別
SQL Server Connectors By Thread Pool | DTSQLServerTP plugin instructions
Mysql database backup scheme
Development of Matlab GUI bridge auxiliary Designer (functional introduction)
波场DAO新物种下场,USDD如何破局稳定币市场?
SIGIR'22「微软」CTR估计:利用上下文信息促进特征表征学习
[problem solving] 'ASCII' codec can't encode characters in position XX XX: ordinal not in range (128)
【PTA】整除光棍
ArcGIS JS version military landmark drawing (dovetail arrow, pincer arrow, assembly area) fan and other custom graphics
Intersection calculation of straight line and plane in PCL point cloud processing (53)
STM32 Basics
Matlab analytic hierarchy process to quickly calculate the weight
R语言使用caret包的preProcess函数进行数据预处理:对所有的数据列进行BoxCox变换处理(将非正态分布数据列转换为正态分布数据、不可以处理负数)、设置method参数为BoxCox
nc基础用法3