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

ENH: avoid decimation for models with number of points lesser than 50 #11

Merged
merged 1 commit into from
Dec 22, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions OpenAnatomyExport/OpenAnatomyExport.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,10 +408,12 @@ def addModelToRenderer(self, inputModelNode, outputModelNode, boostGouraudColor=
self._temporaryExportNodes.append(self._decimationParameterNode)

# Quadric decimation
if self.reductionFactor == 0.0:
if (self.reductionFactor == 0.0) or (inputModelNode.GetPolyData().GetNumberOfPoints() < 50):
# Models with very small number of points are not decimated, as the memory saving is
# negligible and the models may become severely distorted.
outputModelNode.CopyContent(inputModelNode)
else:

# Temporary workaround (part 1/2):
# VTK 9.0 OBJ writer creates invalid OBJ file if there are triangle
# strips and normals but no texture coords.
Expand Down