Skip to content

Commit

Permalink
add mesh.remove_all_lines()
Browse files Browse the repository at this point in the history
  • Loading branch information
marcomusy committed Dec 11, 2024
1 parent fc06b2e commit db89b97
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
- adjust volume transfer function for transparency @Poisoned
- fixing axes type 10 by @Poisoned
- improvements to input/output functionality for Assembly @ttsesm
- added `mesh.remove_all_lines()` method



Expand Down
5 changes: 5 additions & 0 deletions vedo/mesh.py
Original file line number Diff line number Diff line change
Expand Up @@ -843,6 +843,11 @@ def split_polylines(self) -> Self:
comment=f"#lines {self.dataset.GetNumberOfLines()}"
)
return self

def remove_all_lines(self) -> Self:
"""Remove all line elements from the mesh."""
self.dataset.GetLines().Reset()
return self

def slice(self, origin=(0, 0, 0), normal=(1, 0, 0)) -> Self:
"""
Expand Down
2 changes: 1 addition & 1 deletion vedo/plotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -836,7 +836,7 @@ def __str__(self):
try:
b = a.bounds()
bns.append(b)
except AttributeError:
except (AttributeError, TypeError):
pass
try:
totpt += a.npoints
Expand Down
6 changes: 6 additions & 0 deletions vedo/visual.py
Original file line number Diff line number Diff line change
Expand Up @@ -618,6 +618,12 @@ def toggle(self) -> Self:
"""Toggle object visibility."""
self.SetVisibility(not self.GetVisibility())
return self

def visibility(value=None) -> bool:
"""Get/Set object visibility."""
if value is not None:
self.SetVisibility(value)
return self.GetVisibility()

def pickable(self, value=True) -> Self:
"""Set object pickability."""
Expand Down

0 comments on commit db89b97

Please sign in to comment.