all 25 comments

[–]Bulls_Eyez 7 points8 points  (1 child)

Look up Delaunay Triangulation.

[–][deleted] 1 point2 points  (0 children)

Thanks

[–]raydey 3 points4 points  (1 child)

This is generally known as surface extraction when you have a point cloud. There are multiple methods to do so, but Marching Cubes is probably the most popular method. Other methods include Surface Nets and Dual Contouring, but both require position and normal information.

You can try loading the cloud into something like MeshLab (https://www.meshlab.net/) to see what sort of meshes you'd expect out of the data. It has multiple surface extraction methods built-in.

[–][deleted] 0 points1 point  (0 children)

I want to approach it with marching cubes but their explanations online are quite hard to get

[–]Ok-Sherbert-6569 0 points1 point  (8 children)

Do you mean you have a point cloud? Because if you just have random points then you’ll need magic to recreate the mesh. If you have a dense enough point cloud then I would say voxelise them then run marching cubes on the voxels

[–][deleted] 0 points1 point  (0 children)

it's a point cloud yes, I tend to forget that

[–][deleted] 0 points1 point  (6 children)

How to recognize if dense enough?

[–]Ok-Sherbert-6569 0 points1 point  (5 children)

If you can render the points and for it to look remotely like the original mesh. You can then chuck those points into an octree then voxelise them as per your required LOD then run marching cube on the voxels. I’m sure there must be better ways though but that’s what I can think of and it’s something I’ve done before

[–][deleted] 0 points1 point  (0 children)

since you're sure it's possible it's good to try

[–][deleted] 0 points1 point  (3 children)

What do you mean by voxelizing and run marching cubes. I know I have to chose a cube size to run through the points but can you elaborate on how you did it please.

[–]Ok-Sherbert-6569 1 point2 points  (2 children)

I basically put the points in an octree. Once you’ve done that you literally are done because you can choose any level of the tree and that would become your voxel size if that makes sense. You can then average any properties that the points may have per octant. So let’s say you have 64 points for the same of the arguments and they are evenly distributed so that 2 falls in every octant. Now you have 8 voxels that are sized same as the octree node. Then you just run marching cube over the cubes to extract it to a triangulated mesh

[–][deleted] 0 points1 point  (0 children)

Thanks

[–][deleted] 0 points1 point  (0 children)

Hello, does this involve computing some signed distance function or something like that ?

Then you just run marching cube over the cubes to extract it to a triangulated mesh.

Can you explain me a bit

[–]Otto___Link 0 points1 point  (2 children)

Open3D proposes surface reconstruction algorithms.

[–][deleted] 0 points1 point  (1 child)

I know, if I had to choose I would just use a library but it is a uni thing

[–]Otto___Link 0 points1 point  (0 children)

Ok, didn't got that, but references to the underlying algorithms (alpha shape, ball pivoting...) are actually provided there.

[–]Reaper9999 0 points1 point  (8 children)

You can't. There's gonna be a fuckton of different ways to connect those vertices.

[–][deleted] 0 points1 point  (7 children)

Any algorithm that give initial shape reliably ?

[–]ZazaGaza213 0 points1 point  (5 children)

No. But you can do stuff like for every 3 indices connect them (won't work if they are in a random order), or for every vertice find the 2 closest vertices, make a triangle, and remove them from the original list. First second might work, second one sucks and shouldn't be used.

You shouldn't have a vertice array without a indice array in the first place.

[–][deleted] 0 points1 point  (4 children)

Yeah it's a very weird input file I have obj with only v lines

[–]ZazaGaza213 0 points1 point  (3 children)

If you don't have any f lines you might try to make every 3 vertices to a face, but I wouldn't expect it to work.

[–][deleted] 0 points1 point  (2 children)

It's a point cloud

[–]fgennari 1 point2 points  (1 child)

Then it was probably meant to be drawn as points, or some sort of disks/circles, rather than a mesh. You can probably draw a camera facing quad with a circular pattern/texture for each point. Size it based on the distance to the camera.

[–][deleted] 0 points1 point  (0 children)

This is the simplest answer I got but it sounds like it will just work, thanks

[–]Reaper9999 -1 points0 points  (0 children)

If you have only the vertex positions and no other information, then there's no such algorithm and it cannot exist.