From 0ac022348f3c4c91bbd612d7290c2ed4b10cfcbc Mon Sep 17 00:00:00 2001 From: Andrew Pan Date: Tue, 12 Aug 2025 20:40:31 -0400 Subject: [PATCH 1/8] maintainers: add tnytown --- maintainers/maintainer-list.nix | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index 652942913ac82..e8dbb01b79c42 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -26902,6 +26902,11 @@ githubId = 9853194; name = "Philipp Bartsch"; }; + tnytown = { + github = "tnytown"; + githubId = 3821575; + name = "Andrew Pan"; + }; toast = { name = "Toast"; github = "toast003"; From 7525696a119359e6bb34e5603f9af4f1fbeaff6a Mon Sep 17 00:00:00 2001 From: Andrew Pan Date: Tue, 12 Aug 2025 20:41:55 -0400 Subject: [PATCH 2/8] python3Packages.trianglesolver: init at 1.2 --- .../python-modules/trianglesolver/default.nix | 33 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 ++ 2 files changed, 35 insertions(+) create mode 100644 pkgs/development/python-modules/trianglesolver/default.nix diff --git a/pkgs/development/python-modules/trianglesolver/default.nix b/pkgs/development/python-modules/trianglesolver/default.nix new file mode 100644 index 0000000000000..09ee5c7a230cf --- /dev/null +++ b/pkgs/development/python-modules/trianglesolver/default.nix @@ -0,0 +1,33 @@ +{ + lib, + buildPythonPackage, + fetchPypi, + setuptools, +}: +buildPythonPackage rec { + pname = "trianglesolver"; + version = "1.2"; + pyproject = true; + + src = fetchPypi { + inherit pname version; + hash = "sha256-SvGKreV51cDWQ4mz5lrq8Gz/JjGXYszYWeMmhVmnauo="; + }; + + build-system = [ setuptools ]; + + checkPhase = '' + runHook preCheck + + python -c 'import trianglesolver; trianglesolver.run_lots_of_tests()' + + runHook postCheck + ''; + + meta = { + description = "Finds all the sides and angles of a triangle, if you know some of the sides and/or angles"; + homepage = "https://pypi.org/project/trianglesolver/"; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ tnytown ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 40b9b4f175c2c..3332c2b9fc2f2 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -19380,6 +19380,8 @@ self: super: with self; { pinentry = pkgs.pinentry-curses; }; + trianglesolver = callPackage ../development/python-modules/trianglesolver { }; + trie = callPackage ../development/python-modules/trie { }; triggercmd = callPackage ../development/python-modules/triggercmd { }; From e639fdfb9b45123ce2951c1467a9d299e476f978 Mon Sep 17 00:00:00 2001 From: Andrew Pan Date: Tue, 12 Aug 2025 20:42:27 -0400 Subject: [PATCH 3/8] python3Packages.lib3mf: init at 2.4.1.post1 --- .../python-modules/lib3mf/default.nix | 47 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 49 insertions(+) create mode 100644 pkgs/development/python-modules/lib3mf/default.nix diff --git a/pkgs/development/python-modules/lib3mf/default.nix b/pkgs/development/python-modules/lib3mf/default.nix new file mode 100644 index 0000000000000..a009add7ae958 --- /dev/null +++ b/pkgs/development/python-modules/lib3mf/default.nix @@ -0,0 +1,47 @@ +{ + lib, + pkgs, + stdenv, + fetchFromGitHub, + buildPythonPackage, + setuptools, +}: + +let + version = "2.4.1.post1"; + soext = stdenv.hostPlatform.extensions.sharedLibrary; + lib3mf-lib = pkgs.lib3mf; +in +buildPythonPackage { + pname = "lib3mf"; + inherit version; + pyproject = true; + + src = fetchFromGitHub { + owner = "3MFConsortium"; + repo = "lib3mf_python"; + rev = "v${version}"; + hash = "sha256-2rj/dk4fpld9+EBI9fmYY5LLiuwoAGmMU8ar0f5Zwd8="; + }; + + build-system = [ setuptools ]; + + postPatch = '' + echo "include lib3mf/lib3mf${soext}" > MANIFEST.in + ''; + + pythonImportsCheck = [ "lib3mf" ]; + + prePatch = '' + rm lib3mf/lib3mf.{dll,dylib,so} + cp -L ${lib.getLib lib3mf-lib}/lib/lib3mf${soext} lib3mf/ + ''; + + meta = { + broken = (lib.versions.majorMinor version) != (lib.versions.majorMinor lib3mf-lib.version); + description = "Python bindings to lib3mf"; + homepage = "https://github.com/3MFConsortium/lib3mf_python"; + license = lib.licenses.bsd3; + maintainers = with lib.maintainers; [ tnytown ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 3332c2b9fc2f2..dbfa2a84d9a5a 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -8489,6 +8489,8 @@ self: super: with self; { lhapdf = toPythonModule (pkgs.lhapdf.override { python3 = python; }); + lib3mf = callPackage ../development/python-modules/lib3mf { }; + lib4package = callPackage ../development/python-modules/lib4package { }; lib4sbom = callPackage ../development/python-modules/lib4sbom { }; From 6a60f5a1c38e00e2a111025eee340e288a8e3bb5 Mon Sep 17 00:00:00 2001 From: Andrew Pan Date: Mon, 9 Feb 2026 02:01:24 -0500 Subject: [PATCH 4/8] opencascade-occt_7_8_1: init --- pkgs/top-level/all-packages.nix | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index e5ba614c0639d..e232971c61c5f 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -7281,6 +7281,17 @@ with pkgs; }; }; + opencascade-occt_7_8_1 = opencascade-occt.overrideAttrs { + pname = "opencascade-occt"; + version = "7.8.1"; + src = fetchFromGitHub { + owner = "Open-Cascade-SAS"; + repo = "OCCT"; + rev = "V7_8_1"; + sha256 = "sha256-tg71cFx9HZ471T/3No9CeEHi8VSo0ZITIuNfTSNB2qU="; + }; + }; + opencv4 = callPackage ../development/libraries/opencv/4.x.nix { pythonPackages = python3Packages; # TODO: LTO does not work. From 5a204b9df5b85992fd663537af3fd24c025b59eb Mon Sep 17 00:00:00 2001 From: Andrew Pan Date: Tue, 12 Aug 2025 20:43:03 -0400 Subject: [PATCH 5/8] python3Packages.cadquery-ocp: init at 7.8.1.2 --- .../cadquery-ocp/cmake-fixes-7_9.patch | 126 ++ .../cmake-implicit-includes-darwin.patch | 30 + .../python-modules/cadquery-ocp/default.nix | 104 ++ .../cadquery-ocp/ocp-sources.nix | 135 ++ .../python-modules/cadquery-ocp/ocp.toml | 1438 +++++++++++++++++ .../cadquery-ocp/settings-overlay.nix | 50 + pkgs/top-level/python-packages.nix | 2 + 7 files changed, 1885 insertions(+) create mode 100644 pkgs/development/python-modules/cadquery-ocp/cmake-fixes-7_9.patch create mode 100644 pkgs/development/python-modules/cadquery-ocp/cmake-implicit-includes-darwin.patch create mode 100644 pkgs/development/python-modules/cadquery-ocp/default.nix create mode 100644 pkgs/development/python-modules/cadquery-ocp/ocp-sources.nix create mode 100644 pkgs/development/python-modules/cadquery-ocp/ocp.toml create mode 100644 pkgs/development/python-modules/cadquery-ocp/settings-overlay.nix diff --git a/pkgs/development/python-modules/cadquery-ocp/cmake-fixes-7_9.patch b/pkgs/development/python-modules/cadquery-ocp/cmake-fixes-7_9.patch new file mode 100644 index 0000000000000..954e9b58f0bab --- /dev/null +++ b/pkgs/development/python-modules/cadquery-ocp/cmake-fixes-7_9.patch @@ -0,0 +1,126 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index d0065b17..2cf2d390 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -15,7 +15,9 @@ find_package( VTK REQUIRED + CommonExecutionModel + freetype + ) ++ + message(STATUS "VTK ${VTK_VERSION} found") ++ + find_package( RapidJSON REQUIRED ) + find_package( Clang REQUIRED ) + +@@ -23,24 +25,33 @@ set( Python_FIND_VIRTUALENV FIRST ) + find_package( Python 3.9 COMPONENTS Interpreter Development REQUIRED ) + + # find OCCT and dump symbols +-find_package( OpenCASCADE REQUIRED ) ++if(OCCT_LIB_DIR) ++ file(GLOB occt_libs LIST_DIRECTORIES false ${OCCT_LIB_DIR} ) ++else() ++ find_package( OpenCASCADE REQUIRED ) + +-foreach(target ${OpenCASCADE_LIBRARIES} ) +- get_target_property(loc ${target} IMPORTED_LOCATION_RELEASE) +- list( APPEND occt_libs ${loc} ) +-endforeach() ++ foreach(target ${OpenCASCADE_LIBRARIES} ) ++ get_target_property(loc ${target} IMPORTED_LOCATION_RELEASE) ++ list( APPEND occt_libs ${loc} ) ++ endforeach() ++endif() + + execute_process( + COMMAND + ${Python_EXECUTABLE} +- dump_symbols.py ++ ${CMAKE_SOURCE_DIR}/dump_symbols.py + "${occt_libs}" +- ) +- ++ WORKING_DIRECTORY ${CMAKE_BINARY_DIR} ++) + + get_target_property( LIBCLANG_PATH libclang IMPORTED_LOCATION_RELEASE ) + get_target_property( VTK_INCLUDE_DIR VTK::CommonCore INTERFACE_INCLUDE_DIRECTORIES ) + ++# for some reason I get multiple generator expressions ++string(REPLACE ">" ">;" VTK_INCLUDE_DIR ${VTK_INCLUDE_DIR}) ++list(GET VTK_INCLUDE_DIR 0 VTK_INCLUDE_DIR) ++ ++message( STATUS "Include dirs: ${VTK_INCLUDE_DIR}") + message( STATUS "Include dirs: ${CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES}") + + if(NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") +@@ -51,38 +62,40 @@ else() + list( APPEND CXX_INCLUDES -i /opt/usr/local/include/c++/v1/ -i /opt/usr/local/include/ ) + endif() + +-if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows") +- set(PLATFORM Windows) +-elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") +- set(PLATFORM OSX) ++if(PLATFORM) ++ message( STATUS "Requested platform: ${PLATFORM}") + else() +- set(PLATFORM Linux) ++ message( STATUS "Platform not specified.") ++ ++ if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows") ++ set(PLATFORM Windows) ++ elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") ++ set(PLATFORM OSX) ++ else() ++ set(PLATFORM Linux) ++ endif() + endif() + + set(ENV{PYTHONPATH} ${CMAKE_SOURCE_DIR}/pywrap ) + +-if( NOT EXISTS ${CMAKE_SOURCE_DIR}/OCP ) +- message( STATUS "Running pywrap") +- execute_process( +- COMMAND +- ${Python_EXECUTABLE} +- -m bindgen +- -n ${N_PROC} +- -l ${LIBCLANG_PATH} +- -i ${CLANG_INCLUDE_DIRS}/ +- -i ${VTK_INCLUDE_DIR}/ +- -i ${CLANG_INSTALL_PREFIX}/lib/clang/${LLVM_VERSION}/include/ +- ${CXX_INCLUDES} +- all ocp.toml ${PLATFORM} +- WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} +- COMMAND_ECHO STDOUT +- RESULT_VARIABLE PYWRAP_RESULT +- ) +- +- if( ${PYWRAP_RESULT} GREATER 0) +- message(FATAL_ERROR "Pywrap call failed") +- endif() +- +-endif() ++add_custom_command( ++ OUTPUT ${CMAKE_SOURCE_DIR}/OCP/CMakeLists.txt ++ COMMAND ++ ${CMAKE_COMMAND} -E env "PYTHONPATH=${CMAKE_SOURCE_DIR}/pywrap" ++ ${Python_EXECUTABLE} ++ -m bindgen ++ -n ${N_PROC} ++ -l ${LIBCLANG_PATH} ++ -i ${CLANG_INCLUDE_DIRS}/ ++ -i ${VTK_INCLUDE_DIR}/ ++ -i ${CLANG_INSTALL_PREFIX}/lib/clang/${LLVM_VERSION_MAJOR}/include/ ++ -p ${CMAKE_SOURCE_DIR} ++ ${CXX_INCLUDES} ++ all ${CMAKE_SOURCE_DIR}/ocp.toml ${PLATFORM} ++ WORKING_DIRECTORY ${CMAKE_BINARY_DIR} ++ DEPENDS ${CMAKE_SOURCE_DIR}/ocp.toml ++ USES_TERMINAL ++ COMMENT "Running pywrap" ++) + +-add_subdirectory( ${CMAKE_SOURCE_DIR}/OCP ) ++add_custom_target(pywrap ALL DEPENDS ${CMAKE_SOURCE_DIR}/OCP/CMakeLists.txt) diff --git a/pkgs/development/python-modules/cadquery-ocp/cmake-implicit-includes-darwin.patch b/pkgs/development/python-modules/cadquery-ocp/cmake-implicit-includes-darwin.patch new file mode 100644 index 0000000000000..e7dd2aa53446f --- /dev/null +++ b/pkgs/development/python-modules/cadquery-ocp/cmake-implicit-includes-darwin.patch @@ -0,0 +1,30 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 2cf2d390..691fe54c 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -54,13 +54,9 @@ list(GET VTK_INCLUDE_DIR 0 VTK_INCLUDE_DIR) + message( STATUS "Include dirs: ${VTK_INCLUDE_DIR}") + message( STATUS "Include dirs: ${CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES}") + +-if(NOT ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") +- foreach( inc IN LISTS CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES) +- list( APPEND CXX_INCLUDES -i ${inc}/ ) +- endforeach() +-else() +- list( APPEND CXX_INCLUDES -i /opt/usr/local/include/c++/v1/ -i /opt/usr/local/include/ ) +-endif() ++foreach( inc IN LISTS CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES) ++ list( APPEND CXX_INCLUDES -i ${inc}/ ) ++endforeach() + + if(PLATFORM) + message( STATUS "Requested platform: ${PLATFORM}") +@@ -86,8 +82,6 @@ add_custom_command( + -m bindgen + -n ${N_PROC} + -l ${LIBCLANG_PATH} +- -i ${CLANG_INCLUDE_DIRS}/ + -i ${VTK_INCLUDE_DIR}/ +- -i ${CLANG_INSTALL_PREFIX}/lib/clang/${LLVM_VERSION_MAJOR}/include/ + -p ${CMAKE_SOURCE_DIR} + ${CXX_INCLUDES} diff --git a/pkgs/development/python-modules/cadquery-ocp/default.nix b/pkgs/development/python-modules/cadquery-ocp/default.nix new file mode 100644 index 0000000000000..08bd0012d58e8 --- /dev/null +++ b/pkgs/development/python-modules/cadquery-ocp/default.nix @@ -0,0 +1,104 @@ +{ + lib, + stdenv, + fetchFromGitHub, + callPackage, + + mkPythonMetaPackage, + python, + pythonImportsCheckHook, + toPythonModule, + + llvmPackages_20, + cmake, + ninja, + yj, + + apple-sdk, + pybind11, + vtk, +}: + +let + # Upstream requires a minimum of LLVM 20. + llvmPackages = llvmPackages_20; + + # On Linux, we need to use a non-libcxx stdenv as we are compiling against + # libraries built with libstdc++. On the other hand, the ocp-sources + # derivation requires libcxx for unknowable reasons. + stdenv = llvmPackages.stdenv; + + pythonBuildEnv = python.withPackages ( + ps: with ps; [ + click + lief + path + (libclang.override { inherit llvmPackages; }) + toml + pandas + joblib + tqdm + jinja2 + toposort + logzero + pyparsing + pybind11 + schema + ] + ); + + ocp-sources = callPackage ./ocp-sources.nix { inherit llvmPackages pythonBuildEnv; }; + inherit (ocp-sources) version; +in +toPythonModule ( + stdenv.mkDerivation (finalAttrs: { + pname = "cadquery-ocp"; + inherit version; + src = ocp-sources; + + nativeBuildInputs = + ocp-sources.nativeBuildInputs + ++ lib.optional (stdenv.buildPlatform == stdenv.hostPlatform) pythonImportsCheckHook; + inherit (ocp-sources) buildInputs; + + propagatedBuildInputs = [ + (mkPythonMetaPackage { + inherit (finalAttrs) pname version meta; + dependencies = [ vtk ]; + }) + ]; + + env = { + NIX_CFLAGS_COMPILE = "-Wno-deprecated-declarations"; + }; + + cmakeFlags = [ (lib.cmakeFeature "Python_ROOT_DIR" "${pythonBuildEnv}") ]; + + separateDebugInfo = true; + + installPhase = + let + destDir = "$out/${python.sitePackages}"; + in + '' + runHook preInstall + + mkdir -p ${destDir} + cp ./*.so ${destDir} + + runHook postInstall + ''; + + pythonImportsCheck = [ + "OCP" + "OCP.gp" + ]; + + meta = { + description = "Python wrapper for OCCT generated using pywrap"; + homepage = "https://github.com/CadQuery/OCP"; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ tnytown ]; + }; + }) +) diff --git a/pkgs/development/python-modules/cadquery-ocp/ocp-sources.nix b/pkgs/development/python-modules/cadquery-ocp/ocp-sources.nix new file mode 100644 index 0000000000000..5c33cd553853b --- /dev/null +++ b/pkgs/development/python-modules/cadquery-ocp/ocp-sources.nix @@ -0,0 +1,135 @@ +{ + lib, + writers, + fetchFromGitHub, + + llvmPackages, + cmake, + ninja, + + apple-sdk, + fontconfig, + freetype, + libglvnd, + libx11, + nlohmann_json, + opencascade-occt_7_8_1, + pybind11, + rapidjson, + utf8cpp, + vtk, + xorgproto, + + pythonBuildEnv, +}: +let + version = "7.8.1.2"; + + stdenv = llvmPackages.libcxxStdenv; + + srcs = { + ocp = fetchFromGitHub { + owner = "CadQuery"; + repo = "OCP"; + rev = version; + hash = "sha256-vWAqCGgs7YnwHRhPAXkBQqCs+Y3zk4BMu1boZo3PLGA="; + name = "ocp"; + }; + + pywrap = fetchFromGitHub { + owner = "CadQuery"; + repo = "pywrap"; + + # revision used in OCP 7.9 + # remove this fetch when bumping OCP and use `fetchSubmodules` above + rev = "7e08fe91a582533c0e668b90cc48ded726639094"; + hash = "sha256-Ju2CGJ0fAuh53xA7muaf1mAoqHUI5hc6VJEcjJVxxjU="; + name = "pywrap"; + }; + }; + + opencascade-occt' = opencascade-occt_7_8_1.override { + inherit vtk; + withVtk = true; + }; +in +stdenv.mkDerivation { + pname = "ocp-sources"; + inherit version; + + srcs = [ + srcs.ocp + srcs.pywrap + ]; + + sourceRoot = srcs.ocp.name; + + postUnpack = '' + cp -rf ${srcs.pywrap.name} ${srcs.ocp.name} + ''; + + nativeBuildInputs = [ + cmake + ninja + ]; + + buildInputs = [ + fontconfig + freetype + libglvnd + libx11 + nlohmann_json + opencascade-occt' + pybind11 + rapidjson + utf8cpp + vtk + xorgproto + + llvmPackages.openmp + llvmPackages.llvm + llvmPackages.libclang + ]; + + patches = [ + # backported CMakeLists and pywrap from 7.9, remove on version bump + ./cmake-fixes-7_9.patch + + # Use CXX_IMPLICIT_INCLUDE_DIRECTORIES for header discovery on Darwin + ./cmake-implicit-includes-darwin.patch + ]; + + # Apply patches for OCP settings + # + # NOTE: ocp.toml comes from upstream and should be refreshed on version bumps. + # We check it in to nixpkgs to avoid IFD. + postPatch = + let + old = builtins.fromTOML (builtins.readFile ./ocp.toml); + overlay = import ./settings-overlay.nix { inherit lib stdenv apple-sdk; }; + new = lib.recursiveUpdate old overlay; + in + '' + cp ${writers.writeTOML "ocp.toml" new} ocp.toml + ''; + + preConfigure = '' + cmakeFlagsArray+=( + "-DN_PROC=$NIX_BUILD_CORES" + ) + ''; + + cmakeFlags = [ + (lib.cmakeFeature "Python_ROOT_DIR" "${pythonBuildEnv}") + ]; + dontUseCmakeBuildDir = true; + + installPhase = '' + runHook preInstall + + mkdir $out + cp -r OCP/* $out + + runHook postInstall + ''; +} diff --git a/pkgs/development/python-modules/cadquery-ocp/ocp.toml b/pkgs/development/python-modules/cadquery-ocp/ocp.toml new file mode 100644 index 0000000000000..15d81ae8335c6 --- /dev/null +++ b/pkgs/development/python-modules/cadquery-ocp/ocp.toml @@ -0,0 +1,1438 @@ +name = "OCP" +input_folder = "./opencascade" +output_folder = "./OCP" +template_path = "./templates" + +additional_files = ["pystreambuf.h","vtk_pybind.h"] + +pats = ["{}_*.hxx","{}.hxx"] + +modules = ["Standard", +"gp", +"math", +"BVH", +"NCollection", +"TColgp", +"OSD", +"Quantity", +"Storage", +"FSD", +"MMgt", +"TCollection", +"TColStd", +"Message", +"StdFail", +"TShort", +"Plugin", +"Resource", +"Units", +"UnitsAPI", +"TopLoc", +"Poly", +"Precision", +"Expr", +"ExprIntrp", +"GeomAbs", +"PLib", +"BSplCLib", +"BSplSLib", +"Bnd", +"CSLib", +"Convert", +"ElCLib", +"ElSLib", +"Adaptor2d", +"Geom2d", +"Geom2dAdaptor", +"Geom2dEvaluator", +"LProp", +"Geom2dLProp", +"TColGeom2d", +"Adaptor3d", +"AdvApprox", +"GProp", +"Geom", +"GeomAdaptor", +"GeomEvaluator", +"GeomLProp", +"LProp3d", +"TColGeom", +"TopAbs", +"AdvApp2Var", +"AppCont", +"AppParCurves", +"Approx", +"AppDef", +"BndLib", +"CPnts", +"Extrema", +"FEmTool", +"GC", +"GCE2d", +"GCPnts", +"Geom2dConvert", +"GeomConvert", +"GeomLib", +"GeomProjLib", +"GeomTools", +"Hermit", +"IntAna", +"IntAna2d", +"ProjLib", +"gce", +"TopoDS", +"BRep", +"BRepAdaptor", +"BRepLProp", +"TopTools", +"BRepTools", +"BinTools", +"TopExp", +"AppBlend", +#"ApproxInt", +"FairCurve", +"GccAna", +"GccEnt", +"GccInt", +"Geom2dAPI", +"Geom2dGcc", +"IntRes2d", +"Intf", +"Geom2dInt", +"Geom2dHatch", +"GeomAPI", +"GeomFill", +"GeomInt", +"GeomPlate", +"Hatch", +"HatchGen", +"IntCurve", +"IntCurveSurface", +"IntImp", +"IntImpParGen", +"IntPatch", +"IntPolyh", +"IntStart", +"IntSurf", +#"IntWalk", +"Law", +"LocalAnalysis", +"NLPlate", +"Plate", +"TopClass", +"TopTrans", +"BRepApprox", +"BRepBndLib", +"BRepBuilderAPI", +"BRepCheck", +"BRepClass", +"BRepClass3d", +"BRepExtrema", +"BRepGProp", +"BRepIntCurveSurface", +"BRepLib", +"BRepMAT2d", +"BRepTopAdaptor", +"Bisector", +"IntCurvesFace", +"MAT", +"MAT2d", +"BRepPrim", +"BRepPrimAPI", +"BRepSweep", +"Sweep", +"ShapeAlgo", +"ShapeAnalysis", +"ShapeBuild", +"ShapeConstruct", +"ShapeCustom", +"ShapeExtend", +"ShapeFix", +"ShapeProcess", +"ShapeProcessAPI", +"ShapeUpgrade", +"Contap", +"HLRAlgo", +"HLRAppli", +"HLRBRep", +"HLRTopoBRep", +"Intrv", +"TopBas", +"TopCnx", +"BRepMesh", +"XBRepMesh", +"BOPAlgo", +"BOPDS", +"BOPTools", +"BRepAlgoAPI", +"IntTools", +"BRepAlgo", +"BRepFill", +"BRepProj", +"TopOpeBRep", +"TopOpeBRepBuild", +"TopOpeBRepDS", +"TopOpeBRepTool", +"BRepFeat", +"LocOpe", +"Blend", +"BRepBlend", +"BRepFilletAPI", +"BlendFunc", +"ChFi2d", +"ChFi3d", +"ChFiDS", +#"ChFiKPart", +"FilletSurf", +"BRepOffset", +"BRepOffsetAPI", +"BiTgte", +"Draft", +"Aspect", +"Font", +"Image", +"InterfaceGraphic", +"SelectBasics", +#"TColQuantity", +"Graphic3d", +"Prs3d", +"PrsMgr", +"SelectMgr", +"AIS", +"DsgPrs", +"Select3D", +"StdPrs", +"StdSelect", +"V3d", +"OpenGl", +"MeshVS", +"NIS", +"Voxel", +"CDM", +"CDF", +"LDOM", +"PCDM", +"UTL", +"TDF", +"TDataStd", +"TDocStd", +"AppStdL", +"TFunction", +"BinLDrivers", +"BinMDF", +"BinMDataStd", +"BinMDocStd", +"BinMFunction", +"BinObjMgt", +"AppStd", +"TDataXtd", +"TNaming", +"TObj", +"XmlLDrivers", +"XmlMDF", +"XmlMDataStd", +"XmlMDocStd", +"XmlMFunction", +"XmlObjMgt", +"StdLDrivers", +"StdObjMgt", +"StdLPersistent", +"BinDrivers", +"BinMDataXtd", +"BinMNaming", +"BinTObjDrivers", +"TPrsStd", +"XmlDrivers", +"XmlMDataXtd", +"XmlMNaming", +"XmlTObjDrivers", +"StdDrivers", +"StdObject", +"StdPersistent", +#"ShapePersistent", #Need to implement inner typdefs parsing to wrap this properly +"StdStorage", +"RWStl", +"StlAPI", +"RWStepBasic", +"RWStepGeom", +"RWStepRepr", +"RWStepShape", +"StepBasic", +"StepGeom", +"StepRepr", +"StepShape", +"RWStepDimTol", +"RWStepVisual", +"StepDimTol", +"StepVisual", +"RWStepElement", +"RWStepFEA", +"StepElement", +"StepFEA", +"GeomToStep", +"RWStepAP203", +"RWStepAP214", +"RWStepAP242", +"STEPConstruct", +"STEPControl", +"STEPEdit", +"STEPSelections", +"StepAP203", +"StepAP209", +"StepAP214", +"StepAP242", +"StepToGeom", +"StepToTopoDS", +"TopoDSToStep", +"BRepToIGES", +"BRepToIGESBRep", +"Geom2dToIGES", +"GeomToIGES", +"IGESAppli", +"IGESBasic", +"IGESControl", +"IGESConvGeom", +"IGESData", +"IGESDefs", +"IGESDimen", +"IGESDraw", +"IGESFile", +"IGESGeom", +"IGESGraph", +"IGESSelect", +"IGESSolid", +"IGESToBRep", +#Missed modules +"Interface", +"Transfer", +"StepData", +"XSControl", +"IFSelect", +"IFGraph", +"STEPCAFControl", +"IGESCAFControl", +"XCAFApp", +"XCAFDimTolObjects", +"XCAFDoc", +"XCAFNoteObjects", +"XCAFPrs", +"XCAFView", +"BinXCAFDrivers", +"XmlXCAFDrivers", +"Vrml", +"VrmlAPI", +"RWGltf", +"IVtk", +"IVtkOCC", +"IVtkTools", +"IVtkVTK", +"DE", +"IMeshTools", +"IMeshData", +"APIHeaderSection", +"UnitsMethods"] + +exclude = ["Standard_Handle.hxx","Standard", "Standard_MemoryUtils.hxx", + "math_GaussPoints.hxx","NCollection_Shared.hxx","OSD_WNT.hxx", + "Geom2dToIGES","BRepGProp_Gauss.hxx","BRepLib_CheckCurveOnSurface.hxx", + "BVH_Types.hxx","BVH_RadixSorter.hxx","BVH_IndexedBoxSet.hxx", + "Aspect_VKeySet.hxx","BOPTools_PairSelector.hxx","AIS_DataMapOfSelStat.hxx", + "AIS_DataMapIteratorOfDataMapOfSelStat.hxx","BOPDS_Iterator.hxx","BOPDS_IteratorSI.hxx", + "BRepBlend_AppSurface.hxx","BRepMesh_BaseMeshAlgo.hxx","BRepMesh_ConstrainedBaseMeshAlgo.hxx", + "BRepMesh_CustomBaseMeshAlgo.hxx","BRepMesh_CustomDelaunayBaseMeshAlgo.hxx", + "BRepMesh_DefaultRangeSplitter.hxx","BRepMesh_DelaunayBaseMeshAlgo.hxx", + "BRepMesh_DelaunayDeflectionControlMeshAlgo.hxx","BRepMesh_DelaunayNodeInsertionMeshAlgo.hxx", + "BRepMesh_NodeInsertionMeshAlgo.hxx","BRepMesh_BoundaryParamsRangeSplitter.hxx", + "BRepMesh_ConeRangeSplitter.hxx","BRepMesh_CylinderRangeSplitter.hxx", + "BRepMesh_NURBSRangeSplitter.hxx","BRepMesh_SphereRangeSplitter.hxx", + "BRepMesh_TorusRangeSplitter.hxx","BRepMesh_UVParamRangeSplitter.hxx","OpenGl_GLESExtensions.hxx", + "IVtk_IShapePickerAlgo.hxx","ProjLib_HCompProjectedCurve.hxx","ProjLib_HProjectedCurve.hxx", + "OSD_StreamBuffer.hxx" + ] +# "BVH_Box.hxx","BVH_tools.hxx" + +exceptions = ["Standard_Failure"] + + +module_mapping = "lambda x: Path(x).splitpath()[-1].split('.')[0].split('_')[0]" + +byref_types = ["Standard_Real","Standard_Integer","Standard_Boolean"] +byref_types_smart_ptr = ["opencascade::handle"] + +parsing_header = '''#pragma clang diagnostic ignored "-Wmacro-redefined" +class Adaptor2d_Curve2d; +class Adaptor3d_Curve; +class Adaptor3d_Surface; +#include +#undef Standard_NODISCARD +#define Standard_NODISCARD +''' + +[Linux] + modules = ["Xw"] + symbols = "symbols_mangled_linux.dat" + +[Windows] + modules = ["WNT"] + exclude_classes = ["Handle_*"] + symbols = "symbols_mangled_win.dat" + +[OSX] + modules = ["Cocoa"] + symbols = "symbols_mangled_mac.dat" + prefix = "/usr/local/miniconda/envs/cpp-py-bindgen" + includes = ['/usr/local/Cellar/gcc@8/8.3.0_2/lib/gcc/8/gcc/x86_64-apple-darwin19/8.3.0/../../../../../../include/c++/8.3.0', + '/usr/local/Cellar/gcc@8/8.3.0_2/lib/gcc/8/gcc/x86_64-apple-darwin19/8.3.0/../../../../../../include/c++/8.3.0/x86_64-apple-darwin19', + '/usr/local/Cellar/gcc@8/8.3.0_2/lib/gcc/8/gcc/x86_64-apple-darwin19/8.3.0/../../../../../../include/c++/8.3.0/backward', + '/usr/local/Cellar/gcc@8/8.3.0_2/lib/gcc/8/gcc/x86_64-apple-darwin19/8.3.0/include', + '/usr/local/Cellar/gcc@8/8.3.0_2/lib/gcc/8/gcc/x86_64-apple-darwin19/8.3.0/include-fixed', + '/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/usr/include', + '/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks', + '/Library/Developer/CommandLineTools/SDKs/MacOSX10.15.sdk/System/Library/Frameworks//OpenGL.framework/Versions/A/Headers/', + '/usr/local/include'] + +[Operators] + + "operator*" = ["__mul__","__rmul__"] + "operator*=" = ["__imul__"] + "operator/" = ["__truediv__"] + "operator/=" = ["__itruediv__"] + "operator+" = ["__add__"] + "operator+=" = ["__iadd__"] + "operator-" = ["__sub__"] + "operator-=" = ["__isub__"] + "operator^" = ["__pow__"] + "operator^=" = ["__ipow__"] + "operator()" = ["__call__"] + +[Extras] + + include_pre = "OCP_specific.inc" + +[Attributes] + + __version__ = "7.8.1.2" + +[Modules] + + [Modules.gp] + + exclude_typedefs = ["gp","gp_TrsfNLerp"] + + [Modules.Standard] + + exclude_functions = ["HashCode"] + exclude_methods = ["Standard_Dump::DumpCharacterValues","Standard_Dump::DumpRealValues", + "Standard_CLocaleSentry::GetCLocale","Standard_Dump::InitRealValues"] + + [Modules.Resource] + + exclude_classes = ["Resource_NoSuchResource",] + + [Modules.NCollection] + + include_header_pre_top = """#include +#include """ + include_header_pre = """const size_t DefaultBlockSize = 24600; +const size_t THE_DEFAULT_BLOCK_SIZE = DefaultBlockSize;""" + exclude_classes = ["NCollection","NCollection_ListNode"] + + include_body_template_post=""" +template +void preregister_template_NCollection_Vector(py::object &m, const char *name){ + preregister_template_NCollection_DynamicArray(m, name); +}; + +template +void register_template_NCollection_Vector(py::object &m, const char *name){ + register_template_NCollection_DynamicArray(m, name); +}; + """ + + [Modules.NCollection.Templates.NCollection_Array1] + + exclude_constructors = [3] + + [Modules.NCollection.parsing_headers] + + "NCollection_CellFilter.hxx" = """#include +#include """ + + [Modules.OSD] + + 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");' + + [Modules.Storage] + + exclude_classes = ["Storage_StreamExtCharParityError","Storage_StreamTypeMismatchError", + "Storage_StreamUnknownTypeError","Storage_Bucket","Storage_BucketOfPersistent"] + exclude_typedefs = ["Storage","Storage_MapOfCallBack","Storage_MapOfPers"] + + [Modules.TCollection] + + exclude_methods = ["TCollection_ExtendedString::ToUTF8CString"] + + [Modules.TColStd] + + exclude_typedefs = ["TColStd_DataMapOfIntegerTransient","TColStd","TColStd_DataMapOfTransientTransient","TColStd_IndexedDataMapOfTransientTransient"] + + [Modules.Plugin] + + exclude_typedefs = ["Plugin","Plugin_MapOfFunctions"] + + [Modules.Units] + + exclude_methods = ["UnitsMethods::RadianToDegree","UnitsMethods::DegreeToRadian","UnitsMethods::MirrorPCurve"] + + [Modules.Poly] + + include_header_pre = "#include " + exclude_classes = ["Poly_MakeLoops","Poly",] + exclude_methods = ["Poly_CoherentTriangulation::FindTriangle","Poly_CoherentTriangulation::RemoveDegenerated"] + + [Modules.Expr] + + exclude_classes = ["ExprIntrp",] + + [Modules.BSplCLib] + + exclude_methods = ["BSplCLib::DN",] + + + [Modules.TopoDS] + + include_header_pre = "#include " + + exclude_typedefs = ["TopoDS_ListOfShape"] + + [Modules.TopoDS.Classes.TopoDS_Shape.additional_methods.__bool__] + + body = "[]( const TopoDS_Shape & self ){ return !self.IsNull();}" + help = "Check if shape is not Null" + arguments = [] + + [Modules.TopoDS.Classes.TopoDS_Shape.additional_methods._address] + + body = "[]( const TopoDS_Shape & self ){ return reinterpret_cast(&self);}" + help = "Get the instance address" + arguments = [] + + [Modules.TopoDS.Classes.TopoDS_Shape.additional_static_methods._from_address] + + body = "[]( const uintptr_t addr ){ return reinterpret_cast(addr);}" + help = "Cast an address to a shape" + arguments = ["address"] + + [Modules.TopoDS.Classes.TopoDS_Shape.additional_methods.__hash__] + + body = "[]( const TopoDS_Shape & self ){ return std::hash{}(self);}" + help = "Get the instance hash" + arguments = [] + + [Modules.IntPolyh] + + exclude_typedefs = ["IntPolyh_ArrayOfEdges","IntPolyh_ArrayOfTriangles","IntPolyh_ArrayOfPointNormal","IntPolyh_ArrayOfSectionLines","IntPolyh","IntPolyh_ArrayOfTangentZones","IntPolyh_ArrayOfPoints"] + + [Modules.BRepBuilderAPI] + + exclude_typedefs = ["BRepBuilderAPI_CellFilter","BRepBuilderAPI_BndBoxTree"] + exclude_methods = ["BRepBuilderAPI_FastSewing::GetStatuses"] + + [Modules.BRepBuilderAPI.parsing_headers] + + "BRepBuilderAPI_CellFilter.hxx" = "#include " + "BRepBuilderAPI_VertexInspector.hxx" = "#include " + + [Modules.BRepBuilderAPI.Classes.BRepBuilderAPI_Command.additional_methods.__bool__] + + body = "[]( const BRepBuilderAPI_Command & self){ return self.IsDone();}" + help = "Check if command is done" + arguments = [] + + + [Modules.MAT2d] + + exclude_typedefs = ["MAT2d_DataMapOfIntegerConnexion"] + + [Modules.BRepExtrema] + + exclude_typedefs = ["BRepExtrema_MapOfIntegerPackedMapOfInteger", "BRepExtrema_CellFilter"] + + [Modules.MAT] + + exclude_typedefs = ["MAT_DataMapOfIntegerBisector","MAT_DataMapOfIntegerArc","MAT","MAT_DataMapOfIntegerNode","MAT_DataMapOfIntegerBasicElt"] + + [Modules.BRepCheck] + + exclude_typedefs = ["BRepCheck_DataMapOfShapeResult", "BRepCheck_IndexedDataMapOfShapeResult","BRepCheck_DataMapOfShapeListOfStatus"] + + [Modules.BRepClass3d] + + exclude_typedefs = ["BRepClass3d_BndBoxTree"] + exclude_classes = ["BRepClass3d_BndBoxTreeSelectorPoint", + "BRepClass3d_BndBoxTreeSelectorLine"] + + + [Modules.BRepAlgo] + + exclude_typedefs = ["BRepAlgo_DataMapOfShapeInterference"] + + [Modules.HLRBRep] + + exclude_classes = ["HLRBRep_CLPropsATool",] + + [Modules.HLRBRep.parsing_headers] + + "HLRBRep_CLPropsATool.hxx" = "#include " + + [Modules.TopOpeBRepDS] + + exclude_functions = ["FDSSDM_s1s2makesordor","FUN_scanloi"] + exclude_typedefs = ["TopOpeBRepDS_ShapeSurface"] + + [Modules.BRepAlgoAPI] + + include_header_pre = "#include " + exclude_methods = ["BRepAlgoAPI_BuilderAlgo::Builder",] #this will be fixed by the include + exclude_typedefs = ["TopOpeBRepDS_ShapeSurface"] + + [Modules.BRepAlgoAPI.Classes.BRepAlgoAPI_Algo.additional_methods.RunParallel] + + body = "[]( BRepAlgoAPI_Algo & self){ return self.RunParallel(); }" + help = "Returns the flag of parallel processing." + arguments = [] + + [Modules.BRepAlgoAPI.Classes.BRepAlgoAPI_Algo.additional_methods.SetRunParallel] + + body = "[]( BRepAlgoAPI_Algo & self , const Standard_Boolean theFlag){ self.SetRunParallel(theFlag); }" + help = "Set the flag of parallel processing." + arguments = ["thFlag"] + + [Modules.BRepAlgoAPI.Classes.BRepAlgoAPI_Algo.additional_methods.FuzzyValue] + + body = "[]( BRepAlgoAPI_Algo & self){ return self.FuzzyValue(); }" + help = "Returns the additional tolerance." + arguments = [] + + [Modules.BRepAlgoAPI.Classes.BRepAlgoAPI_Algo.additional_methods.SetFuzzyValue] + + body = "[]( BRepAlgoAPI_Algo & self , const Standard_Real theFuzz){ self.SetFuzzyValue(theFuzz); }" + help = "Sets the additional tolerance." + arguments = ["theFuzz"] + + [Modules.BRepAlgoAPI.Classes.BRepAlgoAPI_Algo.additional_methods.SetUseOBB] + + body = "[]( BRepAlgoAPI_Algo & self , const Standard_Boolean theFlag){ self.SetUseOBB(theFlag); }" + help = "Set the flag of parallel processing." + arguments = ["thFlag"] + + [Modules.TopOpeBRep] + + exclude_methods = ["TopOpeBRep_DSFiller::PShapeClassifier","TopOpeBRep_FaceEdgeFiller::PShapeClassifier","TopOpeBRep_FacesFiller::PShapeClassifier"] + exclude_typedefs = ["TopOpeBRep_DataMapOfTopolTool"] + + + [Modules.BRepFill] + + exclude_typedefs = ["BRepFill_DataMapOfShapeHArray2OfShape"] + + [Modules.BRepFill.parsing_headers] + + "BRepFill_Sweep.hxx" = "#include " + "BRepFill_TrimShellCorner.hxx" = """#include +#include """ + + [Modules.ChFi3d] + #error: invalid use of incomplete type ‘class Geom_BSplineCurve’ + exclude_functions = ["ChFi3d_ApproxByC2","ChFi3d_SearchPivot","ChFi3d_EnlargeFace", + "ChFi3d_InPeriod","ChFi3d_Boite","ChFi3d_SetPointTolerance"] + + + [Modules.BOPDS] + + exclude_typedefs = ["BOPDS_DataMapOfPaveBlockCommonBlock"] + + [Modules.BOPDS.parsing_headers] + + "BOPDS_DataMapOfPaveBlockListOfInteger.hxx" = "#include " + + [Modules.BRepMesh] + + include_header_pre = "#include " + exclude_classes = ["BRepMesh_Triangle","BRepMesh_Delaun","BRepMesh_DefaultRangeSplitter","BRepMesh_Context"] #constructor with int&[3] + exclude_methods = ["BRepMesh_GeomTool::IntLinLin", + "BRepMesh_DataStructureOfDelaun::ElementNodes","BRepMesh_MeshTool::AddTriangle", + "BRepMesh_ConeRangeSplitter::GetSplitSteps", + "BRepMesh_Delaun::FreeEdges","BRepMesh_Delaun::ProcessConstraints", + "BRepMesh_DefaultRangeSplitter::computeTolerance","BRepMesh_DefaultRangeSplitter::computeDelta", + "BRepMesh_Delaun::Frontier","BRepMesh_GeomTool::CellsCount", "BRepMesh_EdgeDiscret::operator()", + "BRepMesh_FaceChecker::operator()", "BRepMesh_ModelHealer::operator()"] + + [Modules.TopOpeBRepTool] + + exclude_typedefs = ["TopOpeBRepTool_IndexedDataMapOfSolidClassifier"] + + [Modules.TopOpeBRepTool.parsing_headers] + + "TopOpeBRepTool_TOPOLOGY.hxx" = """ + class TopoDS_Face; + class BRepAdaptor_Curve; + class TopoDS_Edge; + class TopoDS_Vertex; + class TopTools_ListOfShape; + class Bnd_Box2d; + """ + + [Modules.BOPTools] + + exclude_typedefs = ["BOPTools_BoxBndTree","BOPTools_PairSelector","BOPTools_Box2dTree","BOPTools_BoxPairSelector","BOPTools_Box2dPairSelector"] + + [Modules.BOPTools.parsing_headers] + + "BOPTools_SetMapHasher.hxx" = "#include " + + [Modules.Aspect] + + include_header_pre = """struct __GLXFBConfigRec {}; +struct Aspect_XVisualInfo {}; +#include +""" + exclude_methods = ["Aspect_NeutralWindow::NativeFBConfig","Aspect_Window::NativeFBConfig","Aspect_NeutralWindow::SetNativeHandles","Aspect_DisplayConnection::GetDisplay","Aspect_DisplayConnection::Init"] + exclude_typedefs = ["Aspect_XRActionSetMap","Aspect_XRActionMap"] + + [Modules.Aspect.Classes.Aspect_DisplayConnection] + + exclude_constructors = [2] + + [Modules.SelectMgr] + + exclude_typedefs = ["SelectMgr_IndexedMapOfOwner","SelectMgr_MapOfObjectSensitives","SelectMgr_FrustumCache","SelectMgr_IndexedMapOfHSensitive"] + + [Modules.OpenGl] + + include_header_pre = """#include +#include +#include +#include +struct NSOpenGLContext {};""" + include_body_pre = 'py::class_(m, "NSOpenGLContext");' + exclude_methods = ["OpenGl_GlCore11::glGetPointerv","OpenGl_RaytraceGeometry::Clear", + "OpenGl_View::ChangeGraduatedTrihedron","OpenGl_View::LayerList", + "OpenGl_DepthPeeling::DetachDepthTexture", "OpenGl_DepthPeeling::DepthPeelFbosOit", + "OpenGl_DepthPeeling::FrontBackColorFbosOit"] + exclude_typedefs = ["OpenGl_SequenceOfLayers","OpenGl_SetterList","OpenGl_MapOfHatchStylesAndIds","OpenGl_MapOfZLayerSettings","OpenGl_IndexedMapOfStructure","OpenGl_MapOfShaderPrograms","OpenGl_IndexedMapOfStructure","OpenGl_LayerSeqIds"] + exclude_classes = ["OpenGl_GraduatedTrihedron","OpenGl_LayerList","OpenGl_VariableSetterSelector","OpenGl_RaytraceGeometry"] + + [Modules.OpenGl.parsing_headers] + + "OpenGl_LayerList.hxx" = "#include " + "OpenGl_ShaderObject.hxx" = "#include " + "OpenGl_BufferCompatT.hxx" = "#include " + "OpenGl_VertexBufferCompat.hxx" = "#include " + "OpenGl_SetOfShaderPrograms.hxx" = "#include " + + [Modules.StdSelect] + + include_header_pre = "#include " + exclude_typedefs = ["StdSelect_IndexedDataMapOfOwnerPrs"] + + [Modules.Xw] + + include_header_pre = "struct __GLXFBConfigRec {}; union _XEvent {long pad[24];};" + include_body_pre = 'py::class_<__GLXFBConfigRec>(m, "__GLXFBConfigRec");' + + [Modules.MeshVS] + + exclude_typedefs = ["MeshVS_NodePair","MeshVS_DataMapOfIntegerOwner","MeshVS_DataMapOfHArray1OfSequenceOfInteger","MeshVS_DataMapOfIntegerMeshEntityOwner"] + + [Modules.AIS] + + include_header_pre = """#include +#include +auto OptionsForAttach = [](){return AIS_Manipulator::OptionsForAttach();};""" + include_body_pre = "py::class_(m,\"AIS_Manipulator_OptionsForAttach\");" + exclude_typedefs = ["AIS_DataMapOfShapeDrawer","AIS_DataMapOfIOStatus","AIS_DataMapOfILC","AIS_IndexedDataMapOfOwnerPrs"] + + [Modules.Font] + + exclude_classes = ["Font_BRepFont"] + exclude_methods = ["Font_FTFont::renderGlyphOutline"] + include_header_pre = "struct FT_LibraryRec_ {};" + + [Modules.Font.Classes.Font_BRepTextBuilder.additional_methods.Perform] + + body = "[]( Font_BRepTextBuilder & self , const char* path, double size, Font_FontAspect aspect, const char* text){ auto font = Font_BRepFont(path,aspect,size); return self.Perform(font,text);}" + help = "Render text as BRep shape." + arguments = ["Font path","Font size","Font style","Text"] + + [Modules.Select3D] + + exclude_typedefs = ["Select3D_IndexedMapOfEntity","Graphic3d_Vec3d","Select3D_BndBox3d"] #couldn't deduce template parameter ‘Hasher’ + + [Modules.Select3D.Classes.Select3D_SensitiveCircle] + + exclude_constructors = [0,1] #missing vftable + + + [Modules.Graphic3d] + + include_header_pre = """#include +struct NSOpenGLContext {};""" + exclude_typedefs = ["Graphic3d_IndexedMapOfView","Graphic3d_IndexedMapOfAddress","Graphic3d_MapOfStructure","Graphic3d_NMapOfTransient","Graphic3d_MapOfObject","Graphic3d_Vec4u","Graphic3d_Vec2u","Graphic3d_Vec3u","Graphic3d_Vec3d","Graphic3d_MapOfAspectsToAspects", + "Graphic3d_BndBox4d","Graphic3d_BndBox3d","Graphic3d_BndBox4f", "Graphic3d_IndexedMapOfStructure", "Graphic3d_ArrayOfIndexedMapOfStructure"] + exclude_methods = ["Graphic3d_BvhCStructureSet::Size","Graphic3d_BvhCStructureSet::Box", + "Graphic3d_BvhCStructureSet::Center","Graphic3d_BvhCStructureSet::Swap", + "Graphic3d_BvhCStructureSetTrsfPers::Size","Graphic3d_BvhCStructureSetTrsfPers::Box", + "Graphic3d_BvhCStructureSetTrsfPers::Center","Graphic3d_BvhCStructureSetTrsfPers::Swap", + "Graphic3d_Layer::CullableTrsfPersStructuresBVH","Graphic3d_Layer::CullableStructuresBVH"] + exclude_classes = ["Graphic3d_BvhCStructureSet","Graphic3d_BvhCStructureSetTrsfPers"] + + [Modules.Graphic3d.parsing_headers] + + "Graphic3d_WorldViewProjState.hxx" = """#include +#include """ + + [Modules.AdvApprox] + + exclude_classes = ["AdvApprox_EvaluatorFunction"] + exclude_methods = ['AdvApprox_EvaluatorFunction::Evaluate'] + + [Modules.BVH] + + exclude_typedefs = ["BVH_PrimitiveSet3d"] + exclude_class_templates = ["BVH_BaseBox"] + exclude_class_template_methods = ["BVH_Tools::PointBoxProjection"] + + [Modules.BVH.parsing_headers] + + "BVH_Ray.hxx" = "#include " + + [Modules.TDocStd] + + include_header_pre = """#include +#include +#include """ + + [Modules.XmlMDF] + + exclude_typedefs = ["XmlMDF_MapOfDriver","XmlMDF_TypeADriverMap"] + + [Modules.StdStorage] + + exclude_typedefs = ["StdStorage_MapOfRoots"] + exclude_classes = ["StdStorage_Bucket","StdStorage_BucketOfPersistent"] + exclude_methods = ["StdStorage_TypeData::Instantiator"] + + [Modules.BinMDF] + + exclude_typedefs = ["BinMDF_TypeADriverMap","BinMDF_TypeIdMap"] + + [Modules.CDM] + + exclude_typedefs = ["CDM_PresentationDirectory", "CDM_MetaDataLookUpTable"] + + [Modules.CDM.parsing_headers] + + "CDM_MetaDataLookUpTable.hxx" = "#include " + "CDM_DataMapIteratorOfMetaDataLookUpTable.hxx" = "#include " + + [Modules.TDataStd] + + exclude_typedefs = ["TDataStd_DataMapOfStringHArray1OfReal","TDataStd_DataMapOfStringHArray1OfInteger"] + + [Modules.StdLDrivers] + + include_header_pre = """#include +#include """ + + [Modules.TFunction] + + exclude_typedefs = ["TFunction_DataMapOfGUIDDriver"] + + [Modules.TObj] + + include_header_pre = """#include +#include """ + exclude_typedefs = ["TObj_DataMapOfObjectHSequenceOcafObjects"] + + [Modules.StdObjMgt] + + exclude_typedefs = ["StdObjMgt_TransientPersistentMap"] + + [Modules.TNaming] + + exclude_typedefs = ["TNaming_DataMapOfShapePtrRefShape"] + exclude_methods = ["TNaming_RefShape::FirstUse"] + + [Modules.TNaming.parsing_headers] + + "TNaming_NCollections.hxx" = "#include " + + [Modules.TDF] + + exclude_typedefs = ["TDF_AttributeDataMap","TDF_AttributeDoubleMap"] + exclude_classes = ["TDF_LabelNode"] + exclude_methods = ["TDF_DerivedAttribute::Register", "TDF_Label::FindAttribute"] + + [Modules.TDF.parsing_headers] + + "TDF_LabelIndexedMap.hxx" = "#include " + + [Modules.TDF.Classes.TDF_Label.additional_methods.FindAttribute] + + body = "[]( TDF_Label & self , const Standard_GUID& anID, TDF_Attribute& anAttribute){ Handle(TDF_Attribute) dummy_attr; auto rv = self.FindAttribute(anID, dummy_attr); anAttribute.Restore(dummy_attr); return rv;}" + help = "Finds an attributes according to an ID." + arguments = ["GUID","Attribute"] + + [Modules.TDF.Classes.TDF_Label.additional_methods.__bool__] + + body = "[]( const TDF_Label & self){ return !self.IsNull();}" + help = "Check if label is not Null" + arguments = [] + + + [Modules.XmlTObjDrivers] + + include_header_pre = """#include +#include """ + + [Modules.TPrsStd] + + exclude_typedefs = ["TPrsStd_DataMapOfGUIDDriver"] + + [Modules.STEPConstruct] + + exclude_typedefs = ["STEPConstruct_DataMapOfAsciiStringTransient","STEPConstruct_DataMapOfPointTransient"] + + [Modules.STEPConstruct.parsing_headers] + + "STEPConstruct_PointHasher.hxx" = "#include " + "STEPConstruct_Styles.hxx" = "#include " + + [Modules.RWStl] + + include_header_pre = """ + #include + #include + #include + #include + #include """ + + exclude_methods = ["RWStl_Reader::ReadAscii"] + + [Modules.StepShape] + + include_header_pre = """#include """ + + [Modules.Transfer] + + exclude_typedefs = ["Transfer_TransferMapOfProcessForFinder","Transfer_TransferMapOfProcessForTransient"] + + [Modules.ShapeFix] + + include_header_pre_top = "#include " + + [Modules.ShapeFix.parsing_headers] + + "ShapeFix_Solid.hxx" = "#include " + + [Modules.BRepBlend] + + exclude_methods = ["BRepBlend_AppSurface::TolReached"] + + [Modules.StdPersistent] + + include_header_pre = """using ItemLocation = StdPersistent_TopLoc::ItemLocation; +using Datum3D = StdPersistent_TopLoc::Datum3D;""" + + [Modules.AppCont] + + exclude_methods = ["AppCont_Function::PeriodInformation"] + exclude_functions = ["InvMMatrix","MMatrix","IBPMatrix","IBTMatrix","VBernstein"] + + [Modules.ShapePersistent] + + include_header_pre = """using Curve3D = ShapePersistent_BRep::Curve3D; +using CurveOn2Surfaces = ShapePersistent_BRep::CurveOn2Surfaces; +using CurveOnClosedSurface = ShapePersistent_BRep::CurveOnClosedSurface; +using CurveOnSurface = ShapePersistent_BRep::CurveOnSurface; +using CurveRepresentation = ShapePersistent_BRep::CurveRepresentation; +using GCurve = ShapePersistent_BRep::GCurve; +using PointOnCurve = ShapePersistent_BRep::PointOnCurve; +using PointOnCurveOnSurface = ShapePersistent_BRep::PointOnCurveOnSurface; +using PointOnSurface = ShapePersistent_BRep::PointOnSurface; +using PointRepresentation = ShapePersistent_BRep::PointRepresentation; +using PointsOnSurface = ShapePersistent_BRep::PointsOnSurface; +using Polygon3D = ShapePersistent_BRep::Polygon3D; +using PolygonOnClosedSurface = ShapePersistent_BRep::PolygonOnClosedSurface; +using PolygonOnClosedTriangulation = ShapePersistent_BRep::PolygonOnClosedTriangulation; +using PolygonOnSurface = ShapePersistent_BRep::PolygonOnSurface; +using PolygonOnTriangulation = ShapePersistent_BRep::PolygonOnTriangulation; +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +""" + + [Modules.IntAna] + + exclude_methods = ["IntAna_Quadric::SpecialPoints"] + + [Modules.IntAna.parsing_headers] + + "IntAna_Quadric.hxx" = """#include +#include +#include +#include +#include +#include """ + + [Modules.CDF] + + include_header_pre = """#include +#include +#include """ + + [Modules.CDF.parsing_headers] + + "CDF_StoreList.hxx" = "#include " + + [Modules.Image] + + include_header_pre = """#include +using std::basic_ostream; +using std::char_traits;""" + + exclude_methods = ["Image_AlienPixMap::Load", "Image_AlienPixMap::GetPalette"] + + [Modules.Prs3d] + + include_header_pre = """#include +#include """ + + [Modules.Prs3d.parsing_headers] + + "Prs3d_Point.hxx" = "#include " + + [Modules.WNT] + + include_header_pre_top ="""#define WIN32_LEAN_AND_MEAN +#include +""" + + exclude_methods = ["WNT_Window::ProcessMessage"] + + include_header_pre = """#include +struct __GLXFBConfigRec {};""" + + [Modules.Cocoa] + + include_header_pre = """#include +struct NSView {}; +struct __GLXFBConfigRec {};""" + + [[Modules.Cocoa.Classes.Cocoa_Window.additional_constructors]] + + body = "[](void* ptr){ return Cocoa_Window(reinterpret_cast(ptr)); }" + help = "Creates a wrapper over existing NSView handle." + arguments = ["NSView*"] + + [Modules.StepData] + + exclude_classes = ["StepData_EnumTool"] + + [Modules.LDOM] + + exclude_classes = ["LDOMString","LDOM_MemManager","LDOM_BasicText"] + exclude_methods = ["LDOM_BasicAttribute::SetValue"] + + [Modules.PCDM] + + exclude_classes = ["PCDM_DOMHeaderParser"] + + [Modules.PCDM.parsing_headers] + + "PCDM_ReadWriter.hxx" = "#include " + "PCDM_ReadWriter_1.hxx" = "#include " + + [Modules.ShapeAnalysis] + + exclude_classes = ["ShapeAnalysis_BoxBndTreeSelector"] + + [Modules.V3d] + + include_header_pre = """struct NSOpenGLContext {}; //OSX related""" + + [Modules.STEPCAFControl] + + include_header_pre = """ + #include + #include + + using std::basic_ostream; + using std::basic_istream; + using std::char_traits; + + #include + #include """ + exclude_typedefs = ["STEPCAFControl_DataMapOfShapePD","STEPCAFControl_DataMapOfShapePD", + "STEPCAFControl_DataMapOfSDRExternFile","STEPCAFControl_DataMapOfSDRExternFile", + "STEPCAFControl_DataMapOfPDExternFile","STEPCAFControl_DataMapOfLabelExternFile", + "STEPCAFControl_DataMapOfShapeSDR"] + + [Modules.STEPCAFControl.parsing_headers] + + "STEPCAFControl_Writer.hxx" = "#include " + + [Modules.XCAFDimTolObjects] + + exclude_typedefs = ["XCAFDimTolObjects_DataMapOfToleranceDatum"] + + [Modules.XCAFPrs] + + include_header_pre = """#include +#include """ + exclude_typedefs = ["XCAFPrs_DataMapOfStyleTransient"] + + [Modules.AdvApp2Var] + + include_header_pre_top ="""#ifdef WIN32 +#define WIN32_LEAN_AND_MEAN +#include +#endif +""" + + [Modules.BOPAlgo] + + include_header_pre = """#include +#include +""" + + [Modules.VrmlAPI] + + include_header_pre = "#include " + + [Modules.Vrml] + + include_header_pre = """ + #include + #include + #include + #include """ + + [Modules.IFSelect] + + include_header_pre = """#include +using std::basic_istream; +using std::char_traits;""" + + [Modules.XSControl] + + include_header_pre = """#include +using std::basic_istream; +using std::char_traits;""" + + [Modules.Message] + + exclude_classes = ["Message_LazyProgressScope"] + + [Modules.Message.Classes.Message_ProgressScope] + + exclude_constructors = [2] + + [Modules.RWGltf] + + include_header_pre = """#include +#include +#include +using std::basic_istream; +using rapidjson::BasicOStreamWrapper;""" + + exclude_methods = ["RWGltf_GltfMaterialMap::AddGlbImages"] + exclude_typedefs = ["RWGltf_GltfFaceList"] + + [Modules.RWGltf.parsing_headers] + + "RWGltf_GltfOStreamWriter.hxx" = "#include " + + + [Modules.BRepApprox] + + [Modules.BRepApprox.parsing_headers] + + "BRepApprox_SurfaceTool.hxx" = "#include " + "BRepApprox_TheMultiLineToolOfApprox.hxx" = """ + #include + #include + #include + #include + """ + + [Modules.IntPatch] + + [Modules.IntPatch.parsing_headers] + + "IntPatch_PolyhedronTool.hxx" = "#include " + + [Modules.ShapeConstruct] + + [Modules.ShapeConstruct.parsing_headers] + + "ShapeConstruct_ProjectCurveOnSurface.hxx" = "#include " + + [Modules.HLRAlgo] + + [Modules.HLRAlgo.parsing_headers] + + "HLRAlgo_HArray1OfPHDat.hxx" = "#include " + "HLRAlgo_Array1OfPHDat.hxx" = "#include " + "HLRAlgo_PolyHidingData.hxx" = "#include " + "HLRAlgo_PolyShellData.hxx" = "#include " + + [Modules.ShapeUpgrade] + + [Modules.ShapeUpgrade.parsing_headers] + + "ShapeUpgrade_UnifySameDomain.hxx" = "#include " + + [Modules.IntTools] + + [Modules.IntTools.parsing_headers] + + "IntTools_SurfaceRangeSampleMapHasher.hxx" = "#include " + "IntTools_CurveRangeSampleMapHasher.hxx" = "#include " + "IntTools_EdgeFace.hxx" = "#include " + + [Modules.BRepOffset] + + [Modules.BRepOffset.parsing_headers] + + "BRepOffset_Inter2d.hxx" = "#include " + + [Modules.StdPrs] + + [Modules.StdPrs.parsing_headers] + + "StdPrs_HLRShape.hxx" = "#include " + "StdPrs_Vertex.hxx" = "#include " + "StdPrs_Point.hxx" = "#include " + + [Modules.Interface] + + [Modules.Interface.parsing_headers] + + "Interface_ValueInterpret.hxx" = "#include " + + [Modules.IVtkVTK] + + include_header_pre = """#include +#include "vtk_pybind.h" """ + + [Modules.IVtkTools] + + include_header_pre = """#undef Handle +#include +#include +#include """ + + exclude_methods = ["IVtkTools_ShapePicker::Pick","IVtkTools_ShapePicker::pick", + "IVtkTools_SubPolyDataFilter::PrintSelf", "IVtkTools_DisplayModeFilter::PrintSelf"] + + [Modules.IVtk] + + exclude_typedefs = ["IVtk_PointIdList"] + + [Modules.IVtkOCC] + + exclude_methods = ["IVtkOCC_ShapePickerAlgo::Pick", "IVtkOCC_ViewerSelector::Pick"] + + [Modules.BinLDrivers] + + include_header_pre = "#include " + + [Modules.BinObjMgt] + + exclude_methods = ["BinObjMgt_Persistent::GetOStream", "BinObjMgt_Persistent::GetIStream"] + + [Modules.GeomAdaptor] + + include_header_pre = """#include +#include +#include +""" + + [Modules.GeomInt] + + include_header_pre = """ + #include + #include + #include + #include + #include + """ + + [Modules.GeomInt.parsing_headers] + + "GeomInt_TheMultiLineToolOfWLApprox.hxx" = """ + #include + #include + #include + #include + """ + + [Modules.StepToGeom] + + include_header_pre = """#include """ + + [Modules.XmlDrivers] + + include_header_pre = "#include " + + [Modules.XmlLDrivers] + + include_header_pre = "#include " + + [Modules.BRepTools] + + include_header_pre = "#include " + + [Modules.BRepTopAdaptor] + + [Modules.BRepTopAdaptor.parsing_headers] + + "BRepTopAdaptor_HVertex.hxx" = "#include " + + [Modules.IGESAppli] + + module_parsing_header = "#include " + + [Modules.IGESBasic] + + module_parsing_header = "#include " + + [Modules.IGESDefs] + + module_parsing_header = "#include " + + [Modules.IGESDimen] + + module_parsing_header = "#include " + + [Modules.IGESDraw] + + module_parsing_header = "#include " + + [Modules.IGESGeom] + + module_parsing_header = "#include " + + [Modules.IGESGraph] + + module_parsing_header = "#include " + + [Modules.IGESSolid] + + module_parsing_header = "#include " + + [Modules.GeomConvert] + + [Modules.GeomConvert.parsing_headers] + + "GeomConvert_SurfToAnaSurf.hxx" = "class Geom_Curve; class gp_Ax3;" + + [Modules.TopoDSToStep] + + [Modules.TopoDSToStep.parsing_headers] + + "TopoDSToStep_MakeTessellatedItem.hxx" = "class TopoDSToStep_Tool;" + "TopoDSToStep_MakeStepWire.hxx" = "#include " + "TopoDSToStep_MakeShellBasedSurfaceModel.hxx" = "#include " + "TopoDSToStep_MakeBrepWithVoids.hxx" = "#include " + "TopoDSToStep_MakeStepVertex.hxx" = "#include " + "TopoDSToStep_MakeGeometricCurveSet.hxx" = "#include " + "TopoDSToStep_MakeFacetedBrepAndBrepWithVoids.hxx" = "#include " + + [Modules.XCAFDoc] + + [Modules.XCAFDoc.parsing_headers] + "XCAFDoc_AssemblyTool.hxx" = "#include " + "XCAFDoc_AssemblyIterator.hxx" = "#include " + "XCAFDoc_AssemblyGraph.hxx" = "#include " + + [Modules.DE] + + exclude_typedefs = ["DE_ConfigurationVendorMap", "DE_ConfigurationFormatMap"] + + [Modules.StepVisual] + + include_header_pre = "#include " + + [Modules.STEPControl] + + include_header_pre = """ + #include + #include + #include + + using std::basic_ostream; + using std::basic_istream; + using std::char_traits;""" + + [Modules.IMeshTools] + + include_header_pre = """ + #include """ + + [Modules.GeomToStep] + + [Modules.GeomToStep.parsing_headers] + + "GeomToStep_MakeHyperbola.hxx" = "#include " + + [Modules.StepToTopoDS] + + [Modules.StepToTopoDS.parsing_headers] + + "StepToTopoDS_TranslateEdgeLoop.hxx" = "#include " + "StepToTopoDS_TranslateShell.hxx" = "#include " + "StepToTopoDS_TranslateSolid.hxx" = "#include " + "StepToTopoDS_TranslateCurveBoundedSurface.hxx" = "#include " + "StepToTopoDS_TranslateCompositeCurve.hxx" = "#include " + "StepToTopoDS_Builder.hxx" = "#include " + + [Modules.APIHeaderSection] + + include_header_pre = """ + #include + #include + #include """ + + [Modules.IGESCAFControl] + + include_header_pre = "#include " diff --git a/pkgs/development/python-modules/cadquery-ocp/settings-overlay.nix b/pkgs/development/python-modules/cadquery-ocp/settings-overlay.nix new file mode 100644 index 0000000000000..83f2db08c9a3d --- /dev/null +++ b/pkgs/development/python-modules/cadquery-ocp/settings-overlay.nix @@ -0,0 +1,50 @@ +{ + lib, + stdenv, + apple-sdk, +}: + +{ + # macOS: remove hardcoded include paths used upstream + OSX = lib.optionalAttrs (stdenv.hostPlatform.isDarwin) { + prefix = "${apple-sdk.sdkroot}"; + includes = [ ]; + }; + + # backports from 7.9, remove after bumping version + exclude_namespaces = [ + "std" + "opencascade" + "IMeshData" + "IVtkTools" + "BVH" + "OpenGl" + "OpenGl_HashMapInitializer" + "Graphic3d_TransformUtils" + ]; + + byref_types_smart_ptr = [ + "opencascade::handle" + "handle" + "Handle" + ]; + + Modules = { + Standard.exclude_methods = [ + "Standard_Dump::DumpCharacterValues" + "Standard_Dump::DumpRealValues" + "Standard_CLocaleSentry::GetCLocale" + "Standard_Dump::InitRealValues" + "Standard_ErrorHandler::Label" + ]; + + NCollection.exclude_class_template_methods = [ + ".*::begin" + ".*::end" + ".*::cbegin" + ".*::cend" + ]; + + AdvApp2Var.exclude_classes = [ "AdvApp2Var_MathBase" ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index dbfa2a84d9a5a..477fa9a568a38 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -2391,6 +2391,8 @@ self: super: with self; { cachy = callPackage ../development/python-modules/cachy { }; + cadquery-ocp = callPackage ../development/python-modules/cadquery-ocp { }; + cadwyn = callPackage ../development/python-modules/cadwyn { }; caffe = toPythonModule ( From d1f57dbdfbe617ea18290b1a72137e49104ce267 Mon Sep 17 00:00:00 2001 From: Andrew Pan Date: Tue, 12 Aug 2025 20:43:54 -0400 Subject: [PATCH 6/8] python3Packages.ocpsvg: init at 0.5.0 --- .../python-modules/ocpsvg/default.nix | 39 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 41 insertions(+) create mode 100644 pkgs/development/python-modules/ocpsvg/default.nix diff --git a/pkgs/development/python-modules/ocpsvg/default.nix b/pkgs/development/python-modules/ocpsvg/default.nix new file mode 100644 index 0000000000000..3027c22dd7021 --- /dev/null +++ b/pkgs/development/python-modules/ocpsvg/default.nix @@ -0,0 +1,39 @@ +{ + lib, + buildPythonPackage, + fetchPypi, + setuptools-scm, + pytestCheckHook, + cadquery-ocp, + svgelements, +}: +let + pname = "ocpsvg"; + version = "0.5.0"; + src = fetchPypi { + inherit pname version; + hash = "sha256-XNjb7Iv1kNNzqCquvqskGDgYWqsE7ihZ8zudeVa7+6Y="; + }; +in +buildPythonPackage { + inherit src pname version; + pyproject = true; + + build-system = [ + setuptools-scm + ]; + + nativeCheckInputs = [ pytestCheckHook ]; + + dependencies = [ + cadquery-ocp + svgelements + ]; + + meta = { + description = "Translator between OCP and svgelements"; + homepage = "https://github.com/3MFConsortium/lib3mf_python"; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ tnytown ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 477fa9a568a38..54547b1ab16aa 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -11181,6 +11181,8 @@ self: super: with self; { ocifs = callPackage ../development/python-modules/ocifs { }; + ocpsvg = callPackage ../development/python-modules/ocpsvg { }; + ocrmypdf = callPackage ../development/python-modules/ocrmypdf { tesseract = pkgs.tesseract5; }; od = callPackage ../development/python-modules/od { }; From 6e8982296360cd500ca1207cd65138129c29c42a Mon Sep 17 00:00:00 2001 From: Andrew Pan Date: Mon, 9 Feb 2026 23:29:39 -0500 Subject: [PATCH 7/8] ocp-gordon: init at 0.1.18 --- .../python-modules/ocp-gordon/default.nix | 39 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 41 insertions(+) create mode 100644 pkgs/development/python-modules/ocp-gordon/default.nix diff --git a/pkgs/development/python-modules/ocp-gordon/default.nix b/pkgs/development/python-modules/ocp-gordon/default.nix new file mode 100644 index 0000000000000..69ec61cb64be5 --- /dev/null +++ b/pkgs/development/python-modules/ocp-gordon/default.nix @@ -0,0 +1,39 @@ +{ + lib, + buildPythonPackage, + fetchPypi, + pytestCheckHook, + setuptools-scm, + cadquery-ocp, + numpy, + scipy, +}: +buildPythonPackage rec { + pname = "ocp_gordon"; + version = "0.1.18"; + pyproject = true; + + src = fetchPypi { + inherit pname version; + hash = "sha256-6n90FNMfkQp5Vw+SGP4AHPrH36ILNHmUBqQgxnne5rs="; + }; + + build-system = [ setuptools-scm ]; + + dependencies = [ + cadquery-ocp + numpy + scipy + ]; + + nativeCheckInputs = [ + pytestCheckHook + ]; + + meta = { + description = "A Python library for Gordon Surface interpolation using B-splines"; + homepage = "https://pypi.org/project/ocp-gordon/"; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ tnytown ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 54547b1ab16aa..dd87d49328147 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -11181,6 +11181,8 @@ self: super: with self; { ocifs = callPackage ../development/python-modules/ocifs { }; + ocp-gordon = callPackage ../development/python-modules/ocp-gordon { }; + ocpsvg = callPackage ../development/python-modules/ocpsvg { }; ocrmypdf = callPackage ../development/python-modules/ocrmypdf { tesseract = pkgs.tesseract5; }; From a45624c2e224566ffb6ae62c94b37934a83428f7 Mon Sep 17 00:00:00 2001 From: Andrew Pan Date: Tue, 12 Aug 2025 20:44:21 -0400 Subject: [PATCH 8/8] python3Packages.build123d: init at 0.10.0 --- .../python-modules/build123d/default.nix | 76 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 78 insertions(+) create mode 100644 pkgs/development/python-modules/build123d/default.nix diff --git a/pkgs/development/python-modules/build123d/default.nix b/pkgs/development/python-modules/build123d/default.nix new file mode 100644 index 0000000000000..b79ed1893a986 --- /dev/null +++ b/pkgs/development/python-modules/build123d/default.nix @@ -0,0 +1,76 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + pytestCheckHook, + setuptools-scm, + anytree, + ezdxf, + ipython, + numpy, + cadquery-ocp, + ocpsvg, + ocp-gordon, + lib3mf, + sympy, + scipy, + svgpathtools, + trianglesolver, + webcolors, +}: +let + pname = "build123d"; + version = "0.10.0"; + src = fetchFromGitHub { + owner = "gumyr"; + repo = "build123d"; + tag = "v${version}"; + hash = "sha256-EhV6/ZTBp9XxWY1CgNKESikgTnAk9xaF0g/bYEQPf20="; + }; +in +buildPythonPackage { + inherit src pname version; + pyproject = true; + + build-system = [ setuptools-scm ]; + + dependencies = [ + anytree + ezdxf + ipython + numpy + cadquery-ocp + ocpsvg + ocp-gordon + lib3mf + scipy + sympy + svgpathtools + trianglesolver + webcolors + ]; + + pythonRelaxDeps = [ + "ipython" + "webcolors" + ]; + + nativeCheckInputs = [ + pytestCheckHook + ]; + + disabledTests = [ + # These attempt to access the network + "test_assembly_with_oriented_parts" + "test_move_single_object" + "test_single_label_color" + "test_single_object" + ]; + + meta = { + description = "python CAD programming library"; + homepage = "https://github.com/gumyr/build123d"; + license = lib.licenses.asl20; + maintainers = with lib.maintainers; [ tnytown ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index dd87d49328147..3fc109bba19fd 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -2333,6 +2333,8 @@ self: super: with self; { build = callPackage ../development/python-modules/build { }; + build123d = callPackage ../development/python-modules/build123d { }; + buildcatrust = callPackage ../development/python-modules/buildcatrust { }; buildstream-plugins = callPackage ../development/python-modules/buildstream-plugins { };