Skip to content

Commit

Permalink
ruff
Browse files Browse the repository at this point in the history
  • Loading branch information
tomvanmele committed Jun 25, 2024
1 parent 4198a82 commit e28d162
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions scripts/buffer.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from compas_viewer.scene import BufferGeometry
from compas_viewer import Viewer
import numpy as np

from compas_viewer import Viewer
from compas_viewer.scene import BufferGeometry

points = np.random.rand(1000, 3) * 10
pointcolor = np.random.rand(1000, 4)
Expand Down
5 changes: 3 additions & 2 deletions scripts/dynamic_box.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
from random import random

from compas.geometry import Box
from compas.datastructures import Mesh
from compas.geometry import Box
from compas_viewer import Viewer

viewer = Viewer()

mesh = Mesh.from_shape(Box.from_width_height_depth(2, 2, 2))
obj = viewer.scene.add(mesh)


@viewer.on(interval=100)
def deform_mesh(frame):
for v in mesh.vertices():
vertex: list = mesh.vertex_attributes(v, "xyz")
vertex: list = mesh.vertex_attributes(v, "xyz")
vertex[0] += (random() - 0.5) * 0.1
vertex[1] += (random() - 0.5) * 0.1
vertex[2] += (random() - 0.5) * 0.1
Expand Down
5 changes: 3 additions & 2 deletions scripts/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
from compas.datastructures import Mesh
from compas.geometry import Box
from compas.geometry import Frame
from compas_viewer.viewer import Viewer
from compas_viewer.config import Config
from compas_viewer.components import Sceneform
from compas_viewer.config import Config
from compas_viewer.viewer import Viewer

config = Config()
config.ui.sidebar.sceneform = False
Expand Down Expand Up @@ -33,6 +33,7 @@
def callback(item):
print("Callback triggered on", item)


viewer.ui.sidebar.widget.addWidget(Sceneform(viewer.scene, {"Name": (lambda o: o.name)}, callback=callback))

viewer.show()

0 comments on commit e28d162

Please sign in to comment.