From 340f72960b2a638f25fbd4ac0046b1036d68024e Mon Sep 17 00:00:00 2001 From: Tim Ohliger Date: Sat, 31 Aug 2024 11:43:57 +0200 Subject: [PATCH] Added `m` and `n` as TypeVars to fix stubgen when using Eigen::MatrixXd. --- cpp/pybind/geometry/geometry.cpp | 3 +++ cpp/pybind/pipelines/registration/feature.cpp | 2 ++ 2 files changed, 5 insertions(+) diff --git a/cpp/pybind/geometry/geometry.cpp b/cpp/pybind/geometry/geometry.cpp index 22b63c8184c..42d5538fcf9 100644 --- a/cpp/pybind/geometry/geometry.cpp +++ b/cpp/pybind/geometry/geometry.cpp @@ -45,6 +45,9 @@ void pybind_geometry_classes_declarations(py::module &m) { std::shared_ptr, Geometry> geometry2d(m, "Geometry2D", "The base geometry class for 2D geometries."); + + m.attr("m") = py::module_::import("typing").attr("TypeVar")("m"); + m.attr("n") = py::module_::import("typing").attr("TypeVar")("n"); } void pybind_geometry_classes_definitions(py::module &m) { // open3d.geometry functions diff --git a/cpp/pybind/pipelines/registration/feature.cpp b/cpp/pybind/pipelines/registration/feature.cpp index 5896243b5c3..5735a9be948 100644 --- a/cpp/pybind/pipelines/registration/feature.cpp +++ b/cpp/pybind/pipelines/registration/feature.cpp @@ -19,6 +19,8 @@ void pybind_feature_declarations(py::module &m_registration) { py::class_> feature( m_registration, "Feature", "Class to store featrues for registration."); + m_registration.attr("m") = py::module_::import("typing").attr("TypeVar")("m"); + m_registration.attr("n") = py::module_::import("typing").attr("TypeVar")("n"); } void pybind_feature_definitions(py::module &m_registration) { // open3d.registration.Feature