Skip to content

Commit d8e073e

Browse files
committed
compas_rhino.rs is not a thing
1 parent f1f835f commit d8e073e

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

CHANGELOG.md

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

1212
### Changed
1313

14+
* Fixed bug in `RobotModelObject` caused by non-existent `compas_rhino.rs`. Replaced with `import rhinoscriptsyntax as rs`.
15+
1416
### Removed
1517

1618

src/compas_robots/rhino/scene/robotmodelobject.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -90,18 +90,22 @@ def create_geometry(self, geometry, name=None, color=None):
9090
return mesh
9191

9292
def _enter_layer(self):
93+
import rhinoscriptsyntax as rs # type: ignore
94+
9395
self._previous_layer = None
9496

9597
if self.layer:
96-
if not compas_rhino.rs.IsLayer(self.layer):
98+
if not rs.IsLayer(self.layer):
9799
compas_rhino.create_layers_from_path(self.layer)
98-
self._previous_layer = compas_rhino.rs.CurrentLayer(self.layer)
100+
self._previous_layer = rs.CurrentLayer(self.layer)
99101

100-
compas_rhino.rs.EnableRedraw(False)
102+
rs.EnableRedraw(False)
101103

102104
def _exit_layer(self):
105+
import rhinoscriptsyntax as rs # type: ignore
106+
103107
if self.layer and self._previous_layer:
104-
compas_rhino.rs.CurrentLayer(self._previous_layer)
108+
rs.CurrentLayer(self._previous_layer)
105109

106110
self.redraw()
107111

@@ -190,11 +194,13 @@ def redraw(self, timeout=None):
190194
None
191195
192196
"""
197+
import rhinoscriptsyntax as rs # type: ignore
198+
193199
if timeout:
194200
time.sleep(timeout)
195201

196-
compas_rhino.rs.EnableRedraw(True)
197-
compas_rhino.rs.Redraw()
202+
rs.EnableRedraw(True)
203+
rs.Redraw()
198204

199205
def clear_layer(self):
200206
"""Clear the main layer of the scene object.

0 commit comments

Comments
 (0)