From 27f54862dcfa6b7d65ca8d86d25064199eeb8bc7 Mon Sep 17 00:00:00 2001 From: adam-urbanczyk <13981538+adam-urbanczyk@users.noreply.github.com> Date: Sat, 19 Sep 2026 13:21:07 +0200 Subject: [PATCH 1/3] Regression fix + dead conf removal --- conda/meta.yaml | 2 +- ocp.toml | 95 ++++++++++++++++++------------------------------- 2 files changed, 36 insertions(+), 61 deletions(-) diff --git a/conda/meta.yaml b/conda/meta.yaml index 4976f4ba7..fec4dcdf6 100644 --- a/conda/meta.yaml +++ b/conda/meta.yaml @@ -1,5 +1,5 @@ {% set OCCT_VER = "8.0.1" %} -{% set OCP_TWEAK = "0" %} +{% set OCP_TWEAK = "1" %} package: name: ocp diff --git a/ocp.toml b/ocp.toml index b841e0d7e..ee365ef3d 100644 --- a/ocp.toml +++ b/ocp.toml @@ -1449,7 +1449,7 @@ class Adaptor3d_Surface; [Attributes] - __version__ = "8.0.1.0" + __version__ = "8.0.1.1" [Modules] @@ -1534,10 +1534,6 @@ void register_template_NCollection_Vector(py::object &m, const char *name){ exclude_functions = ["OSD","OSD_OpenStream"] exclude_classes = ["OSD","OSD_FileSystem","OSD_CachedFileSystem","OSD_FileSystemSelector","OSD_LocalFileSystem"] exclude_methods = ["OSD_SharedLibrary::DlSymb"] - #"OSD_FileSystem::IsOpenIStream","OSD_FileSystem::IsOpenOStream","OSD_FileSystem::OpenOStream","OSD_FileSystem::OpenIStream", - #"OSD_CachedFileSystem::IsOpenIStream","OSD_CachedFileSystem::IsOpenOStream","OSD_CachedFileSystem::OpenOStream","OSD_CachedFileSystem::OpenIStream", - #"OSD_FileSystemSelector::IsOpenIStream","OSD_FileSystemSelector::IsOpenOStream","OSD_FileSystemSelector::OpenOStream","OSD_FileSystemSelector::OpenIStream", - #"OSD_LocalFileSystem::IsOpenIStream","OSD_LocalFileSystem::IsOpenOStream","OSD_LocalFileSystem::OpenOStream","OSD_LocalFileSystem::OpenIStream"] include_body_pre = 'py::class_>(m, "OSD_FileSystem");' @@ -1566,6 +1562,21 @@ void register_template_NCollection_Vector(py::object &m, const char *name){ exclude_constructors = ["string_view"] + include_body_post = """py::implicitly_convertible(); +py::implicitly_convertible();""" + + [[Modules.TCollection.Classes.TCollection_HAsciiString.additional_constructors]] + + body = "[](const std::string &s){ return TCollection_HAsciiString(s.c_str()); }" + help = "std::strings based constructor" + arguments = ["aString"] + + [[Modules.TCollection.Classes.TCollection_AsciiString.additional_constructors]] + + body = "[](const std::string &s){ return TCollection_AsciiString(s.c_str()); }" + help = "std::strings based constructor" + arguments = ["aString"] + [Modules.TColStd] exclude_typedefs = ["TColStd_DataMapOfIntegerTransient","TColStd","TColStd_DataMapOfTransientTransient","TColStd_IndexedDataMapOfTransientTransient"] @@ -1873,8 +1884,6 @@ auto OptionsForAttach = [](){return AIS_Manipulator::OptionsForAttach();};""" exclude_typedefs = ["Select3D_IndexedMapOfEntity","Graphic3d_Vec3d","Select3D_BndBox3d"] #couldn't deduce template parameter ‘Hasher’ - # exclude_methods = ["Select3D_SensitiveFace::GetPoints","Select3D_SensitivePoly::Points3D", "Select3D_InteriorSensitivePointSet::GetPoints"] - [Modules.Select3D.Classes.Select3D_SensitiveCircle] exclude_constructors = [0,1] #missing vftable @@ -2168,6 +2177,12 @@ struct __GLXFBConfigRec {};""" exclude_classes = ["StepData_EnumTool"] + [Modules.StepData.Classes.StepData_SelectType.additional_methods.SetValue] + + body = "[](StepData_SelectType &self , py::object& ent){self.SetValue(cast_pyobject(ent));}" + help = "SetValue supporting python objects" + arguments = ["ent"] + [Modules.LDOM] exclude_classes = ["LDOMString","LDOM_MemManager","LDOM_BasicText"] @@ -2185,7 +2200,6 @@ struct __GLXFBConfigRec {};""" [Modules.ShapeAnalysis] exclude_classes = ["ShapeAnalysis_BoxBndTreeSelector"] - # exlcude_methods = ["ShapeAnalysis_FreeBounds::ConnectEdgesToWires", "ShapeAnalysis_FreeBounds::ConnectWiresToWires","ShapeAnalysis_FreeBounds::SplitWires"] [Modules.V3d] @@ -2346,12 +2360,22 @@ using rapidjson::BasicOStreamWrapper;""" [Modules.Interface] - # exclude_methods = ["Interface_IntList::Internals", "Interface_STAT::Internals"] - [Modules.Interface.parsing_headers] "Interface_ValueInterpret.hxx" = "#include " + [Modules.Interface.Classes.Interface_InterfaceModel.additional_methods.AddEntity] + + body = "[](Interface_InterfaceModel &self , py::object& ent){self.AddEntity(cast_pyobject(ent));}" + help = "AddEntity supporting python objects" + arguments = ["anEnt"] + + [Modules.Interface.Classes.Interface_InterfaceModel.additional_methods.AddWithRefs] + + body = "[](Interface_InterfaceModel &self , py::object& ent){self.AddWithRefs(cast_pyobject(ent));}" + help = "AddWithRefs supporting python objects" + arguments = ["anEnt"] + [Modules.IVtkVTK] include_header_pre = """#include @@ -2449,8 +2473,6 @@ using rapidjson::BasicOStreamWrapper;""" [Modules.IGESGeom] - # exclude_methods = ["IGESGeom_SplineSurface::Polynomials"] - module_parsing_header = "#include " [Modules.IGESGraph] @@ -2463,8 +2485,6 @@ using rapidjson::BasicOStreamWrapper;""" [Modules.GeomConvert] - # exclude_methods = ["GeomConvert::ConcatG1","GeomConvert::ConcatC1","GeomConvert::C0BSplineToC1BSplineCurve","GeomConvert::C0BSplineToArrayOfC1BSplineCurve",] - [Modules.GeomConvert.parsing_headers] "GeomConvert_SurfToAnaSurf.hxx" = "class Geom_Curve; class gp_Ax3;" @@ -2568,52 +2588,7 @@ using rapidjson::BasicOStreamWrapper;""" [Modules.StepAP214] include_header_pre = "#include " - # - # [Modules.AppDef] - # - # exclude_methods = ["AppDef_SmoothCriterion::GetCurve","AppDef_LinearCriteria::GetCurve"] - # - # [Modules.BRepGProp] - # - # exclude_methods = ["BRepGProp_Face::GetUKnots", "BRepGProp_Face::GetTKnots", "BRepG_MeshCinert::PreparePolygon"] - # - # # [Modules.BSplCLib] - # # - # # exclude_methods =["BSplCLib::MergeBSplineKnots"] - # - # [Modules.Convert] - # - # exclude_methods = [ - # "Convert_CompPolynomialToPoles::Poles","Convert_CompPolynomialToPoles::Knots","Convert_CompPolynomialToPoles::Multiplicities", - # "Convert_ConicToBSplineCurve::BuildCosAndSin" - # ] - # - # [Modules.FEmTool] - # - # exclude_methods = ["FEmTool_Assembly::GetAssemblyTable"] - # - # [Modules.Geom2dConvert] - # - # exclude_methods = ["Geom2dConvert::ConcatG1","Geom2dConvert::ConcatC1","Geom2dConvert::C0BSplineToC1BSplineCurve","Geom2dConvert::C0BSplineToArrayOfC1BSplineCurve",] - # - # [Modules.GeomLib] - # - # exclude_methods = ["GeomLib::RemovePointsFromArray", "GeomLib::DensifyArray1OfReal"] - # - # [Modules.IntCurveSurface] - # - # exclude_methods = ["IntCurveSurface_TheHCurveTool::SamplePars"] - # - # [Modules.Plate] - # - # exclude_methods = ["Plate_Plate::CoefPol"] - # - # - # [Modules.ShapeExtend] - # - # exclude_methods = ["ShapeExtend::DispatchList"] - # - # + [Modules.math] exclude_methods = ["math_Matrix::operator="] # move assignemnt operator... From 5100d2883a0a8f17bae0e8a8bd1fc8a509f1dd70 Mon Sep 17 00:00:00 2001 From: adam-urbanczyk <13981538+adam-urbanczyk@users.noreply.github.com> Date: Sat, 19 Sep 2026 13:59:41 +0200 Subject: [PATCH 2/3] Copy/paste error fix --- ocp.toml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ocp.toml b/ocp.toml index ee365ef3d..2ad9d6195 100644 --- a/ocp.toml +++ b/ocp.toml @@ -1557,14 +1557,13 @@ void register_template_NCollection_Vector(py::object &m, const char *name){ "TCollection_ExtendedString::operator\\+=", "TCollection_ExtendedString::AssignCat", ] + include_body_post = """py::implicitly_convertible(); +py::implicitly_convertible();""" [Modules.TCollection.Classes.TCollection_ExtendedString] exclude_constructors = ["string_view"] - include_body_post = """py::implicitly_convertible(); -py::implicitly_convertible();""" - [[Modules.TCollection.Classes.TCollection_HAsciiString.additional_constructors]] body = "[](const std::string &s){ return TCollection_HAsciiString(s.c_str()); }" From 37143b35868413fa53b86e36967e1d9ac4348d20 Mon Sep 17 00:00:00 2001 From: adam-urbanczyk <13981538+adam-urbanczyk@users.noreply.github.com> Date: Mon, 21 Sep 2026 19:12:20 +0200 Subject: [PATCH 3/3] Test for the regression fix --- tests/test_step.py | 87 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 tests/test_step.py diff --git a/tests/test_step.py b/tests/test_step.py new file mode 100644 index 000000000..7ec5207ff --- /dev/null +++ b/tests/test_step.py @@ -0,0 +1,87 @@ +from OCP import Interface +from OCP.collections import ( + HArray1_StepRepr_RepresentationItem as StepRepr_HArray1OfRepresentationItem, +) +from OCP.GeomToStep import GeomToStep_MakeAxis2Placement3d +from OCP.gp import gp_Ax2, gp_Pnt +from OCP.IFSelect import IFSelect_ReturnStatus +from OCP.STEPCAFControl import STEPCAFControl_Writer +from OCP.STEPConstruct import STEPConstruct +from OCP.STEPControl import STEPControl_StepModelType +from OCP.StepData import StepData_Factors + +from OCP.StepRepr import ( + StepRepr_ConstructiveGeometryRepresentation, + StepRepr_ConstructiveGeometryRepresentationRelationship, +) +from OCP.StepShape import StepShape_ShapeDefinitionRepresentation +from OCP.TCollection import ( + TCollection_ExtendedString, + TCollection_HAsciiString, +) +from OCP.TDocStd import TDocStd_Document +from OCP.XCAFApp import XCAFApp_Application +from OCP.XCAFDoc import XCAFDoc_DocumentTool +from OCP.XmlXCAFDrivers import XmlXCAFDrivers +from OCP.XSControl import XSControl_WorkSession + +from OCP.BRepBuilderAPI import BRepBuilderAPI_MakeVertex + + +def _step_with_supplemental_geom(path: str, loc_name: str,) -> None: + + # create a doc and add a dummy vertex shape + app = XCAFApp_Application.GetApplication_s() + XmlXCAFDrivers.DefineFormat_s(app) + doc = TDocStd_Document(TCollection_ExtendedString("XmlXCAF")) + app.InitDocument(doc) + + tool = XCAFDoc_DocumentTool.ShapeTool_s(doc.Main()) + tool.AddShape(BRepBuilderAPI_MakeVertex(gp_Pnt(0, 0, 0)).Vertex(), False, True) + + # transfer the model to a STEP model + session = XSControl_WorkSession() + writer = STEPCAFControl_Writer(session, False) + writer.Transfer(doc, STEPControl_StepModelType.STEPControl_AsIs) + + model = session.Model() + + # add a extra named location + for i in range(model.NbEntities()): + ent = model.Value(i + 1) + + if isinstance(ent, StepShape_ShapeDefinitionRepresentation): + sdr = ent + break + + rep = sdr.UsedRepresentation() + + cs_array = StepRepr_HArray1OfRepresentationItem(1, 1) + + step_loc = GeomToStep_MakeAxis2Placement3d(gp_Ax2(), StepData_Factors()).Value() + step_loc.SetName(TCollection_HAsciiString(loc_name)) + + cs_array.SetValue(1, step_loc) + + cgr = StepRepr_ConstructiveGeometryRepresentation() + cgr.Init( + "Additional coordinate system", cs_array, rep.ContextOfItems(), + ) + + cgrr = StepRepr_ConstructiveGeometryRepresentationRelationship() + cgrr.Init("", "", rep, cgr) + + model.AddWithRefs(cgrr) + + status = writer.Write(path) + assert status == IFSelect_ReturnStatus.IFSelect_RetDone + + +def test_supplemental_geom(): + + _step_with_supplemental_geom("supplemental.step", "supplemental location") + + with open("supplemental.step") as f: + step = f.read() + + assert "supplemental location" in step