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

Fill Holes w. IDs using Python API #1051

Open
fkong7 opened this issue Mar 13, 2024 · 2 comments
Open

Fill Holes w. IDs using Python API #1051

fkong7 opened this issue Mar 13, 2024 · 2 comments
Assignees

Comments

@fkong7
Copy link
Contributor

fkong7 commented Mar 13, 2024

Is your feature request related to a problem? Please describe.
There is currently no Python API function to fill holes in a surface mesh while also assigning the cell data array "ModelFaceIDs" to the newly created faces. This function was previously available but has been removed due to issues mentioned in #749.

capped_cylinder = sv.vmtk.cap_with_ids(surface=model_polydata, fill_id=0, increment_id=True)

Currently, only sv.vmtk.cap(surface, use_center) is available but this function does not add the array "ModelFaceIDs" to the returned vtkPolyData object.

Describe the solution you'd like
It would be great to have a working Python API function to automate the "Fill Holes with IDs" functionality in the GUI.

Describe alternatives you've considered
One workaround proposed in #749 was to use the compute_boundary_faces function to recompute boundary faces by surface normals. However, for cardiac geometries without much surface normal differences between the valve face and the ventricle walls, this alternative doesn't work well.

modeler = sv.modeling.Modeler(sv.modeling.Kernel.POLYDATA)
capped_polydata = sv.vmtk.cap(surface=polydata, use_center=False)
capped_model = sv.modeling.PolyData()
capped_model.set_surface(surface=capped_polydata)
face_ids = capped_model.compute_boundary_faces(angle=60.0)
@ktbolt ktbolt self-assigned this Mar 13, 2024
@ktbolt
Copy link
Contributor

ktbolt commented Mar 13, 2024

@fkong7 Upload a file of a surface mesh you would like to have the holes filled for.

@ktbolt
Copy link
Contributor

ktbolt commented Mar 14, 2024

I've tested sv.vmtk.cap() on

Screen Shot 2024-03-14 at 3 24 58 PM

and get a surface with face IDs: [1, 2, 3, 4, 5, 6] and a ModelFaceID array
Screen Shot 2024-03-14 at 3 27 47 PM

SimVascular produces the same result.

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

2 participants