The method below doesn't make much sense at the moment, as we are not using the resistance, diameter, or length for anything yet. We should change idnum to portnum which better reflects what it is.
muscle1 = tf.muscle(idnum = 0, resist= 300, diam= 2, length= 150)
muscle2 = tf.muscle(idnum = 1, resist= 290, diam= 2, length= 145)
I find it weird to even have a reference to portnum before the muscle is attached to a Node object. Let's change it so that you use portnum and assign the muscle to a Node in the instantiation like so:
node = tf.Node(...)
muscle1 = tf.Muscle(node=node, portnum=1)
Or alternatively, do this attachment later with another function:
muscle1 = tf.Muscle() # No input params
muscle2 = tf.Muscle()
node = tf.Node(...)
muscle1.assign(node, 0)
muscle2.assign(node, 1)
This way, the muscles could be assigned to other nodes (if needed for some reason and the muscle object is retained.)
The method below doesn't make much sense at the moment, as we are not using the resistance, diameter, or length for anything yet. We should change
idnumtoportnumwhich better reflects what it is.I find it weird to even have a reference to
portnumbefore the muscle is attached to a Node object. Let's change it so that you useportnumand assign the muscle to a Node in the instantiation like so:Or alternatively, do this attachment later with another function:
This way, the muscles could be assigned to other nodes (if needed for some reason and the muscle object is retained.)