Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@
- macOS x86_64 not longer supported, only macOS arm64 is supported.
- Python 3.13+3.14 support
- Fix Windows build failure for PyTorch ops due to PyTorch's bundled fmt (v11+) requiring `/utf-8` with MSVC (PR #7447)
- Add `use_normal_length_as_confidence` boolean parameter to Poisson surface reconstruction


## 0.13
Expand Down
20 changes: 13 additions & 7 deletions cpp/open3d/geometry/SurfaceReconstructionPoisson.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,7 @@ void Execute(const open3d::geometry::PointCloud& pcd,
float width,
float scale,
bool linear_fit,
bool use_normal_length_as_confidence,
UIntPack<FEMSigs...>) {
static const int Dim = sizeof...(FEMSigs);
typedef UIntPack<FEMSigs...> Sigs;
Expand All @@ -421,6 +422,9 @@ void Execute(const open3d::geometry::PointCloud& pcd,
int base_depth = 0;
int base_v_cycles = 1;
float confidence = 0.f;
if (use_normal_length_as_confidence) {
confidence = 1.f;
}
Comment thread
shlok-ramlab marked this conversation as resolved.
float point_weight = 2.f * DEFAULT_FEM_DEGREE;
float confidence_bias = 0.f;
float samples_per_node = 1.5f;
Expand Down Expand Up @@ -716,12 +720,14 @@ void Execute(const open3d::geometry::PointCloud& pcd,
} // namespace

std::tuple<std::shared_ptr<TriangleMesh>, std::vector<double>>
TriangleMesh::CreateFromPointCloudPoisson(const PointCloud& pcd,
size_t depth,
float width,
float scale,
bool linear_fit,
int n_threads) {
TriangleMesh::CreateFromPointCloudPoisson(
const PointCloud& pcd,
size_t depth,
float width,
float scale,
bool linear_fit,
int n_threads,
bool use_normal_length_as_confidence) {
static const BoundaryType BType = DEFAULT_FEM_BOUNDARY;
typedef IsotropicUIntPack<
DIMENSION, FEMDegreeAndBType</* Degree */ 1, BType>::Signature>
Expand All @@ -746,7 +752,7 @@ TriangleMesh::CreateFromPointCloudPoisson(const PointCloud& pcd,
auto mesh = std::make_shared<TriangleMesh>();
std::vector<double> densities;
Execute<float>(pcd, mesh, densities, static_cast<int>(depth), width, scale,
linear_fit, FEMSigs());
linear_fit, use_normal_length_as_confidence, FEMSigs());

ThreadPool::Terminate();

Expand Down
5 changes: 4 additions & 1 deletion cpp/open3d/geometry/TriangleMesh.h
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,8 @@ class TriangleMesh : public MeshBase {
/// for reconstruction and the diameter of the samples' bounding cube.
/// \param linear_fit If true, the reconstructor use linear interpolation to
/// estimate the positions of iso-vertices.
/// \param use_normal_length_as_confidence If true, use the length (norm)
/// of normal vectors as point confidence.
/// \param n_threads Number of threads used for reconstruction. Set to -1 to
/// automatically determine it.
/// \return The estimated TriangleMesh, and per vertex density values that
Expand All @@ -555,7 +557,8 @@ class TriangleMesh : public MeshBase {
float width = 0.0f,
float scale = 1.1f,
bool linear_fit = false,
int n_threads = -1);
int n_threads = -1,
bool use_normal_length_as_confidence = false);

Comment thread
shlok-ramlab marked this conversation as resolved.
/// Factory function to create a tetrahedron mesh (trianglemeshfactory.cpp).
/// the mesh centroid will be at (0,0,0) and \p radius defines the
Expand Down
8 changes: 6 additions & 2 deletions cpp/pybind/geometry/trianglemesh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,8 @@ void pybind_trianglemesh_definitions(py::module &m) {
"This function uses the original implementation by "
"Kazhdan. See https://github.com/mkazhdan/PoissonRecon",
"pcd"_a, "depth"_a = 8, "width"_a = 0, "scale"_a = 1.1,
"linear_fit"_a = false, "n_threads"_a = -1)
"linear_fit"_a = false, "n_threads"_a = -1,
"use_normal_length_as_confidence"_a = false)
.def_static(
"create_from_oriented_bounding_box",
&TriangleMesh::CreateFromOrientedBoundingBox,
Expand Down Expand Up @@ -694,7 +695,10 @@ void pybind_trianglemesh_definitions(py::module &m) {
"estimate the positions of iso-vertices."},
{"n_threads",
"Number of threads used for reconstruction. Set to -1 to "
"automatically determine it."}});
"automatically determine it."},
{"use_normal_length_as_confidence",
"If true, use the length (norm) of normal vectors as a per-point "
"confidence."}});
docstring::ClassMethodDocInject(
m, "TriangleMesh", "create_from_oriented_bounding_box",
{{"obox", "OrientedBoundingBox object to create mesh of."},
Expand Down