Skip to content

Commit e2d2bd0

Browse files
joseph-schssheorey
andauthored
Fix for #7149 + readme for docker on Windows + fixing typos (#7150)
* A readme for building using docker build script on Windows using WSL * Instructions for building using Docker and WSL * Fix typo in argument of TriangleMesh.create_mobius * Fix typos in comments and strings * Fix another docstring --------- Co-authored-by: Sameer Sheorey <[email protected]>
1 parent d05b8ea commit e2d2bd0

15 files changed

+140
-52
lines changed

cpp/open3d/geometry/TetraMesh.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ class TetraMesh : public MeshBase {
4949
TetraMesh &operator+=(const TetraMesh &mesh);
5050
TetraMesh operator+(const TetraMesh &mesh) const;
5151

52-
/// \brief Function that removes duplicated verties, i.e., vertices that
52+
/// \brief Function that removes duplicated vertices, i.e., vertices that
5353
/// have identical coordinates.
5454
TetraMesh &RemoveDuplicatedVertices();
5555

cpp/open3d/geometry/TriangleMesh.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ class TriangleMesh : public MeshBase {
116116
/// needed.
117117
TriangleMesh &ComputeAdjacencyList();
118118

119-
/// \brief Function that removes duplicated verties, i.e., vertices that
119+
/// \brief Function that removes duplicated vertices, i.e., vertices that
120120
/// have identical coordinates.
121121
TriangleMesh &RemoveDuplicatedVertices();
122122

@@ -560,15 +560,15 @@ class TriangleMesh : public MeshBase {
560560
/// Factory function to create a tetrahedron mesh (trianglemeshfactory.cpp).
561561
/// the mesh centroid will be at (0,0,0) and \p radius defines the
562562
/// distance from the center to the mesh vertices.
563-
/// \param radius defines the distance from centroid to mesh vetices.
563+
/// \param radius defines the distance from centroid to mesh vertices.
564564
/// \param create_uv_map add default UV map to the mesh.
565565
static std::shared_ptr<TriangleMesh> CreateTetrahedron(
566566
double radius = 1.0, bool create_uv_map = false);
567567

568568
/// Factory function to create an octahedron mesh (trianglemeshfactory.cpp).
569569
/// the mesh centroid will be at (0,0,0) and \p radius defines the
570570
/// distance from the center to the mesh vertices.
571-
/// \param radius defines the distance from centroid to mesh vetices.
571+
/// \param radius defines the distance from centroid to mesh vertices.
572572
/// \param create_uv_map add default UV map to the mesh.
573573
static std::shared_ptr<TriangleMesh> CreateOctahedron(
574574
double radius = 1.0, bool create_uv_map = false);

cpp/open3d/t/geometry/PointCloud.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -710,7 +710,7 @@ class PointCloud : public Geometry, public DrawableGeometry {
710710
/// surface points from the first point cloud that have the second point
711711
/// cloud points within the threshold radius, while Precision is the
712712
/// percentage of points from the second point cloud that have the first
713-
/// point cloud points within the threhold radius.
713+
/// point cloud points within the threshold radius.
714714

715715
/// \f{eqnarray*}{
716716
/// \text{Chamfer Distance: } d_{CD}(X,Y) &=& \frac{1}{|X|}\sum_{i \in X}

cpp/open3d/t/geometry/TriangleMesh.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ class TriangleMesh : public Geometry, public DrawableGeometry {
405405
/// Create a tetrahedron triangle mesh. The centroid of the mesh will be
406406
/// placed at (0, 0, 0) and the vertices have a distance of radius to the
407407
/// center.
408-
/// \param radius defines the distance from centroid to mesh vetices.
408+
/// \param radius defines the distance from centroid to mesh vertices.
409409
/// \param float_dtype Float32 or Float64, used to store floating point
410410
/// values, e.g. vertices, normals, colors.
411411
/// \param int_dtype Int32 or Int64, used to store index values, e.g.
@@ -420,7 +420,7 @@ class TriangleMesh : public Geometry, public DrawableGeometry {
420420
/// Create a octahedron triangle mesh. The centroid of the mesh will be
421421
/// placed at (0, 0, 0) and the vertices have a distance of radius to the
422422
/// center.
423-
/// \param radius defines the distance from centroid to mesh vetices.
423+
/// \param radius defines the distance from centroid to mesh vertices.
424424
/// \param float_dtype Float32 or Float64, used to store floating point
425425
/// values, e.g. vertices, normals, colors.
426426
/// \param int_dtype Int32 or Int64, used to store index values, e.g.
@@ -435,7 +435,7 @@ class TriangleMesh : public Geometry, public DrawableGeometry {
435435
/// Create a icosahedron triangle mesh. The centroid of the mesh will be
436436
/// placed at (0, 0, 0) and the vertices have a distance of radius to the
437437
/// center.
438-
/// \param radius defines the distance from centroid to mesh vetices.
438+
/// \param radius defines the distance from centroid to mesh vertices.
439439
/// \param float_dtype Float32 or Float64, used to store floating point
440440
/// values, e.g. vertices, normals, colors.
441441
/// \param int_dtype Int32 or Int64, used to store index values, e.g.
@@ -1063,7 +1063,7 @@ class TriangleMesh : public Geometry, public DrawableGeometry {
10631063
/// percentage of surface points from the first mesh that have the second
10641064
/// mesh within the threshold radius, while Precision is the percentage of
10651065
/// sampled points from the second mesh that have the first mesh surface
1066-
/// within the threhold radius.
1066+
/// within the threshold radius.
10671067

10681068
/// \f{eqnarray*}{
10691069
/// \text{Chamfer Distance: } d_{CD}(X,Y) &=& \frac{1}{|X|}\sum_{i \in X}

cpp/pybind/geometry/trianglemesh.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ void pybind_trianglemesh_definitions(py::module &m) {
421421
.def_static("create_mobius", &TriangleMesh::CreateMobius,
422422
"Factory function to create a Mobius strip.",
423423
"length_split"_a = 70, "width_split"_a = 15,
424-
"twists"_a = 1, "raidus"_a = 1, "flatness"_a = 1,
424+
"twists"_a = 1, "radius"_a = 1, "flatness"_a = 1,
425425
"width"_a = 1, "scale"_a = 1)
426426
.def_readwrite("vertices", &TriangleMesh::vertices_,
427427
"``float64`` array of shape ``(num_vertices, 3)``, "
@@ -710,15 +710,15 @@ void pybind_trianglemesh_definitions(py::module &m) {
710710
{"map_texture_to_each_face", "Map entire texture to each face."}});
711711
docstring::ClassMethodDocInject(
712712
m, "TriangleMesh", "create_tetrahedron",
713-
{{"radius", "Distance from centroid to mesh vetices."},
713+
{{"radius", "Distance from centroid to mesh vertices."},
714714
{"create_uv_map", "Add default uv map to the mesh."}});
715715
docstring::ClassMethodDocInject(
716716
m, "TriangleMesh", "create_octahedron",
717-
{{"radius", "Distance from centroid to mesh vetices."},
717+
{{"radius", "Distance from centroid to mesh vertices."},
718718
{"create_uv_map", "Add default uv map to the mesh."}});
719719
docstring::ClassMethodDocInject(
720720
m, "TriangleMesh", "create_icosahedron",
721-
{{"radius", "Distance from centroid to mesh vetices."},
721+
{{"radius", "Distance from centroid to mesh vertices."},
722722
{"create_uv_map", "Add default uv map to the mesh."}});
723723
docstring::ClassMethodDocInject(
724724
m, "TriangleMesh", "create_sphere",

cpp/pybind/t/geometry/pointcloud.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -765,7 +765,7 @@ the partition id for each point.
765765
766766
Example:
767767
768-
This code computes parititions a point cloud such that each partition
768+
This code computes partitions of a point cloud such that each partition
769769
contains at most 20 points::
770770
771771
import open3d as o3d
@@ -780,16 +780,16 @@ the partition id for each point.
780780

781781
pointcloud.def("compute_metrics", &PointCloud::ComputeMetrics, "pcd2"_a,
782782
"metrics"_a, "params"_a,
783-
R"(Compute various metrics between two point clouds.
784-
785-
Currently, Chamfer distance, Hausdorff distance and F-Score `[Knapitsch2017] <../tutorial/reference.html#Knapitsch2017>`_ are supported.
786-
The Chamfer distance is the sum of the mean distance to the nearest neighbor
783+
R"(Compute various metrics between two point clouds.
784+
785+
Currently, Chamfer distance, Hausdorff distance and F-Score `[Knapitsch2017] <../tutorial/reference.html#Knapitsch2017>`_ are supported.
786+
The Chamfer distance is the sum of the mean distance to the nearest neighbor
787787
from the points of the first point cloud to the second point cloud. The F-Score
788-
at a fixed threshold radius is the harmonic mean of the Precision and Recall.
789-
Recall is the percentage of surface points from the first point cloud that have
790-
the second point cloud points within the threshold radius, while Precision is
791-
the percentage of points from the second point cloud that have the first point
792-
cloud points within the threhold radius.
788+
at a fixed threshold radius is the harmonic mean of the Precision and Recall.
789+
Recall is the percentage of surface points from the first point cloud that have
790+
the second point cloud points within the threshold radius, while Precision is
791+
the percentage of points from the second point cloud that have the first point
792+
cloud points within the threshold radius.
793793
794794
.. math::
795795
:nowrap:

cpp/pybind/t/geometry/trianglemesh.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ This example shows how to create a hemisphere from a sphere::
408408
"device"_a = core::Device("CPU:0"))
409409
.def_static("create_mobius", &TriangleMesh::CreateMobius,
410410
"Create a Mobius strip.", "length_split"_a = 70,
411-
"width_split"_a = 15, "twists"_a = 1, "raidus"_a = 1,
411+
"width_split"_a = 15, "twists"_a = 1, "radius"_a = 1,
412412
"flatness"_a = 1, "width"_a = 1, "scale"_a = 1,
413413
"float_dtype"_a = core::Float32,
414414
"int_dtype"_a = core::Int64,
@@ -431,19 +431,19 @@ This example shows how to create a hemisphere from a sphere::
431431
{"device", "Device of the create sphere."}});
432432
docstring::ClassMethodDocInject(
433433
m, "TriangleMesh", "create_tetrahedron",
434-
{{"radius", "Distance from centroid to mesh vetices."},
434+
{{"radius", "Distance from centroid to mesh vertices."},
435435
{"float_dtype", "Float_dtype, Float32 or Float64."},
436436
{"int_dtype", "Int_dtype, Int32 or Int64."},
437437
{"device", "Device of the create tetrahedron."}});
438438
docstring::ClassMethodDocInject(
439439
m, "TriangleMesh", "create_octahedron",
440-
{{"radius", "Distance from centroid to mesh vetices."},
440+
{{"radius", "Distance from centroid to mesh vertices."},
441441
{"float_dtype", "Float_dtype, Float32 or Float64."},
442442
{"int_dtype", "Int_dtype, Int32 or Int64."},
443443
{"device", "Device of the create octahedron."}});
444444
docstring::ClassMethodDocInject(
445445
m, "TriangleMesh", "create_icosahedron",
446-
{{"radius", "Distance from centroid to mesh vetices."},
446+
{{"radius", "Distance from centroid to mesh vertices."},
447447
{"float_dtype", "Float_dtype, Float32 or Float64."},
448448
{"int_dtype", "Int_dtype, Int32 or Int64."},
449449
{"device", "Device of the create octahedron."}});
@@ -545,7 +545,7 @@ This example shows how to create a hemisphere from a sphere::
545545
Text as triangle mesh.
546546
547547
Example:
548-
This shows how to simplifify the Stanford Bunny mesh::
548+
This shows how to simplify the Stanford Bunny mesh::
549549
550550
import open3d as o3d
551551
@@ -635,7 +635,7 @@ This function always uses the CPU device.
635635
Simplified TriangleMesh.
636636
637637
Example:
638-
This shows how to simplifify the Stanford Bunny mesh::
638+
This shows how to simplify the Stanford Bunny mesh::
639639
640640
bunny = o3d.data.BunnyMesh()
641641
mesh = o3d.t.geometry.TriangleMesh.from_legacy(o3d.io.read_triangle_mesh(bunny.path))
@@ -662,7 +662,7 @@ This function always uses the CPU device.
662662
The mesh describing the union volume.
663663
664664
Example:
665-
This copmutes the union of a sphere and a cube::
665+
This computes the union of a sphere and a cube::
666666
667667
box = o3d.geometry.TriangleMesh.create_box()
668668
box = o3d.t.geometry.TriangleMesh.from_legacy(box)
@@ -693,7 +693,7 @@ This function always uses the CPU device.
693693
The mesh describing the intersection volume.
694694
695695
Example:
696-
This copmutes the intersection of a sphere and a cube::
696+
This computes the intersection of a sphere and a cube::
697697
698698
box = o3d.geometry.TriangleMesh.create_box()
699699
box = o3d.t.geometry.TriangleMesh.from_legacy(box)
@@ -1156,8 +1156,8 @@ the sampled surface points of the first mesh to the second mesh and vice versa.
11561156
The F-Score at the fixed threshold radius is the harmonic mean of the Precision
11571157
and Recall. Recall is the percentage of surface points from the first mesh that
11581158
have the second mesh within the threshold radius, while Precision is the
1159-
percentage of sampled points from the second mesh that have the first mesh
1160-
surface within the threhold radius.
1159+
percentage of sampled points from the second mesh that have the first mesh
1160+
surface within the threshold radius.
11611161
11621162
.. math::
11631163
:nowrap:

cpp/tests/core/FixedRadiusIndex.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ TEST(FixedRadiusIndex, SearchRadius) {
8181
float radius = 0.1;
8282
core::nns::FixedRadiusIndex index32(dataset_points, radius, core::Int32);
8383

84-
// if raidus == 0.1
84+
// if radius == 0.1
8585
core::Tensor indices, distances, neighbors_row_splits;
8686
core::SizeVector shape{2};
8787
gt_indices = core::Tensor::Init<int32_t>({1, 4}, device);
@@ -102,7 +102,7 @@ TEST(FixedRadiusIndex, SearchRadius) {
102102
// Set up index.
103103
core::nns::FixedRadiusIndex index64(dataset_points, radius, core::Int64);
104104

105-
// if raidus == 0.1
105+
// if radius == 0.1
106106
shape = core::SizeVector{2};
107107
gt_indices = core::Tensor::Init<int64_t>({1, 4}, device);
108108
gt_neighbors_row_splits = gt_neighbors_row_splits.To(core::Int64);
@@ -324,7 +324,7 @@ TEST(FixedRadiusIndex, SearchHybrid) {
324324
int max_knn = 3;
325325
core::nns::FixedRadiusIndex index32(dataset_points, radius, core::Int32);
326326

327-
// if raidus == 0.1
327+
// if radius == 0.1
328328
core::Tensor indices, distances, counts;
329329
core::SizeVector shape{1, 3};
330330
core::SizeVector shape_counts{1};
@@ -347,7 +347,7 @@ TEST(FixedRadiusIndex, SearchHybrid) {
347347
// Set up index.
348348
core::nns::FixedRadiusIndex index64(dataset_points, radius, core::Int64);
349349

350-
// if raidus == 0.1
350+
// if radius == 0.1
351351
gt_indices = core::Tensor::Init<int64_t>({{1, 4, -1}}, device);
352352
gt_counts = core::Tensor::Init<int64_t>({2}, device);
353353

cpp/tests/core/NearestNeighborSearch.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ TEST_P(NNSPermuteDevices, FixedRadiusSearch) {
191191
std::runtime_error);
192192
}
193193

194-
// If raidus == 0.1.
194+
// If radius == 0.1.
195195
nns32.FixedRadiusIndex(0.1);
196196
std::tuple<core::Tensor, core::Tensor, core::Tensor> result;
197197
core::SizeVector shape{2};
@@ -223,7 +223,7 @@ TEST_P(NNSPermuteDevices, FixedRadiusSearch) {
223223
std::runtime_error);
224224
}
225225

226-
// If raidus == 0.1.
226+
// If radius == 0.1.
227227
nns64.FixedRadiusIndex(0.1);
228228
gt_indices = core::Tensor::Init<int64_t>({1, 4}, device);
229229
gt_distances = core::Tensor::Init<double>({0.00626358, 0.00747938}, device);

docker/README.md

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Open3D Docker
22

3+
This README covers, first, dependencies and instructions for building Linux, then those
4+
for Windows.
5+
36
## Dependencies
47

58
### Docker dependencies
@@ -66,3 +69,80 @@ cd docker
6669
```
6770

6871
See `./docker_build.sh` and `./docker_test.sh` for all available options.
72+
73+
## Building for Linux under Windows
74+
75+
You can build and test Open3D for Linux in a Docker container under Windows using the provided scripts thanks to **[Docker Desktop for Windows](https://docs.docker.com/desktop/setup/install/windows-install/)** and **[WSL](https://learn.microsoft.com/en-us/windows/wsl/about)**.
76+
77+
This guide walks you through installing Docker Desktop, setting up Windows Subsystem for Linux (WSL), configuring Docker integration with WSL, and building Open3D for Linux including its documentation and the Python wheel, and testing it, using the provided scripts (respectively `docker_build.sh` and `docker_test.sh`).
78+
79+
### Step 1: Install Docker Desktop
80+
81+
1. **Download and Install**: [Download Docker Desktop](https://www.docker.com/products/docker-desktop) and follow the on-screen prompts to install.
82+
2. **Launch Docker Desktop**: After installation, open Docker Desktop to ensure it is running.
83+
84+
### Step 2: Install and Set Up WSL
85+
86+
1. **Enable WSL**: Open PowerShell as Administrator and install WSL:
87+
88+
```powershell
89+
wsl --install
90+
```
91+
92+
2. **Install a Linux Distribution** (e.g., Ubuntu-24.04):
93+
94+
```powershell
95+
wsl --install -d Ubuntu-24.04
96+
```
97+
98+
3. **Restart** your system if prompted.
99+
100+
### Step 3: Enable Docker Integration with WSL
101+
102+
1. **Open Docker Desktop**.
103+
2. **Go to Settings** > **Resources** > **WSL Integration**.
104+
3. **Enable Integration** for your Linux distribution (e.g., Ubuntu-24.04).
105+
4. If necessary, **restart Docker Desktop** to apply the changes.
106+
107+
### Step 4: Clone and check out Open3D repository
108+
109+
1. **Open a terminal** within WSL.
110+
2. **Clone and check out** Open3D repository into the folder of your choice:
111+
112+
```bash
113+
git clone https://github.com/isl-org/Open3D /path/to/Open3D
114+
```
115+
116+
### Step 5: Build Open3D for Linux in WSL using the provided script
117+
118+
1. **Open your WSL terminal**.
119+
2. **Navigate** to the Docker folder in the Open3D repository:
120+
121+
```bash
122+
cd /path/to/Open3D/docker
123+
```
124+
125+
3. **Disable PyTorch and TensorFlow ops** if not needed:
126+
127+
```bash
128+
export BUILD_PYTORCH_OPS=OFF
129+
export BUILD_TENSORFLOW_OPS=OFF
130+
```
131+
132+
4. **Run the Docker build script**:
133+
134+
E.g.:
135+
136+
```bash
137+
./docker_build.sh openblas-amd64-py312
138+
```
139+
140+
Check the log of the build. After the build completes, you will have an Open3D Docker image ready to use, and the artifacts (binaries, documentation and Python package) will have been copied back to the host.
141+
142+
5. **Run tests within the built Docker image**:
143+
144+
E.g.:
145+
146+
```bash
147+
./docker_test.sh openblas-amd64-py312
148+
```

0 commit comments

Comments
 (0)