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
This commit is contained in:
2026-08-10 19:52:52 +02:00
parent 091a2ad0cf
commit 2c2c4e4712
32 changed files with 2732 additions and 18 deletions

View File

@@ -0,0 +1,32 @@
/*
OCP.GeomLProp — local surface properties.
One use: text emboss reads the surface normal at the anchor's UV to decide
which way the glyph solid grows out of a curved face.
OCCT 8.0 supersedes this package with GeomProp/BRepProp (results come back
as structs carrying IsDefined flags instead of throwing). Only Normal()
is bound, so the port is a one-line move — see design.md's 8.0 watchlist.
*/
#include "../common/occt_module.h"
#include "../common/occt_policies.h"
#include <GeomLProp_SLProps.hxx>
#include <Geom_Surface.hxx>
#include <gp_Dir.hxx>
#include <gp_Pnt.hxx>
void register_GeomLProp(nb::module_ &root) {
nb::module_ m = ocp_submodule(root, "GeomLProp");
nb::class_<GeomLProp_SLProps>(m, "GeomLProp_SLProps")
.def(nb::init<const opencascade::handle<Geom_Surface> &, const Standard_Real,
const Standard_Real, const Standard_Integer,
const Standard_Real>(),
"S"_a, "U"_a, "V"_a, "N"_a, "Resolution"_a)
.def("Value", &GeomLProp_SLProps::Value, OCP_RETURN_COPY)
.def("Normal", &GeomLProp_SLProps::Normal, OCP_RETURN_COPY)
.def("IsNormalDefined", &GeomLProp_SLProps::IsNormalDefined)
.def("SetParameters", &GeomLProp_SLProps::SetParameters, "U"_a, "V"_a);
}