CM3D-014: Materials in the model, colour roles and Prusament filaments in the BOM
Context
The OCP CAD Viewer showed the machine in colour names from the OpenSCAD time, set in each module.
They did not look like the real parts and did not show how the machine will look.
The visible enclosures of the Pod and the Station will be printed in several PETG colours, and the colours follow the Station UI (gui/ui/theme/colors.slint in cocktail-maker).
All parts are PETG (CM3D-003), printed in Prusament.
build123d 0.13 brings bd_materials, which gives a shape a material with density and render values, and the viewer shows it in Studio mode.
The bill of materials listed the print jobs but no filament, and its design left the filament weight out.
Decision Drivers
-
One source per fact: the viewer and the bill of materials must name the same filament for a part.
-
A colour change without part changes: a new colour for the enclosure must not touch the part code.
-
Colours you can print: the viewer must show a filament that exists, not a colour of the UI.
-
Grams that match the print: the spools to buy come from the grams, so the grams must be close to what the printer uses.
Decision
Every viewer shape carries a bd_materials material: a printed part gets PETG in the colour of its filament, a purchased part the material it is bought in (cm3d.common.materials).
A print job names a colour role for each body (outside, accent, inside, label), and one colour scheme in cm3d.common.filaments gives each role a Prusament filament.
Each filament is a catalog item by the kg with a measured display colour.
The grams of each print job body come from PrusaSlicer by hand, with the date and the model volume at that time, and cm3d bom --check warns when the volume changes by more than 3 %.
Alternatives Considered
Slicing in the pipeline
cm3d slices the exported 3MF files with pinned PrusaSlicer profiles and reads the grams.
Rejected: PrusaSlicer becomes a tool that every clone needs, the profiles must be pinned, and the checks get slow.
Consequences
-
Good: the viewer shows the machine in its real filaments and metals, and a new scheme recolours it in one place.
-
Good: the purchasing page lists the Prusament spools with their need and price, and the print list names the filament of each job.
-
Bad: the grams are typed by hand, so each part must be sliced once and again after larger changes.
-
Bad: the display colours are measured swatches, not values from Prusa, so they are close but not exact.
-
Bad: a union in build123d drops the material, so the model code must set it on the final shape.