SBOM - Simple Bill of Materials
SBOM is a really simple BOM generation system for OpenSCAD.
SBOM is completely driven the OpenSCAD design and generates reStructuredText documents that can trivially be converted into PDF or HTML files. SBOM aggregates all of the parts found in the design into a simple tabular form.
While SBOM is intended for use with OpenSCAD it does not depend on this in any way and can be used with other applications.
SBOM parses the input file for lines of the following form:
- Tell SBOM to consider this line.
- Categorise part in a hierarchal namespace separated by colons (optional).
- Name of the part type.
- Parameters of this part.
For example an M6 bolt may be represented by:
If out input file contained the above line four times then we would get a table like this:
The way these can be used is pretty flexible but it comes down to:
- A BOM will contain a table for each part.
- These tables will be organised by namespace.
- The columns of the tables will contain the keys and aggregates values.
Every time a part is used in the design the line should be output again. We let SBOM do the counting for us.
Using SBOM with OpenSCAD
In OpenSCAD we can generate SBOM lines:
echo(str("BOM:hardware:bolt:size=M", size, ",length=", length));
Then we can generate a BOM:
openscad -o /tmp/null.stl model.scad 2>&1 | sbom -
Alternatively the output in the OpenSCAD console can be copied and pasted into a file then: