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.

Meshing on simple curve uniform plan using vedo

See original GitHub issue

Shared the ply file above. please can you see add some feature or can check what changes should be done to mesh for this kind of 3d objects. I tried but I am not getting an perfect mesh. as the plane is curve and uniform so please check it plyfile

from vedo import *

plt = Plotter(N=3, axes=dict(zxGrid=True, xyGrid=False))

vpts = load("/home/anveshak-nikhil/Only_codes_my/3march_generate_pc/23_march_bound.ply").clean()
# vpts = load("data/Final_sample_2.ply").clean()
vpts.ps(5).renderPointsAsSpheres().c('k3').alpha(0.6)

# this block removes the vertical lines
print("before", vpts.N())
newpts =[]
for p in vpts.points():
    cps = vpts.closestPoint(p, N=2)
    for cp in cps:
        if mag(cp-p)<0.00000001: # it's the same point p
            continue
        elif mag(cp-p)>0.00001:  # p is "isolated"
            newpts.append(p)
vpts = Points(newpts).clean()
print("after", vpts.N())

vpts_orig = vpts.clone() # make a copy
plt.show(vpts_orig, "original pcloud", at=0)

print("Nr of points before cleaning nr. points:", vpts.N())
vpts.clean(tol=0.0005)  # impose a min distance among points
print("after cleaning nr. points:", vpts.N())

print("smoothing cloud")
vpts.smoothMLS2D(f=0.15)  # smooth cloud by fitting planes recursively
plt.show(vpts, "cloud smoothed", at=1)

# reconstructed surface from point cloud
reco = recoSurface(vpts.points(), dims=[250,36,250], radius=0.002).extractLargestRegion().clean()
reco.subdivide().smoothLaplacian().fillHoles().computeNormals()
# reco.write("result.ply")

plt.show(reco, vpts, "reconstruction", at=2, zoom=1.2, interactive=True)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
ghostcommented, Mar 25, 2021

Thank you so much for your reply… it means me a lot… i apprecticate you…is there not any other solution for this for 3d model…

0reactions
marcomusycommented, Mar 25, 2021

you may play with tetrahedral meshes but it’s probably not a good solution anyway: (you won’t be able to close holes because the mesh is not manifold)

from vedo import *

plt = Plotter(N=2, axes=dict(zxGrid=True, xyGrid=False))

vpts = load("data/Sample_demo.ply").clean()
vpts.ps(5).c('k3').alpha(0.6)
vpts_orig = vpts.clone() # make a copy

print("Nr of points before cleaning nr. points:", vpts.N())
vpts.clean(tol=0.0005)  # impose a min distance among points
print("after cleaning nr. points:", vpts.N())

# reconstructed surface from point cloud
dela = delaunay3D(vpts, alphaPar=0.0014) # tetrahedral mesh
dela = geometry(dela.inputdata()) # outer Mesh

plt.show(vpts_orig, "original pcloud", at=0)
plt.show(vpts, dela, "reconstruction", at=1, zoom=1.2, interactive=1)

Screenshot from 2021-03-25 02-18-54

Read more comments on GitHub >

github_iconTop Results From Across the Web

ANSYS Student: Meshing Best Practices for Students - YouTube
This video shows the best practices for creating different types of mesh.
Read more >
Combined Composite Curves and Combined Boundary ...
View our in-depth overview of all the tools in the Femap Meshing Toolbox: https://structures.aero/ meshing -toolbox-femap/Combined / Composite ...
Read more >
How to create a Structured (Face) Mesh, Part 2 - Wedge
PART 2 of this video covers a wedge. ... ANSYS CFD Meshing Basics: How to create a Structured (Face) Mesh, Part 2 -...
Read more >
Curvature Based Mesh Advantages in SolidWorks Simulation
The Standard mesh does a great job of creating a uniform and reliable mesh. SolidWorks Simulation Mesh Studies. During the Standard meshing ......
Read more >
5 Tools to Reduce Time Between Your CAD Model and FE ...
If you are not happy with the shape of your mesh and would like to create uniform elements, you can use the Mesh...
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