Creating Your First Component
Prev: Part 4a: Reading Code Examples
This quick “hello world” tutorial builds a minimal component and previews it in the visualizer.
You don’t need to understand the code yet—we’ll explain what each part does in later sections. The goal here is simply to create your first file and confirm that everything is working end‑to‑end.
Goal: create a component, label it, and confirm that it renders.
Step 1 — Import PyMFCAD
Step 2 — Create a component
Components are sized in pixels (x/y) and layers (z). You also define the physical resolution with px_size and layer_size (mm).
Step 3 — Add labels
Labels are named color groups used for visualization and organization.
Step 4 — Add a simple void
Step 5 — Add bulk
Step 6 — Preview
You should see a solid block with the “Hello World” void cut out.

Full example
Checkpoint
Ensure that:
- You can preview the component without errors.
- You can see the text void in the visualizer.