GithubHelp home page GithubHelp logo

Comments (3)

banesullivan avatar banesullivan commented on July 18, 2024 1

Hi @JasonTLin - thanks for posting here!

Attached is a script to use a Delaunay 3D filter to make surface meshes of your point cloud.

import pandas as pd
import numpy as np
import pyvista as pv
import pymeshfix as mf

f = 'testdata_block_model.csv'
df = pd.read_csv(f)

pc = pv.PolyData(df[['Points:0', 'Points:1', 'Points:2']].values)
pc['MDIST'] = df['MDIST'].values
pc['gain'] = df['gain'].values

pc.plot(show_grid=True)

download

alpha = 17.

volume = pc.delaunay_3d(alpha=alpha)

# Extract some grade of the volume
ore = volume.threshold(30)

p = pv.Plotter(shape=(1,3), notebook=False)

p.subplot(0,0)
p.add_mesh(pc)
p.show_grid()

p.subplot(0,1)
p.add_mesh(volume)
p.show_grid()

p.subplot(0,2)
p.add_mesh(ore, opacity=0.75)
p.add_mesh(volume.slice('x', [23200, 9191.25, 9795.0]))
p.add_mesh(volume.slice('z', [22875, 9200, 10e3]))
p.show_grid()

p.link_views()
p.show()

Screen Shot 2019-07-26 at 10 16 42 AM

Rather than using the split bodies filter, lets split the bodies using a cutting plane. This is because the meshes are of poor quality at this point and need to be repaired. The parts that need repair are tricking the split_bodies filter and it won't work properly:

shell = volume.extract_geometry().clean()
center = pc.center
center[1] = 9200
shell_a = volume.clip('y', center)
shell_b = volume.clip('-y', center)
shells = pv.MultiBlock([shell_a, shell_b])

# Now fix and smppth
decimated_shells = pv.MultiBlock()
tetrad = pv.MultiBlock()
for block in shells:
    block = mf.MeshFix(block.extract_geometry().tri_filter())
    block.repair()
    block = block.mesh
    block = block.smooth(n_iter=180)
    decimated_shells.append(block)

Screen Shot 2019-07-26 at 10 31 38 AM

from pyvista-support.

banesullivan avatar banesullivan commented on July 18, 2024 1

Happy to help!

I think it all came down to the split_bodies filter not being able to handle the delaunayed mesh since it had holes/seperations all over

from pyvista-support.

JasonTLin avatar JasonTLin commented on July 18, 2024

Thanks for all the help. I was having a lot of trouble properly smoothing out the dataset.

from pyvista-support.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.