Simulation of the Do Nothing Grinder, which consists of two shuttle blocks, each moving in its own groove, and a handle connects the shuttles. You can move the shuttles by pulling on the handle.

This is a strong test of the physics engine in ComputeForces. The contacts are very redundant, especially when a shuttle straddles the middle point.

This app has a config() method which looks at a set of options and rebuilds the simulation accordingly. UI controls are created to change the options.

TO DO Make a control for magnitude of handle force.

Hierarchy (view full)

Implements

Constructors

Properties

tightFit: boolean = true

Whether there is slack in the fit of shuttles in the grooves.

Methods

  • Adds the given Observer to this Subject's list of Observers, so that the Observer will be notified of changes in this Subject. An Observer may call Subject.addObserver during its observe method.

    Parameters

    Returns void

  • Define short-cut name replacement rules. For example 'sim' is replaced by 'myApp.sim' when myName is 'myApp'.

    Parameters

    • myName: string

      the name of this object, valid in global Javascript context.

    Returns void

  • Parameters

    • script: string
    • output: boolean = true

      whether to print the result to the output text area and add the script to session history; default is true

    Returns any

    the result of evaluating the string

  • Sets whether this Subject will broadcast events, typically used to temporarily disable broadcasting. Intended to be used in situations where a subclass overrides a method that broadcasts an event. This allows the subclass to prevent the superclass broadcasting that event, so that the subclass can broadcast the event when the method is completed.

    Parameters

    • value: boolean

      whether this Subject should broadcast events

    Returns boolean

    the previous value

  • Returns a minimal string representation of this object, usually giving just identity information like the class name and name of the object.

    For an object whose main purpose is to represent another Printable object, it is recommended to include the result of calling toStringShort on that other object. For example, calling toStringShort() on a DisplayShape might return something like this:

    DisplayShape{polygon:Polygon{'chain3'}}
    

    Returns string

    a minimal string representation of this object.

  • Makes the Do Nothing Grinder and adds it to the given simulation. There are four fixed 'groove' blocks which form the channels that the shuttles move in. There are two shuttles, one in the horizontal groove, one in the vertical groove. A handle connects between the two shuttles with joints. The handle does not interact with the fixed groove blocks.

    Parameters

    • sim: ContactSim

      the simulation to add to

    • tightFit: boolean

      true means that the fixed grooves are spaced so that the shuttles are in constant contact at all four corners; false gives a little wiggle room for the shuttles.

    Returns void

Generated using TypeDoc