Is there a way to load .stl file with finer detail #1453
-
|
When initializing PolyData, it seems like there's some sampling on the original stl file. I wonder if there's a way to turn off the sampling, and get a very fine mesh of the original stl file as a numpy array |
Beta Was this translation helpful? Give feedback.
Replies: 13 comments
-
|
It should be resampling and there’s no option to turn it on or off. Can you upload the file here for me to check it? You can also check the number of faces and points in the polydata object and compare that with another mesh reading program. |
Beta Was this translation helpful? Give feedback.
-
|
mesh = vtkInterface.PolyData(filename) |
Beta Was this translation helpful? Give feedback.
-
|
See the mesh = vtkInterface.PolyData(filename)
help(mesh.Subdivide) |
Beta Was this translation helpful? Give feedback.
-
|
It's throwing the exception Exception: Subdivision filter must be one of the following: 'butterfly', 'loop', or 'linear'. And in vanilla vtk, it's saying "vtkLoopSubdivisionFilter (0x55f8a8aeb420): Dataset is non-manifold and cannot be subdivided. Edge shared by 3 cells." So subdivision seems not working. |
Beta Was this translation helpful? Give feedback.
-
|
VTK requires the surface to be manifold for subdivision. Check out pymeshfix if you'd like to make it manifold. |
Beta Was this translation helpful? Give feedback.
-
|
Thank you, the pymeshfix package is working well. The problem is that after repairing, the manifold seems to contain only half of the size of the original model. In my case, before fixed it has around 7000 points, and after repairing, the top half (3500 points) is reserved. Is there a way to work around that? |
Beta Was this translation helpful? Give feedback.
-
|
Do you mean that the face order is reversed so that the face normals are pointed inward? If so, you can correct the face ordering with: mesh.GenerateNormals(auto_orient_normals=True) |
Beta Was this translation helpful? Give feedback.
-
|
Oh sorry. The face order looks fine to me. I mean the model size is reduced by half after repairing. |
Beta Was this translation helpful? Give feedback.
-
|
Are you sure those points weren’t dupicates?
…On Sun, Jul 1, 2018 at 09:52, Leroy357 ***@***.***> wrote:
Oh sorry. The face order looks fine to me. I mean the model size is
reduced by half after repairing.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<https://github.com/akaszynski/vtkInterface/issues/15#issuecomment-401590768>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ALbTP4Rj4-uiDSBCTQOZWQwYJAXK1MNsks5uCH_UgaJpZM4U6lkz>
.
|
Beta Was this translation helpful? Give feedback.
-
|
mesh = vtkInterface.PolyData(abs_name) Above is the code that I run. Those points were not duplicated (I print numberofpoints after first line, turns out to be 14224 points, and after the last line it becomes 3159). Do you know what's causing this? Also I wonder the meaning of the numbers printed when I used the meshfix. Thanks! |
Beta Was this translation helpful? Give feedback.
-
|
Can you zip the mesh and upload it? |
Beta Was this translation helpful? Give feedback.
-
|
mesh.zip |
Beta Was this translation helpful? Give feedback.
-
|
It looks like the input mesh contains several parts and isn't a single piece. Additionally, the part contains several self-intersections that can't be repaired automatically with Also, when debugging, you should use Z-buffer is implemented in VTK. |
Beta Was this translation helpful? Give feedback.
It looks like the input mesh contains several parts and isn't a single piece. Additionally, the part contains several self-intersections that can't be repaired automatically with
pymeshfix. I'd try outputting or generating the mesh as a single object.Also, when debugging, you should use
mesh.Plot()in order to visualize the mesh after repairing it to see what changed in each step.pymeshfixremoved all but one of the four isolated components, which is why only a quarter of the points remained after the "repair".Z-buffer is implemented in VTK.