paulguerrero / pcpnet

Pytorch implementation of PCPNet
Other
171 stars 42 forks source link

Can I generate point cloud and normals from stl file? #8

Closed DeanLee18 closed 2 years ago

DeanLee18 commented 4 years ago

I'm trying to generate point cloud data from mesh such as .stl file, but I failed to create the groundtrue normals of sampled points. Is there any way to generate point cloud and normals from stl file using 3D tools like MeshLab? Thanks.

paulguerrero commented 4 years ago

Yes, in MeshLab you can do Poisson disk sampling, for example (Filters > Sampling > Poisson-disk Sampling), which also generates normals for the points.

DeanLee18 commented 4 years ago

Thanks! May I ask for some advice on how to sample point cloud non-uniformly, just as you show in the paper PCPNet?

paulguerrero commented 4 years ago

This is probably not available in editor like MeshLab. One way to do this is to first make sure that your mesh only has small triangles (remesh it if necessary), and when placing point samples, pick triangles with a probability proportional to their normalized (area * density the points should have on the triangle). For example, if there should be a density gradient from top to bottom, triangles on top should have a higher probability of being picked. Inside the triangle, you can sample uniformly. This should be a good enough approximation if the triangles are small enough.

pratulyab commented 4 years ago

@paulguerrero can you share the original 3D shapes and figurines from which the point clouds were sampled? Also did you use triangular meshes?

paulguerrero commented 4 years ago

Here is a link to the original 3D meshes: https://drive.google.com/file/d/14UncfzTN2FgZB_A5NMkAF6aOv_JKDGoR/view?usp=sharing