Skip to content

Rework input parameters for Muscle class #12

Description

@MarkDannemiller

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.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Fields

    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions