Files
ocp/pyproject.toml
stroblme 2c2c4e4712 10C Inc 1: core modeling
Binds the modeling core the app builds every feature out of — 93 of its 138
symbols now resolve, up from 34. New modules: GeomAbs, Geom2d, Geom,
TCollection, TColgp, TColStd, GProp, BRepGProp, Bnd, BRepBndLib, Adaptor3d,
BRepAdaptor, GeomLProp, GeomAPI, BRepBuilderAPI, BOPAlgo, BRepAlgoAPI,
BRepPrimAPI, GC, BRepMesh; gp and BRep_Tool completed.

Three structural decisions:

- BRepBuilderAPI_MakeShape carries Build/Shape/Generated/Modified/IsDeleted for
  every maker in the binding, so the booleans, the primitives and (later) the
  fillet builders all answer the app's duck-typed provenance layer through
  ordinary virtual dispatch. History lists come back copied, so they outlive
  the builder.
- The executing two-argument BRepAlgoAPI constructors stay unbound; operands go
  in through SetArguments/SetTools. Section keeps Init1/Init2, which are plain
  setters. BOPAlgo moved up from Inc 2 — SetGlue needs its enum.
- Adaptor3d is registered although the app never imports it: every method it
  calls on BRepAdaptor_Curve/Surface is a virtual declared there, so binding
  them once on the bases leaves mod_BRepAdaptor.cpp with just constructors.

Gate: tests/test_inc1_modeling.py against reference values gen_fixtures.py now
records from the stock wheel — measurements, per-face area/centroid in map
order, mesh counts, and the boolean history map compared exactly, since that is
the substrate the app's topological naming is built on.

tools/sigdiff.py compares our bound surface against stock's, because a wrong
nb::init<> is silent: MakePrism's five-argument form bound OCCT's semi-infinite
gp_Dir overload (gp_Dir converts from gp_Vec), producing a valid solid of the
wrong shape with the flags shifted along. The fixture digest caught it; sigdiff
finds the class of bug directly, and now reports only one deliberate deviation.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DfriM8XUkn7uYf5Dwe2xo6
2026-08-10 19:52:58 +02:00

47 lines
1.9 KiB
TOML

[build-system]
requires = ["scikit-build-core>=0.11", "nanobind>=2.7"]
build-backend = "scikit_build_core.build"
[project]
name = "n3xd-ocp"
# <occt-version>.N, so the kernel a wheel wraps is readable from its version
# alone and occt_version() keeps reporting the truth. Iteration builds carry a
# .devN suffix: the registry never allows republishing a version, and its
# cleanup rule collects only the dev ones. CMake asserts the prefix matches
# the OCCT it found.
version = "7.9.3.1.dev2"
description = "nanobind bindings for the OpenCASCADE geometry kernel (drop-in OCP)"
readme = "README.md"
requires-python = ">=3.12"
license = { text = "LGPL-2.1-only" }
authors = [{ name = "N3XD" }]
classifiers = [
"Private :: Do Not Upload",
"Programming Language :: Python :: 3.12",
"Programming Language :: C++",
]
[project.urls]
Repository = "https://git.stroblme.de/N3XD/ocp"
[tool.scikit-build]
minimum-version = "0.11"
build-dir = "build/{wheel_tag}"
wheel.packages = ["python/OCP", "python/n3xd_ocp"]
# Stubs are generated during the build and gitignored, and file selection is
# git-based by default — so they must be re-included by hand or the wheel ships
# without the typing surface that retires the backend's ty suppression.
sdist.include = ["python/OCP/*.pyi", "python/n3xd_ocp/*.pyi"]
# abi3 from day one, matching the forge/assay convention: one wheel spans 3.12
# and 3.13, so the interpreter bump (roadmap 10D) needs no rebuild here.
wheel.py-api = "cp312"
# No sdist is ever published — it could not build without the OCCT builder
# image, and offering one would invite the production host (4 cores) to try.
# That is enforced by only ever building wheels (scripts/build_wheel.sh) rather
# than by an exclude rule here: scikit-build-core feeds sdist.exclude into the
# wheel's package-file mapping too, so excluding "*" silently ships a wheel
# with the compiled extension and none of the Python package.
[tool.pytest.ini_options]
testpaths = ["tests"]