Skip to content

Commit a5c0754

Browse files
committed
update defaults
1 parent 16fb3e1 commit a5c0754

File tree

3 files changed

+37
-0
lines changed

3 files changed

+37
-0
lines changed

CHANGELOG.md

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

1212
### Changed
1313

14+
* Changed default node size, node color, and edge color of graph object.
15+
* Changed default vertex size, vertex color, edge color, and face color of mesh object.
16+
1417
### Removed
1518

1619

src/compas_notebook/scene/graphobject.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import pythreejs as three
2+
from compas.colors import Color
23
from compas.scene import GraphObject
34

45
from compas_notebook.conversions import nodes_and_edges_to_threejs
@@ -9,6 +10,20 @@
910
class ThreeGraphObject(ThreeSceneObject, GraphObject):
1011
"""Scene object for drawing graph."""
1112

13+
def __init__(
14+
self,
15+
nodesize=0.1,
16+
nodecolor=Color(0.0, 0.0, 0.0),
17+
edgecolor=Color(0.2, 0.2, 0.2),
18+
**kwargs,
19+
):
20+
super().__init__(
21+
nodesize=nodesize,
22+
nodecolor=nodecolor,
23+
edgecolor=edgecolor,
24+
**kwargs,
25+
)
26+
1227
def draw(self):
1328
"""Draw the graph associated with the scene object.
1429

src/compas_notebook/scene/meshobject.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import numpy
22
import pythreejs as three
3+
from compas.colors import Color
34
from compas.geometry import Polygon
45
from compas.geometry import earclip_polygon
56
from compas.scene import MeshObject
@@ -10,6 +11,24 @@
1011
class ThreeMeshObject(ThreeSceneObject, MeshObject):
1112
"""Scene object for drawing mesh."""
1213

14+
def __init__(
15+
self,
16+
show_edges=True,
17+
vertexcolor=Color(0.0, 0.0, 0.0),
18+
edgecolor=Color(0.2, 0.2, 0.2),
19+
facecolor=Color(0.9, 0.9, 0.9),
20+
vertexsize=0.1,
21+
**kwargs,
22+
):
23+
super().__init__(
24+
show_edges=show_edges,
25+
vertexcolor=vertexcolor,
26+
edgecolor=edgecolor,
27+
facecolor=facecolor,
28+
vertexsize=vertexsize,
29+
**kwargs,
30+
)
31+
1332
def draw(self):
1433
"""Draw the mesh associated with the scene object.
1534

0 commit comments

Comments
 (0)