Skip to content

Commit 5b007fd

Browse files
committed
fix: SetColors expects an System.Array, loop instead
1 parent 82af17e commit 5b007fd

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111

1212
### Changed
1313

14+
* Replaced use of `Rhino.Geometry.VertexColors.SetColors` with a for loop and `SetColor` in `compas_ghpyton` since the former requires a `System.Array`.
1415
* Changed the `__str__` of `compas.geometry.Frame`, `compas.geometry.Plane`, `compas.geometry.Polygon`, `compas.geometry.Polyhedron`, `compas.geometry.Quaternion` to use a limited number of decimals (determined by `Tolerance.PRECISION`). Note: `__repr__` will instead maintain full precision.
1516
* Changed the `__str__` of `compas.geometry.Pointcloud` to print total number of points instead of the long list of points. Note: `__repr__` will still print all the points with full precision.
1617
* Fixed bug in `Pointcloud.from_box()`.

src/compas_ghpython/drawing.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -373,8 +373,10 @@ def draw_mesh(vertices, faces, color=None, vertex_normals=None, texture_coordina
373373

374374
if color:
375375
count = len(mesh.Vertices)
376-
colors = [rs.coercecolor(color) for i in range(count)]
377-
mesh.VertexColors.SetColors(colors)
376+
color = rs.CreateColor(color)
377+
378+
for i in range(count):
379+
mesh.VertexColors.SetColor(i, color.R, color.G, color.B)
378380

379381
return mesh
380382

0 commit comments

Comments
 (0)