arpastrana / compas_cem

Inverse design of 3D truss networks with automatic differentiation
https://arpastrana.github.io/compas_cem
MIT License
37 stars 7 forks source link

Separate combinatorial state from force and lengths #3

Open arpastrana opened 3 years ago

arpastrana commented 3 years ago

Instead of this:

TrailEdge(u, v, signed_length, plane=None)
DeviationEdge(u, v, signed_force)

Do this:

TrailEdge(u, v, state, length, plane=None)
DeviationEdge(u, v, state, force)

This would require adding a new attribute to the edges dictionaries, namely {"state": -1} where possible states are only -1 if the edge is meant to be in compression and +1 if it should be in tension. Adjustments in force.py and force_numpy.py should follow.