Your project template provides a ready-to-use component that displays a 3D model you can manipulate (rotate, zoom) directly in a page. This tutorial explains where to store your CAD files, how to export the model and display it, and a fallback method using images.
What needs documenting
Beyond the 3D model itself: the material chosen and why, the
important tolerances (a clearance that is too tight will not print, a clearance that is too
loose becomes unstable), and the parts that took several
iterations. See Prototyping and iterating.
Where to store the files
The template separates the project sources (in project/) from what the
site displays (in docs/assets/):
Location
Content
Role
project/mcad/
projet.step (STEP export of the complete assembly), Onshape link, date of the last export
The version usable by everyone, without an Onshape account
project/mcad/3d-print/
One .3mf file per part, and the table of print settings
Redoing the print
project/mcad/laser-cutting/
One .svg or .dxf file per part, and the table of material and thickness
Redoing the cut
docs/assets/models/
The .glb model (under 25 MB)
What the site displays
Two rules to know:
For 3D printing, store .3mf files (they keep the
slicer settings). .stl files are ignored by the template’s .gitignore:
they will not appear in GitHub Desktop.
If you do not use Onshape (Fusion, SolidWorks, FreeCAD…), also store
your native files in project/mcad/in addition to the STEP export:
unlike with Onshape, they are not saved anywhere else.
Exporting from Onshape
Onshape keeps the history of your work, but your repo must contain
a version usable without an Onshape account. In both cases, right-click
the assembly tab then Export:
STEP format: save it in project/mcad/ under the name projet.step.
GLB format: save it in docs/assets/models/.
Re-export at each important version, and update the date of the last
export in project/mcad/README.md. With other software, export as
STEP, and as glTF/GLB if your software allows it (otherwise, use the fallback
method with images further down).
Displaying the 3D model
Step 1: Duplicate the example page
The docs/conception/mecanique/ folder contains the example page boitier.md. Copy it into the same folder, name the copy after your subassembly (for example pince.md), then change its title and its nav_order. Its parent (“Mécanique”) and its grand_parent (“Conception”) stay the same. See Customising your project template for how the menu works.
Copy your .glb file into docs/assets/models/, with a name with no spaces or accents (pince.glb). Check that it is under 25 MB: above that, the CI workflow of your repo reports an error.
Once your model is displayed, delete Otto.glb from docs/assets/models/ (it is also used by the home page: change the file name there before deleting it) and the À modifier (to be edited) block from your page.
Each part to be made has one row in the table of the README.md of
its folder, so that someone else can remake it identically.
Copy the 3D printing table (Markdown)
| Part | File | Material | Nozzle | Layer | Infill | Supports | Quantity |
|---|---|---|---|---|---|---|---|
| Motor mount | `support-moteur.3mf` | PLA | 0.4 mm | 0.2 mm | 20% | No | 2 |
Copy the laser cutting table (Markdown)
| Part | File | Material | Thickness | Quantity |
|---|---|---|---|---|
| Enclosure | `boitier.svg` | Poplar plywood | 3 mm | 1 |
On the documentation page of your subassembly, the
Fabrication (manufacturing) heading points to these two folders (the template already does so
in boitier.md).
The bill of materials
On the subassembly page, a summary bill of materials gathers all
the parts, whatever the process (printed, cut, bought):
Copy the bill of materials template (Markdown)
| Part | Material | Quantity | Process | Note |
|---|---|---|---|---|
| Sensor mount | PLA | 1 | 3D printing | +0.2 mm tolerance on the housing |
| Rotation shaft | Stainless steel | 1 | Bought off the shelf | 6 mm diameter |
| Chassis | 5 mm plywood | 1 | Laser cutting | ... |
Fallback method: exporting an image
For a fixed figure (an exploded view for a poster, for example), or if your
software does not export to GLB, export an image. It is the method that
always works, without installing anything more.
Step 1: Frame the view
In your CAD software, position the 3D view as you want it to appear in the documentation (orientation, zoom). In FreeCAD, use the predefined views (isometric, front, top…) available in the View menu for a clean, reproducible framing.
Copy the image into docs/assets/images/ (under 2 MB), then in your page (here a page two folder levels deep, such as docs/conception/mecanique/pince.md):

The number of ../ depends on the depth of the page. Repeat the operation for each important part or view (exploded view, detail of an assembly).
As with electronics, the CAD model shows the intention; a photo
shows what was really assembled, with the adjustments made
along the way. Put them in docs/assets/images/.
Exercise
Export your assembly as STEP (in project/mcad/) and as GLB (in
docs/assets/models/), display the model on the page of your
subassembly, and fill in the manufacturing tables of project/mcad/ and
the bill of materials of your page with your real parts (material, process,
important tolerances).