Metadata-Version: 2.4
Name: makeusd
Version: 0.1.0
Summary: One file for 3D printing, AR preview, and parametric source
Project-URL: Homepage, https://github.com/daslabhq/makeusd
Project-URL: Repository, https://github.com/daslabhq/makeusd
Project-URL: Issues, https://github.com/daslabhq/makeusd/issues
Author-email: Mirko Kiefer <mirko@daslab.dev>
License-Expression: MIT
License-File: LICENSE
Keywords: 3d-printing,3mf,ar,openscad,openusd,usd,usdz
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Manufacturing
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Multimedia :: Graphics :: 3D Modeling
Requires-Python: >=3.9
Requires-Dist: click>=8.0
Requires-Dist: usd-core>=24.0
Description-Content-Type: text/markdown

# makeusd

One file for 3D printing, AR preview, and parametric source.

```
pip install makeusd
```

## What it does

`makeusd` packs your 3D designs into [USDZ](https://openusd.org) files that work everywhere:

- **Preview in AR** on iPhone, iPad, Vision Pro — tap to open, no app needed
- **Send to a slicer** — export to 3MF for BambuStudio, PrusaSlicer, OrcaSlicer
- **Keep the source** — embed your OpenSCAD or CadQuery files inside the USDZ
- **Multi-color** — each part gets its own PBR material with correct colors

One command. One file. Three capabilities.

## Quick start

### Pack STL files into a USDZ

```bash
# Two-color case: orange body, black logo
makeusd pack body.stl "#FF8C00" logo.stl "#1A1A1A" -o case.usdz
```

AirDrop `case.usdz` to your iPhone. Tap to preview in AR. Done.

### Export USDZ to 3MF for printing

```bash
makeusd export case.usdz -o case.3mf
```

Open `case.3mf` in BambuStudio. Colors are preserved. Print.

### Embed parametric source

```bash
# Pack STLs + embed the OpenSCAD source that generated them
makeusd pack body.stl "#FF8C00" logo.stl "#1A1A1A" \
  --source case.scad \
  --generator openscad \
  -o case.usdz
```

The `.scad` file is stored inside the USDZ (which is a ZIP). Anyone who receives the file can extract the source and rebuild.

### Inspect a USDZ

```bash
makeusd inspect case.usdz
```

```
case.usdz (101 KB)
  /Case (Xform)
    /Case/Body — Mesh, 2847 faces, material: OrangePBR (#FF8C00)
    /Case/Logo — Mesh, 1204 faces, material: BlackPBR (#1A1A1A)

  Bounds: 42.0 x 26.3 x 13.1 mm
  Up axis: Z
  Embedded source: case.scad (OpenSCAD)
```

## Commands

| Command | Description |
|---------|-------------|
| `makeusd pack` | Combine STL files + colors into a multi-material USDZ |
| `makeusd export` | Export USDZ meshes to 3MF or STL for printing |
| `makeusd inspect` | Show scene graph, materials, bounds, embedded files |
| `makeusd rebuild` | Extract embedded source, run generator, repack (requires OpenSCAD/CadQuery) |

## Why USDZ for 3D printing?

The 3D printing ecosystem is stuck on formats from the 1980s-2010s:

| Format | Year | Colors | Materials | AR Preview | Source | Hierarchy |
|--------|------|--------|-----------|------------|--------|-----------|
| STL | 1987 | No | No | No | No | No |
| OBJ | 1992 | Via MTL | Basic | No | No | No |
| 3MF | 2015 | Yes | Basic | No | No | Yes |
| **USDZ** | **2018** | **Yes** | **Full PBR** | **Native iOS/visionOS** | **Embeddable** | **Yes** |

USDZ is the only format that lets you preview your print in AR on your phone, send it to a slicer, and keep the parametric source — all in one file.

[OpenUSD](https://openusd.org) is backed by Pixar, Apple, NVIDIA, Adobe, and Autodesk. The [Alliance for OpenUSD](https://aousd.org) ratified Core Specification 1.0 in December 2025.

## As a Python library

```python
from makeusd import pack, export, inspect

# Pack STLs into USDZ
pack(
    parts=[("body.stl", "#FF8C00"), ("logo.stl", "#1A1A1A")],
    output="case.usdz",
    source="case.scad",
    generator="openscad",
)

# Export to 3MF
export("case.usdz", "case.3mf")

# Inspect
info = inspect("case.usdz")
print(info.bounds_mm)  # (42.0, 26.3, 13.1)
```

## Requirements

- Python 3.9+
- `usd-core` (Pixar's USD Python bindings)

```
pip install usd-core
```

OpenSCAD or CadQuery only needed for `rebuild` command.

## License

MIT

## Links

- [OpenUSD](https://openusd.org) — Universal Scene Description
- [AOUSD](https://aousd.org) — Alliance for OpenUSD
- [openusd-mcp](https://github.com/daslabhq/openusd-mcp) — MCP server for OpenUSD (also by Daslab)
- [Daslab](https://daslab.dev) — Where AI meets the physical world
