@Node(viewer)
def load_bunny() -> Mesh:
return Mesh.from_ply(compas.get('bunny.ply'))
@Node(viewer)
def move_bunny(mesh: Mesh) -> Mesh:
T = Translation.from_vector([10, 0, 0])
R = Rotation.from_axis_and_angle([1, 0, 0], math.radians(90))
S = Scale.from_factors([100, 100, 100])
return mesh.transformed(T * R * S)
A basic setup to use decorator to for registering nodes. Now the viewer already automatically updates while adding/deleting nodes or connection changes. Will work on the second part where we can predefine a whole graph.
A basic setup to use decorator to for registering nodes. Now the viewer already automatically updates while adding/deleting nodes or connection changes. Will work on the second part where we can predefine a whole graph.