Skip to content

Commit

Permalink
Merge 01393ad into 592d847
Browse files Browse the repository at this point in the history
  • Loading branch information
wkentaro committed Dec 11, 2019
2 parents 592d847 + 01393ad commit 47f8cec
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
12 changes: 11 additions & 1 deletion trimesh/path/path.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ def __init__(self,
entities=None,
vertices=None,
metadata=None,
process=True):
process=True,
colors=None):
"""
Instantiate a path object.
Expand All @@ -86,6 +87,7 @@ def __init__(self,

self.entities = entities
self.vertices = vertices
self.colors = colors
self.metadata = dict()

if metadata.__class__.__name__ == 'dict':
Expand Down Expand Up @@ -117,6 +119,14 @@ def process(self):
func()
return self

@property
def colors(self):
return self._colors

@colors.setter
def colors(self, values):
self._colors = caching.tracked_array(values)

@property
def vertices(self):
return self._vertices
Expand Down
2 changes: 1 addition & 1 deletion trimesh/rendering.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def convert_to_vertexlist(geometry, **kwargs):
elif util.is_instance_named(geometry, 'Path'):
# works for Path3D and Path2D
# both of which inherit from Path
return path_to_vertexlist(geometry, **kwargs)
return path_to_vertexlist(geometry, colors=geometry.colors, **kwargs)
elif util.is_instance_named(geometry, 'PointCloud'):
# pointcloud objects contain colors
return points_to_vertexlist(geometry.vertices,
Expand Down

0 comments on commit 47f8cec

Please sign in to comment.