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.
To run the script in Fusion 360:
ADD-INS > Scripts and Add-ins ...
+
icon .../physical-modelling-synthesis/src/idiophone-bar.py
and click open
run