Generating the Vibraphone Bar

A Python script was created to generate a model of a vibraphone bar. The script utilizes the Fusion 360 API to perform an extrude operation on a sketch. The sketch is defined by four inputs: length, width, height, and tone.

The following pseudocode describes the entire modelling process. The dimensions of the bar are represented with the variables L, W, and H for length, width, and height, respectively:

HOLE_SIZE = 0.4
IDIOPHONE_NODE_RATIO = 0.2242

# Sketch the rectangular outline
sketch_line (Point (0, 0, 0), Point (L, 0, 0))
sketch_line (Point (L, 0, 0), Point (L, H, 0))
sketch_line (Point (L, H, 0), Point (0, H, 0))
sketch_line (Point (0, H, 0), Point (0, 0, 0))

# Sketch the holes
hole_offset = L * IDIOPHONE_NODE_RATIO
sketch_circle (Point ( hole_offset, H / 2, 0), HOLE_SIZE)
sketch_circle (Point ( L - hole_offset, H / 2, 0), HOLE_SIZE)

# Sketch the arc
points = []

points.add (Point(hole_offset, 0, 0))
points.add (Point(L / 2,  H * T, 0))
points.add (Point(L - hole_offset, 0, 0))

sketch_spline (points)

# Create the extrusion
create_extrude (W)

The full code can be found here.

Usage

To run the script in Fusion 360:

  1. Save this project somewhere and unzip it
  2. Start Fusion 360
  3. From the menu, select ADD-INS > Scripts and Add-ins ...
  4. Click the green + icon
  5. Browse to the file .../physical-modelling-synthesis/src/idiophone-bar.py and click open
  6. Select the added script and click run