Metadata-Version: 2.4
Name: solidfunc
Version: 0.1.0a3
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Intended Audience :: Science/Research
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Programming Language :: Rust
Classifier: Typing :: Typed
License-File: LICENSE
License-File: licenses/SolidCore-ATTRIBUTION.md
License-File: licenses/SolidCore-LICENSE
License-File: licenses/SolidCore-NOTICE
Summary: An experimental functional Python API for SolidCore.
Keywords: cad,geometry,solidcore,functional
Author: David Straub
License-Expression: MIT
Requires-Python: >=3.11
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Issues, https://github.com/DavidMStraub/solidfunc/issues
Project-URL: Repository, https://github.com/DavidMStraub/solidfunc

# solidfunc

An experimental, typed, functional Python API for
[SolidCore](https://github.com/tangency-labs/solidcore). Build 3D solids from
primitives and planar profiles, transform and combine them, and export STEP.
This small academic project explores ideas from
[CadQuery](https://github.com/CadQuery/cadquery),
[build123d](https://github.com/gumyr/build123d), and
[CAD as Code](https://github.com/DavidMStraub/cad-as-code-book).

## Quickstart

To build from source, install [uv](https://docs.astral.sh/uv/) and
[Rust](https://rustup.rs/), then run these commands from the cloned repository.
solidfunc supports Python 3.11 and later.

```sh
uv sync --locked --config-setting build-args=--profile=dev
uv run --no-sync python examples/hello_world.py
```

To make your own part, save and run a Python script like this in that environment.

```python
import solidfunc as sf

block = sf.box(size_x=10, size_y=20, size_z=30)
moved = sf.translate(block, x=100)
sf.export_step(moved, "block.step")
```

Lengths are in millimetres. Operations preserve their inputs, and the exported
STEP AP242 file opens in CAD tools.

See the [API reference](API.md) for signatures, units, and geometry conventions.

## Viewing parts

Install PyVista separately with `pip install pyvista` in the same environment,
then call `show()` with a solidfunc shape.

```python
from solidfunc.view import show

show(moved)
```

Pass `screenshot="part.png"` to save a PNG. In Jupyter, `show()` displays a
static preview by default. For an interactive view, install `pyvista[jupyter]`
and pass `jupyter_backend="client"`.

![Bearing pillow block with a through-hole and four counterbored mounts](docs/pillow-block.png)

[Source for the bearing pillow block](examples/bearing_pillow_block.py)

## License

solidfunc is MIT licensed. SolidCore and its SMLib-derived code are Apache-2.0
licensed. The distribution includes the corresponding upstream notices.

