PYPI PACKAGE AUDIT v0.1.0a5 Paquete Saludable

solidfunc

Typed, functional Python CAD on SolidCore, a Rust B-rep kernel: an experiment in kernel dependence.

PyPkgScore solidfunc
Metodología y Criterios ♥ Donate
755 / 1000
Instalación Rápida
pip install solidfunc
1. Gobernanza
50/200
2. Metadatos PEP
200/200
3. Seguridad
150/200
4. Docs y SEO
155/200
5. Ingeniería CI
200/200
📣 Compartir Auditoría: Comparte este informe y la vista previa en el idioma actual
Advertisement
TELEMETRÍA PYPI

Descargas y Adopción en la Comunidad

Últimos 30 días (sin espejos)
Últimos 7 días
870
Últimos 30 días
1116
Total (180 días)
1116
Métrica / Ecosistema Estado / Valor Fuente
Downloads (30d / 180d) — PyPI Stats (without mirrors)
Trusted Publishing (PEP 740) ✕ Not detected PyPI Integrity / Sigstore
Django Packages — djangopackages.org
PyTech / PyPkgScore 755 / 1000 PyPkgScore Engine

Análisis de Salud e Ingeniería (5 Pilares)

1. Gobernanza y Comunidad50 / 200 ▾
LICENSE✓ 50 pts
SECURITY.md✕ 0 pts
CONTRIBUTING.md✕ 0 pts
CODE_OF_CONDUCT.md✕ 0 pts
2. Metadatos y Empaquetado PEP200 / 200 ▾
Wheel (.whl)✓ 50 pts
pyproject.toml✓ 50 pts
Project URLs✓ 50 pts
Trove Classifiers✓ 50 pts
3. Seguridad y Cadena de Suministro150 / 200 ▾
Cero CVEs (OSV)✓ 60 pts
Trusted Publishing (OIDC)✕ 0 pts
Snyk / Audit Link✓ 40 pts
Repositorio HTTPS✓ 50 pts
4. Documentación, SEO y Ecosistema155 / 200 ▾
README Estructurado✓ 60 pts
Read the Docs✓ 50 pts
Django Packages✕ 0 pts
Sitio Web / Artículos Técnicos✓ 45 pts
5. Ingeniería, CI y Calidad200 / 200 ▾
Pruebas Automatizadas✓ 65 pts
GitHub Actions CI✓ 65 pts
CHANGELOG.md✓ 35 pts
Env & Lockfile (uv/rye/poetry/pdm/hatch)✓ 35 pts
Advertisement
README & DOCS

Documentación Oficial y Guía de Uso — solidfunc

PyPI Metadata v0.1.0a5
Mostrar documentación original completa (README en inglés) ▾

solidfunc

PyPI Python CI License: MIT

solidfunc is a typed, functional Python library for code-based CAD, built on SolidCore, a B-rep geometry kernel written in Rust. You build solids from primitives and planar profiles, place and combine them, select faces and edges, round and chamfer edges, and export STEP files for use in other CAD tools.

Install

pip install solidfunc

Wheels are available for Linux, macOS, and Windows on Python 3.11 and later.

A first part

A plate with a hole whose rim is rounded, exported as STEP:

import solidfunc as sf

plate = sf.box(size_x=80, size_y=50, size_z=10)
hole = sf.cylinder(diameter=20, height=10)
part = plate - hole

top = max(sf.faces(part), key=lambda face: face.centroid[2])
hole_edge = [edge for edge in sf.edges(top) if edge.kind == "circle"]
part = sf.fillet(part, hole_edge, radius=2.0)

print(f"{sf.volume(part):.3f} mm³")
sf.export_step(part, "plate.step")

Every operation returns a new value and leaves its inputs unchanged. Lengths are in millimetres and angles in degrees. Selection is plain Python over typed face and edge data. See the API reference for signatures and conventions.

Gallery

Parts from the chapters of CAD as Code, rebuilt in solidfunc.

Clutch brick Battery tray
Clutch brick: studs placed on the top face with place() Battery tray: cell pockets, mirrored holes, and a lead-in round selected by radius
Swept elbow Round-to-rectangle duct
Swept elbow: a hollow section swept along a cornered path Duct: a loft from a circle to a rectangle

Viewing parts

Install PyVista with pip install pyvista, then call show():

from solidfunc.view import show

show(part)

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".

About this project

Motivation

The best-known open-source code-CAD libraries for Python, CadQuery and build123d, are built on the OpenCascade Technology (OCCT) kernel. SolidCore started as a Rust port of SMLib, the NURBS B-rep kernel that NVIDIA published as part of USD BRep, and has diverged from it since. solidfunc asks how much of a parametric code-CAD API depends on its kernel, and which of its ideas are properties of OCCT rather than of code-CAD in general.

Scope

solidfunc is a small academic experiment, not a replacement for CadQuery or build123d. For real work, use one of them. My book CAD as Code uses CadQuery's functional API throughout, and the first part above comes from chapter 2. solidfunc borrows many ideas from CadQuery and build123d.

Findings

  • SolidCore builds solids from geometric sketch records (segments, loops, regions), not from OCCT's topological edges and wires. solidfunc's Curve2D, Path2D, and Profile mirror those records, and topology (Face, Edge, Vertex) only exists inside a solid.
  • SolidCore stores a round on a straight edge as a cone with a zero half-angle, and revolve produces B-spline surfaces even for a cone or a sphere. solidfunc reports the first as a cylinder and documents the second, so selection by surface type depends on how the kernel stores surfaces.
  • SolidCore's booleans consume their operands, so solidfunc copies its inputs to keep every value unchanged.
  • SolidCore unites many bodies in one call, which became union(*shapes).

Coverage

solidfunc builds single solids from primitives, extrusions, revolutions, lofts, and sweeps, with booleans, placement, fillets and chamfers, face and edge queries, and STEP import and export. Assemblies, colours, open sheets and shells, and 2D operations on profiles are outside its scope. Releases are alphas, and the API can change between them.

Development

The repository includes a dev container in .devcontainer/ with the pinned Python and Rust toolchains, uv, and the OCP CAD Viewer extension. Opening the repository in it builds solidfunc and installs CadQuery for the STEP exchange tests.

To build from source without it, install uv and Rust, then run from the cloned repository:

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

examples/render_gallery.py regenerates the gallery images.

Citing

If you use solidfunc in your work, please cite it; GitHub's "Cite this repository" button gives the reference from CITATION.cff.

License

solidfunc is MIT licensed. SolidCore and the SMLib code it derives from (USD BRep) are Apache-2.0 licensed. The distribution includes the corresponding upstream notices. solidfunc is not affiliated with or endorsed by NVIDIA.