- Home /
Point cloud data to mesh
Is it possible to generate a script in Unity that will construct a meshed object from imported point cloud data?
Thank you in advance!
Answer by guubebra · Oct 21, 2021 at 09:40 PM
Yes! If you want to create a mesh out of the point cloud just read the point cloud data and store the coordinates of each point in an array. That way you can create the mesh runtime by passing the vertices to unity: https://docs.unity3d.com/ScriptReference/Mesh.html. You can use MeshTopology to change the rendering to point, and then create a geometry shader to better visualize each point (by placing a triangle in each vertex for example, https://answers.unity.com/questions/1437520/implementing-a-geometry-shader-for-a-pointcloud.html this might help).
But if you want to reconstruct the content in the point cloud by making actual planes and connected triangles, you need to search some techniques like marching cubes if I'm not mistaken, this might help https://youtu.be/M3iI2l0ltbE.
My apologies for the delay in responding - @guubebra this helped a lot and worked!
Answer by J_Stuck · Nov 12, 2021 at 04:12 PM
Thank you for your reply - it helped massively!
I am now coming up against another problem: trying to store and imported data from two separate csv files (1 that holds the x, y, z, coordinates of a vertex, and the other that holds the information to construct triangles between each vertex) that will allow me to construct a 10 vertex tetrahedron. How would I go about doing this?
I am trying to import from two files that are of the following structure:
my current way of storing the two sets of data are:
// Read in Node and Element data
NodeList = CSVReader.Read(inputfile_Nodes);
ElementList = CSVReader.Read(inputfile_Elements);
// List for holding data from CSV reader
private List<Dictionary<string, object>> NodeList;
private List<Dictionary<string, object>> ElementList;
I have tried to combine the two dictionaries by trying to search for the corresponding 'Key' in the Node List that matches the corresponding 'Value' in the Element List. Any help would be greatly appreciated.
Your answer
Follow this Question
Related Questions
How does appdata_base work? 0 Answers
Reading mesh data without Unity making a copy 1 Answer
Reading all the Collsion-Data for specific physical interactions 3 Answers
Animation data for non mesh purposes 1 Answer
How does Unity import from Sketchup? 0 Answers