Bump to OCCT 8.0.1
Four mechanical binding edits; the bound Python surface is unchanged (sigdiff compared the 7.9.3.1 dump against 8.0.1.1's in both directions and found no class, member or constructor arity moved), so the app needs no change. - NCollection_Utf8String is gone; NCollection_String is the same UTF-8 type. Python name kept, since the app imports it. - Standard_Failure lost its Standard_Transient RTTI when it moved to deriving std::exception; ExceptionType() replaced DynamicType()->Name() and returns the same class names the exception dispatch keys on. - FindKey gained a size_t overload beside the int one, so the plain member pointer is ambiguous; overload_cast picks the int form, which keeps the negative-index guard. - StdPrs moved from TKService to TKV3d, so CMakeLists links both. The byte-identity fixtures did NOT retire, contrary to the watchlist: all six round-trip to the same digests under the new kernel, as do the measurement, history and mesh-count blocks, so tests/data is untouched and the app's content-addressed BREP payloads stay valid. Gates: binding suite 83 passed, 138/138 symbols, sigdiff clean both directions, ASAN clean, app suite 1798 passed / 1 skipped (unchanged), sweep over 4486 parts with anchors_digest and every status unchanged, -m perf 16% faster on the 32-feature chain.
This commit is contained in:
@@ -90,9 +90,12 @@ void register_occt_exceptions(nb::module_ &root) {
|
||||
} catch (const Standard_Failure &e) {
|
||||
// Dispatch on the dynamic OCCT type so the Python type name
|
||||
// matches what the kernel actually threw; anything we did not
|
||||
// bind falls back to the RuntimeError-derived base.
|
||||
// bind falls back to the RuntimeError-derived base. OCCT 8.0
|
||||
// dropped the Standard_Transient RTTI here (Standard_Failure
|
||||
// now derives std::exception); ExceptionType() is the virtual
|
||||
// that replaced it and returns the same class names.
|
||||
PyObject *type = g_base;
|
||||
const char *name = e.DynamicType()->Name();
|
||||
const char *name = e.ExceptionType();
|
||||
if (name) {
|
||||
auto it = g_exc_types.find(name);
|
||||
if (it != g_exc_types.end())
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
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.
|
||||
OCCT 8.0 rebuilt this as a template — GeomLProp_SLProps is now an alias for
|
||||
GeomLProp_SLPropsBase<handle<Geom_Surface>> — but kept the constructor and
|
||||
the accessors we bind, so the surface below is unchanged.
|
||||
*/
|
||||
|
||||
#include "../common/occt_module.h"
|
||||
|
||||
@@ -1,9 +1,13 @@
|
||||
/*
|
||||
OCP.NCollection — the UTF-8 string the font API takes.
|
||||
|
||||
NCollection_Utf8String is the only NCollection type the app names directly:
|
||||
it wraps the font path and the text to emboss. Constructed from a Python
|
||||
str, which nanobind hands over as UTF-8 already.
|
||||
This is the only NCollection type the app names directly: it wraps the font
|
||||
path and the text to emboss. Constructed from a Python str, which nanobind
|
||||
hands over as UTF-8 already.
|
||||
|
||||
OCCT 8.0 dropped the NCollection_Utf8String alias; NCollection_String is the
|
||||
same type (NCollection_UtfString<char>) and is what the font API takes. The
|
||||
Python name stays as it was — it is what the app imports.
|
||||
*/
|
||||
|
||||
#include "../common/occt_module.h"
|
||||
@@ -13,20 +17,20 @@
|
||||
void register_NCollection(nb::module_ &root) {
|
||||
nb::module_ m = ocp_submodule(root, "NCollection");
|
||||
|
||||
nb::class_<NCollection_Utf8String>(m, "NCollection_Utf8String")
|
||||
nb::class_<NCollection_String>(m, "NCollection_Utf8String")
|
||||
.def(nb::init<>())
|
||||
// Upstream also offers an explicit-length overload; the app always
|
||||
// passes a whole Python str, which arrives NUL-terminated, so only the
|
||||
// one-argument form is bound.
|
||||
.def(
|
||||
"__init__",
|
||||
[](NCollection_Utf8String *self, const char *text) {
|
||||
new (self) NCollection_Utf8String(text);
|
||||
[](NCollection_String *self, const char *text) {
|
||||
new (self) NCollection_String(text);
|
||||
},
|
||||
"theCopy"_a)
|
||||
.def("ToCString", &NCollection_Utf8String::ToCString)
|
||||
.def("Size", &NCollection_Utf8String::Size)
|
||||
.def("Length", &NCollection_Utf8String::Length)
|
||||
.def("IsEmpty", &NCollection_Utf8String::IsEmpty)
|
||||
.def("__str__", &NCollection_Utf8String::ToCString);
|
||||
.def("ToCString", &NCollection_String::ToCString)
|
||||
.def("Size", &NCollection_String::Size)
|
||||
.def("Length", &NCollection_String::Length)
|
||||
.def("IsEmpty", &NCollection_String::IsEmpty)
|
||||
.def("__str__", &NCollection_String::ToCString);
|
||||
}
|
||||
|
||||
@@ -5,11 +5,12 @@
|
||||
compound of face outlines, holes already subtracted, which it then extrudes
|
||||
into or out of the model.
|
||||
|
||||
These live in TKService, and both classes are real in 7.9.3 rather than the
|
||||
deprecated typedefs of Font_BRepFont/Font_BRepTextBuilder that OCCT 8.0
|
||||
turns them into — so the 8.0 port is a rename here and nothing else. The
|
||||
builder image already asserts TKService links without libGL or libX11, so
|
||||
binding them costs the runtime image nothing.
|
||||
Both are real classes, and the aliasing runs the opposite way from what the
|
||||
8.0 watchlist expected: Font_BRepFont/Font_BRepTextBuilder are the typedefs
|
||||
of these, not the reverse. What 8.0 did move is the package — StdPrs went
|
||||
from TKService to TKV3d, which is why CMakeLists links both. The builder
|
||||
image asserts neither pulls in libGL or libX11, so binding them costs the
|
||||
runtime image nothing.
|
||||
|
||||
Rendering a glyph is FreeType work with no Python in it, so it releases the
|
||||
GIL.
|
||||
|
||||
@@ -62,8 +62,13 @@ void register_TopTools(nb::module_ &root) {
|
||||
},
|
||||
"theKey"_a)
|
||||
.def("Contains", &TopTools_IndexedMapOfShape::Contains, "theKey"_a)
|
||||
.def("FindKey", &TopTools_IndexedMapOfShape::FindKey, "theIndex"_a,
|
||||
OCP_RETURN_COPY)
|
||||
// OCCT 8.0 added size_t index overloads beside the int ones, so the
|
||||
// plain member pointer is ambiguous; the int form keeps the negative
|
||||
// index guarded rather than wrapping it into a huge size_t.
|
||||
.def("FindKey",
|
||||
nb::overload_cast<Standard_Integer>(
|
||||
&TopTools_IndexedMapOfShape::FindKey, nb::const_),
|
||||
"theIndex"_a, OCP_RETURN_COPY)
|
||||
.def("FindIndex", &TopTools_IndexedMapOfShape::FindIndex, "theKey"_a)
|
||||
.def("Extent", &TopTools_IndexedMapOfShape::Extent)
|
||||
.def("Size", &TopTools_IndexedMapOfShape::Size)
|
||||
@@ -78,7 +83,10 @@ void register_TopTools(nb::module_ &root) {
|
||||
.def(nb::init<>())
|
||||
.def("Contains", &TopTools_IndexedDataMapOfShapeListOfShape::Contains,
|
||||
"theKey"_a)
|
||||
.def("FindKey", &TopTools_IndexedDataMapOfShapeListOfShape::FindKey,
|
||||
.def("FindKey",
|
||||
nb::overload_cast<Standard_Integer>(
|
||||
&TopTools_IndexedDataMapOfShapeListOfShape::FindKey,
|
||||
nb::const_),
|
||||
"theIndex"_a, OCP_RETURN_COPY)
|
||||
.def("FindIndex", &TopTools_IndexedDataMapOfShapeListOfShape::FindIndex,
|
||||
"theKey"_a)
|
||||
|
||||
Reference in New Issue
Block a user