Skip to content

Commit

Permalink
default base color
Browse files Browse the repository at this point in the history
  • Loading branch information
tomvanmele committed Aug 23, 2024
1 parent 8edaae4 commit 63ca066
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added

* Added custom scene `compas_notebook.scene.Scene`.
* Added default base color to all scene objects.

### Changed

Expand Down
3 changes: 3 additions & 0 deletions src/compas_notebook/scene/sceneobject.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,16 @@
from compas.geometry import Rotation
from compas.geometry import Transformation
from compas.scene import SceneObject
from compas.scene.descriptors.color import ColorAttribute

Rx = Rotation.from_axis_and_angle([1, 0, 0], 3.14159 / 2)


class ThreeSceneObject(SceneObject):
"""Base class for all PyThreeJS scene objects."""

color = ColorAttribute(default=Color(0.2, 0.2, 0.2))

def y_to_z(self, transformation: Transformation) -> Transformation:
"""Convert a transformation from COMPAS to the ThreeJS coordinate system.
Expand Down

0 comments on commit 63ca066

Please sign in to comment.