Skip to content

Commit

Permalink
ENH: Avoid decimation for models with small number of points
Browse files Browse the repository at this point in the history
fixes #9
  • Loading branch information
mauigna06 authored and lassoan committed Dec 22, 2022
1 parent 8856b1e commit d733b46
Showing 1 changed file with 4 additions and 2 deletions.
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

0 comments on commit d733b46

Please sign in to comment.