SHF08 shaft holder drawing
This example starts with an SHF08 shaft holder from the FreeCAD Parts Library. A Python program records the drafting decisions, then the fabrication pipeline reads the model, builds the views and annotations, and checks the finished drawing. Musa CAD opens and plots the resulting .musa file.
Download the drawing · Open the drawing-only PDF · Open the full sheet
What the drawing shows
Section titled “What the drawing shows”- Front view: looking along the bore, with both mounting holes, the clamp slot, cutting plane and solid sight arrows.
- Section A-A: a hatched cut through the bore axis, placed below the front view.
- Hole callouts: Ø8 H7 (+0.015/0), 2X Ø5.5 THRU and Ø4 THRU. Each leader approaches its feature from the side nearest its callout.
- Location dimensions: 32.5 BASIC hole pitch, 24 overall height, 14, 3, 20 and 1.2.
- Geometric tolerances: datum A on the mounting face, perpendicularity 0.05 to A on the bore, and position 0.2 to A on the mounting holes. Each frame is attached to its feature’s size annotation.
- Fabrication notes: chamfers, edge treatment, Ra surface finishes and the model credit. The stated material is aluminium 6061-T6.
The full sheet is A4 portrait at 2:1. The drawing-only PDF uses an A4 landscape page at the same scale, with a window that excludes the title block and parts row. Print at actual size to keep the scale.
There is no pictorial because the pipeline’s raster image would not be included by musacad --plot. There is no overall width dimension: the ends are full radii, so the drawing locates the features and states the end radii instead.
Plot it with Musa CAD
Section titled “Plot it with Musa CAD”The committed drawing is native format v14 and opens in Musa CAD 0.10.0. Plotting it needs only Musa CAD, not FreeCAD or the pipeline:
musacad --plot shf08_shaft_holder.musa shf08_shaft_holder.pdf --paper A4 --landscape --scale 2:1 --window 8.454,39.253,91.766,118.185To plot the full sheet, use:
musacad --plot shf08_shaft_holder.musa shf08_shaft_holder_sheet.pdf --paper A4 --portrait --scale 2:1 --window 0.000,0.000,95.919,144.949On a Mac, use /Applications/MusaCAD.app/Contents/MacOS/musacad_app in place of musacad. On Windows, run musacad.exe from the install folder.
The code behind it
Section titled “The code behind it”The program separates drafting decisions from drawing generation. PART records the views, section, scale, callouts, dimensions, geometric tolerances and notes. DECISIONS adds the project and template settings.
PART = { "part_id": "01", "file": str(MODEL), "description": "SHAFT HOLDER SHF08", "drg_no": "MC-SHF08-01", "material": "ALUMINIUM 6061-T6", "qty": 1, "sheet": True, # look along the bore: the outline, both mounting holes and the clamp # slot are all in one view "front_view": "+Y", # ... and cut through the bore axis, so the section shows the bore and # the mounting holes at their true diameters (0.583 of the 24 mm # height, measured from the bottom of the view) "section": {"enabled": True, "projection": "below", "offset_frac": 0.5833, "label": "A"}, "scale": "2:1", # no shaded pictorial: the pipeline stamps that as a raster at plot # time, and this sheet is meant to plot identically under Musa CAD's # own `--plot`, which stamps none "pictorial": False, # the ends are full radii, so the overall width is a tangent point # nobody can measure: the part is dimensioned by its features instead "front_extent_dims": False, # each arrow lands on the side of its feature the callout column is # on, so no leader has to cross the view to reach its note "callouts": [ # the bore's fit is called out on the SECTION, where its depth # is what the reader is looking at {"view": "section", "at": [4.0, 7.0], "circle_r": 4.0, "text": "%%c8 H7 (+0.015/0)"}, # the chamfer mouth is a circle of its own: this callout speaks # for it too (`suppress_radii`), so it is not dimensioned twice {"view": "front", "at": [18.19, 1.94], "circle_r": 2.75, "suppress_dia_dim": True, "suppress_radii": [3.5], "text": "2X %%c5.5 THRU"}, {"view": "front", "at": [9.5, -13.0], "text": "%%c4 THRU"}, ], "location_dims": [ # mounting hole pitch — BASIC, because the position frame below # is what controls it (ASME Y14.5) {"view": "front", "orient": "h", "side": "top", "basic": True, "a": [-16.25, 0.0], "b": [16.25, 0.0]}, # overall height on one side; the two heights that locate the # bore and the clamp screw above the base on the other {"view": "front", "orient": "v", "side": "left", "a": [0.0, 10.0], "b": [0.0, -14.0]}, {"view": "front", "orient": "v", "side": "right", "a": [0.0, 0.0], "b": [0.0, -14.0]}, {"view": "front", "orient": "v", "side": "right", "a": [0.0, -11.0], "b": [0.0, -14.0]}, # the clamp lugs and the slot between them {"view": "front", "orient": "h", "side": "bottom", "a": [-10.0, -14.0], "b": [10.0, -14.0]}, {"view": "front", "orient": "h", "side": "bottom", "a": [-0.6, -14.0], "b": [0.6, -14.0]}, ], "gdt": { "datums": [{"label": "A", "view": "section", "target": "bottom_face"}], "frames": [ {"symbol": "perpendicularity", "view": "section", "target": "bore_r4", "tol": "0.05", "refs": ["A"]}, {"symbol": "position", "view": "front", "target": "hole_r2.75", "tol": "0.2", "refs": ["A"]}, ], }, "fab_notes": [ "DATUM A IS THE MOUNTING FACE.", "BOTH ENDS R5.25 ABOUT THE %%c5.5 HOLE CENTRES.", "THE %%c4 CROSS HOLE TAKES THE M4 CLAMP SCREW.", "CHAMFER 0.75 x 45%%d BOTH ENDS OF EACH %%c5.5 HOLE; " "0.2 x 45%%d BOTH ENDS OF THE BORE.", "BORE Ra 1.6; ALL OTHER MACHINED SURFACES Ra 3.2.", "BREAK ALL SHARP EDGES 0.2-0.5 x 45%%d.", "MODEL: SHF08, FREECAD PARTS LIBRARY, CC BY 3.0.", ], # the model carries no material, which /judge reports; the manifest # states one, and the waiver records that the decision was taken "waivers": ["material undefined (FreeCAD 'Default') — title block " "MATERIAL will need a value at /finalise"],}
DECISIONS = { "locked": False, "project": "MUSA CAD DEMONSTRATION", "drg_no_prefix": "MC", "drawn_by": "MUSA CAD", "rev": "00", "model_dir": str(MODEL.parent), "assembly_file": "", # a company title block is a PROJECT file: the pipeline ships one # sheet layout and this points at our own copy of it "template": str(TEMPLATE), "parts": [PART], "assembly_sheet": {"enabled": False},}The rest of the program runs five stages: analyse the model, judge whether it is ready to draft, finalise the decisions, draw the sheet, and export it. The model has no material assigned, so the decisions supply aluminium 6061-T6 and record that choice.
Read the full program · Generator setup and model source · Download the template
Regenerating the drawing needs headless FreeCAD 1.1.1 and fabrication_pipeline v0.17.2. The wiki builds from the committed .musa; it does not run this generator.
What the audits check
Section titled “What the audits check”The pipeline reads the finished drawing back. Its value audit compares the printed values with the manifest. Its layout audit checks leader crossings, ink on text, annotation spacing and sheet bounds. Both audits pass for this example with no findings or audit waivers.
The drawing went through four iterations. The audits found an unplaced dimension, leaders crossing their own view, crowded annotations and a leader crossing a dimension line. Each was fixed by changing the drafting decisions and regenerating the sheet.
The fits, finishes and notes are illustrative. This is a drafting example, not a released part.
Model credit
Section titled “Model credit”The SHF08 model comes from the FreeCAD Parts Library, under CC BY 3.0. This example adds drawing views, dimensions, tolerances and notes. The model and derived drawings are excluded from the wiki’s CC0 dedication; the generator is LGPL-3.0-or-later.
Model SHA-256: 73354b227dcb51427df83e169306b465f171e9c48e9f34be39f33732bd902a13.
For a smaller example that runs with Python alone, see Drawings from code.