compas-dev / compas_view2

Standalone viewer for COMPAS
https://compas.dev/compas_view2/
MIT License
7 stars 9 forks source link

add basic flow setup #117

Closed Licini closed 2 years ago

Licini commented 2 years ago
@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.

image

Licini commented 2 years ago

@brgcode I'd say the basic setup are done. The Flow class is now inherited from Graph