question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Converting Point cloud to Mesh

See original GitHub issue

Hello, I’m trying to do the following: I have main mesh (obj, off) trying to make some affine transformation on it, badly I had to use other source code to do this, I wasn’t able to reach exactly how to use transformations using vtkplotter, so the point now, after applying the transformation I have points and I set them in .ply file

from vtkplotter import *
pcl = load("/home/roaa/Desktop/PhD/Models/OwnDatabase/cat_noise_0.0001.ply")
print("Number of vertices:",len(pcl.points()))
mesh = delaunay2D(pcl.points())
mesh.write("/home/roaa/Desktop/PhD/Models/OwnDatabase/cat_noise_0.0002.off")
mesh1 = recoSurface(pcl.points())
mesh1.write("/home/roaa/Desktop/PhD/Models/OwnDatabase/cat_noise_0.0003.obj")
print("Number of vertices: ",len(mesh1.points()))
print("Number of faces:",len(mesh1.faces()))

and this what I got:

Number of vertices: 352
 Unknown format /home/roaa/Desktop/PhD/Models/OwnDatabase/cat_noise_0.0002.off file not saved. 
Recalculating normals for 352 Points, sample size= 7
Calculating mesh from points with R = 5.278604972180709
Number of vertices:  248764
Number of faces: 147165

It’s so weird to have a number of vertices and faces, especially that I don’t want to perform anything other than getting the mesh after applying transformation on it. What I may be doing false.

Thank you for your support.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
marcomusycommented, Sep 19, 2021

I don’t think that vtk can do that , you may try something similar with glyphs

from vedo import *

msh = Mesh(dataurl+"bunny.obj").computeNormals().wireframe()

cpts = msh.cellCenters()
shape = Circle(r=0.001, res=24).rotateY(90)
gl = Glyph(cpts, shape,  orientationArray=msh.celldata["Normals"])
gl.c("blue3")#.lighting('off')

show(gl, axes=1)
Screenshot 2021-09-19 at 14 37 02

but will probably become slow for large meshes.

1reaction
marcomusycommented, Sep 18, 2021

Hi, sorry I forgot I disabled settings.renderPointsAsSpheres = False. Try instead:

from vedo import *

msh = Mesh(dataurl + "teapot.vtk").pointSize(10).renderPointsAsSpheres(False)

show(msh, axes=1)

Screenshot from 2021-09-18 14-48-54

Read more comments on GitHub >

github_iconTop Results From Across the Web

MeshLab: Point Cloud to Mesh – Design Support
This is free, open source software available from www.meshlab.net · MeshLab does have the function to convert a point cloud into a mesh...
Read more >
PointFuse: Convert point cloud to Mesh, 3D Model
PointFuse software automatically converts point cloud data into 3D models and mesh that help optimise a variety of industries.
Read more >
Generate 3D meshes from point clouds with Python
For getting a 3D mesh automatically out of a point cloud, we will add another library to our environment, Open3D. It is an...
Read more >
Point Cloud to Mesh | FabAcademy - Tutorials
"MeshLab is an opensource, portable, and extensible system for the processing and editing of unconstructed 3D triangular meshes."This tutorial shows the ...
Read more >
Workflows for converting large Point Cloud objects into ...
To convert Point Cloud objects into meshes: · Particle meshing software FROST. Generate a single mesh from particles, vertex clouds, object ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found