Adjust Connector

These actions adjust the current value of the specified attribute of the specified connector. The specified value is added the current value of that attribute. Provide a negative value to decrease an attribute value.

Note

For some attributes zero or negative values make no physical sense and in some cases create mathematical problems for the solver, for example specifiying a negative moment of inertia value is meaningless. Users need to be careful about these kind of situations.

Damping

Adjusts the damping coefficent (C for springs and Ctor for torsional springs). Applicable to springs and torsional springs.

Automatically generated code (generated by the behavior dialog):

# Adjust spring1's damping when left mouse button is pressed down.
rectangle1.bind(LEFTDOWN, system.evtHandler, ADJUSTDAMPING,
                **{'target': spring1, 'd_C': .01})

Manually created code (equivalent to the automatically generated code shown above):

def adjustDamping(event, source, target):
    target.C += .01

rectangle1.bind(LEFTDOWN, adjustDamping, target=spring1)

Stiffness

Adjusts the stiffness value (K for springs and Ktor for torsional springs). Applicable to springs and torsional springs.

Automatically generated code (generated by the behavior dialog):

# Adjust spring1's stiffness when left mouse button is pressed down.
rectangle1.bind(LEFTDOWN, system.evtHandler, ADJUSTSTIFFNESS,
                **{'target': spring1, 'd_K': 2})

Manually created code (equivalent to the automatically generated code shown above):

def adjustStiffness(event, source, target):
    target.K += 2

rectangle1.bind(LEFTDOWN, adjustStiffness, target=spring1)

Initial angle

Adjusts a torsional spring’s initial angle (A0). Applicable to torsional springs only.

Automatically generated code (generated by the behavior dialog):

# Adjust torSpring1's initial when circle1 collides with rectangle1.
circle1.bind(COLLISION, system.evtHandler, rectangle1, ADJUSTINITANGLE,
             **{'target': torSpring1, 'd_A0': .1})

Manually created code (equivalent to the automatically generated code shown above):

def adjustInitAngle(event, source, target):
    target.A0 += .1

circle1.bind(COLLISION, adjustInitAngle, other=rectangle1, target=torSpring1)

Initial length

Adjusts a spring’s initial length (L0). Applicable to springs only.

Automatically generated code (generated by the behavior dialog):

# Adjust spring1's initial length when DOWN_ARROW key is pressed down.
circle1.bind(KEYDOWN, system.evtHandler, key.DOWN_ARROW, ADJUSTINITLENGTH,
             **{'target': spring1, 'd_L0': -.25})

Manually created code (equivalent to the automatically generated code shown above):

def adjustInitLength(event, source, target):
    target.L0 -= .25

circle1.bind(KEYDOWN, adjustInitLength, keyCode=key.DOWN_ARROW, target=spring1)

Motor speed

Adjust a motor’s or pin joint’s motor speed. Applicable to motors and pin joints.

Note

Pin joints can be motorized by setting their enableMotor attribute to True and rpm attribute to a non-zero value.

Automatically generated code (generated by the behavior dialog):

# Adjust motor1's revolutions when UP_ARROW key is pressed down.
rectangle2.bind(KEYDOWN, system.evtHandler, key.UP_ARROW, ADJUSTRPM,
                **{'target': motor1, 'd_rpm': 2})

Manually created code (equivalent to the automatically generated code shown above):

def adjustRPM(event, source, target, deltaRPM):
    target.rpm += deltaRPM

rectangle2.bind(KEYDOWN, adjustRPM, keyCode=key.UP_ARROW, target=motor1, deltaRPM=2)

Lower limit

Adjusts the lower angle limit. Applicable to motors, torsional springs, and pin joints.

Automatically generated code (generated by the behavior dialog):

# Adjust torSpring1's lower when left mouse button is pressed down.
circle1.bind(LEFTDOWN, system.evtHandler, ADJUSTLOWERANGLE,
             **{'target': torSpring1, 'd_lowerAngle': pi/9})

Manually created code (equivalent to the automatically generated code shown above):

def adjustLowerLimit(event, source, target, deltaAngle):
    target.lowerAngle += deltaAngle

circle1.bind(LEFTDOWN, adjustLowerLimit, target=torSpring1, deltaAngle=pi/9)

Upper limit

Adjusts the upper angle limit. Applicable to motors, torsional springs, and pin joints.

Automatically generated code (generated by the behavior dialog):

# Adjust torSpring1's upper when left mouse button is pressed down.
circle1.bind(LEFTDOWN, system.evtHandler, ADJUSTUPPERANGLE,
             **{'target': torSpring1, 'd_upperAngle': pi/9})

Manually created code (equivalent to the automatically generated code shown above):

def adjustUpperLimit(event, source, target, deltaAngle):
    target.upperAngle += deltaAngle

circle1.bind(LEFTDOWN, adjustUpperLimit, target=torSpring1, deltaAngle=pi/9)

Body1 X-Y

Adjusts b1x and/or b1y.

Automatically generated code (generated by the behavior dialog):

# Adjust link1's b1x periodically.
polygon1.bind(PERIODIC, system.evtHandler, 1500,
              ADJUSTBODY1XY, **{'target': link1, 'd_b1x': .2, 'd_b1y': 0})

Manually created code (equivalent to the automatically generated code shown above):

def adjustB1X(event, source, target, deltaB1X):
    target.b1x += deltaB1X

polygon1(PERIODIC, adjustB1X, period=1500, target=link1, deltaB1X=.2)

Body2 X-Y

Adjusts b2x and/or b2y.

Automatically generated code (generated by the behavior dialog):

# Adjust link1's b2y periodically.
polygon1.bind(PERIODIC, system.evtHandler, 1500,
              ADJUSTBODY1XY, **{'target': link1, 'd_b2x': 0, 'd_b2y': -.2})

Manually created code (equivalent to the automatically generated code shown above):

def adjustB2Y(event, source, target, deltaB2Y):
    target.b2y += deltaB2Y

polygon1(PERIODIC, adjustB2Y, period=1500, target=link1, deltaB2Y=.2)

Break Force

Adjusts the break force. Applicable to all connector types but welds, beams, and belts.

Automatically generated code (generated by the behavior dialog):

# Adjust spring1's break force when left mouse button is pressed down.
rectangle1.bind(LEFTDOWN, system.evtHandler, ADJUSTBREAKFORCE,
                **{'target': spring1, 'd_breakForce': -55})

Manually created code (equivalent to the automatically generated code shown above):

def adjustBreakForce(event, source, target, deltaF):
    target.breakForce += deltaF

rectangle1.bind(LEFTDOWN, adjustBreakForce, target=spring1, deltaF=-55)

Break Torque

Adjusts the break torque. Applicable to motors and torsional springs.

# Adjust torSpring1's break torque when left mouse button is pressed down.
rectangle1.bind(LEFTDOWN, system.evtHandler, ADJUSTBREAKTORQUE,
                **{'target': torSpring1, 'd_breakTorque': -55})

Manually created code (equivalent to the automatically generated code shown above):

def adjustBreakTorque(event, source, target, deltaT):
    target.breakTorque += deltaT

rectangle1.bind(LEFTDOWN, adjustBreakTorque, target=torSpring1, deltaT=-55)

Table Of Contents

Previous topic

Actions

Next topic

Set Connector

This Page