Artifacts
An artifact is a CAD model that is produced by a function in your code.
To share the CAD model easily, you can use the @artifact decorator to mark the function that produces the artifact.
Artifact decorator arguments
You can pass optional arguments to @artifact to control how each artifact is treated and displayed:
| Argument | Type | Description |
|---|---|---|
sample |
bool |
Whether this is a sample artifact. Sample artifacts are CAD models created for testing, or other development purposes (e.g. a negative model), not for end-users. For example, you might export a small cut of a snap-fit (e.g. just the joint region) to test fit and tolerance; that part is for your own testing, not for the end user to print and use. |
cover |
bool |
Whether to use this artifact's snapshot as the repository cover image. Each repo can have one cover; if more than one artifact has cover=True, the first one is used. |
desc |
str |
Detailed description of the artifact, in Markdown format. You can also provide the description via the function's docstring. If both a docstring and desc are given, desc is used. |
short_desc |
str |
A short description of the artifact, for lists and previews. Should be less than 128 characters. |
export_step |
bool |
Whether to export the artifact as STEP. When omitted, the repository config default is used. |
export_3mf |
bool |
Whether to export the artifact as 3MF. When omitted, the repository config default is used. |
Example with arguments:
@artifact(sample=False, cover=True, short_desc="Main enclosure")
def enclosure():
"""Full enclosure with vent holes and mounting bosses."""
with Build() as build:
Box(100, 80, 50)
return build
Integration notes
- The library is designed to be non-intrusive: it fits into existing Build123D projects with minimal impact. Install
makerrepo, importartifactfrommr, and decorate the relevant functions. Your existing code and build flow stay the same. - CI on MakerRepo.com currently runs in a constrained environment (Build123D supported; other libraries may be limited). Will open up for custom build environments in the future.
- For a local or script-based workflow without the Git/CI path, you can use MakerRepo CLI to build artifacts from the command line. See MakerRepo CLI – Artifacts for the artifact commands.