Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python API - STL mesh import and offset strategies #1921

Open
f-pucci opened this issue Oct 2, 2024 · 0 comments
Open

Python API - STL mesh import and offset strategies #1921

f-pucci opened this issue Oct 2, 2024 · 0 comments

Comments

@f-pucci
Copy link

f-pucci commented Oct 2, 2024

Good morning everyone,
I hope you are doing well.

I was wondering if anyone could help me with the Python API or if you could suggest me the correct set of functions that I would need to use to be able to import ant STL file, voxelize the geometry and perform an "erosion" operation using distance functions. And then perform a Laplacian smooth.

My main objective is to do an "intrusion" of my geometry, setting an inwards offset.

Can anyone suggest me how to approach this? Is it better to use the C++ code or can I also use the Python API?

At the moment, I have only managed to do the following:

import pyopenvdb as vdb
import meshio
import numpy as np

mesh = meshio.read('./geometry.stl')
resolution = 0.001

sg = vdb.FloatGrid.createLevelSetFromPolygons(
    points=mesh.points,
    triangles=mesh.cells_dict.get('triangle', None),
    transform=vdb.createLinearTransform(voxelSize=resolution),
    halfWidth=3)

sg.name = 'surface'

Thank you so much in advance for your help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant