Skip to content

Commit

Permalink
minor test changes
Browse files Browse the repository at this point in the history
  • Loading branch information
mikedh committed Nov 27, 2018
1 parent 2c7083c commit efe2773
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion tests/test_paths.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def test_discrete(self):
# Y should not have moved
assert g.np.allclose(d.bounds[:, 1], ori[:, 1])

if len(d.vertices) < 150:
if len(d.polygons_full) > 0 and len(d.vertices) < 150:
g.log.info('Checking medial axis on %s',
d.metadata['file_name'])
m = d.medial_axis()
Expand Down
6 changes: 5 additions & 1 deletion tests/test_svg.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,12 @@ def test_svg(self):
exported = d.export(file_type='svg')
# load the exported SVG
stream = g.trimesh.util.wrap_as_stream(exported)
loaded = g.trimesh.load(stream, file_type='svg')

if g.np.isclose(d.area, 0.0):
continue

loaded = g.trimesh.load(stream, file_type='svg')

# we only have line and arc primitives as SVG
# export and import
if all(i.__class__.__name__ in ['Line', 'Arc']
Expand Down
2 changes: 1 addition & 1 deletion trimesh/path/entities.py
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ def angle(self, vertices):

return angle

def length(self):
def length(self, vertices):
return 0.0

def discrete(self, *args, **kwargs):
Expand Down
4 changes: 2 additions & 2 deletions trimesh/path/path.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def layers(self):
---------
layers: (len(entities), ) list of str
"""
layer = [None] * len(self.entities)
layer = ['NONE'] * len(self.entities)
for i, e in enumerate(self.entities):
if hasattr(e, 'layer'):
layer[i] = str(e.layer)
Expand Down Expand Up @@ -1098,7 +1098,7 @@ def area(self):
---------
area: float, total area of polygons minus interiors
"""
area = sum(i.area for i in self.polygons_full)
area = float(sum(i.area for i in self.polygons_full))
return area

@caching.cache_decorator
Expand Down

0 comments on commit efe2773

Please sign in to comment.