Skip to content

Commit ad40a89

Browse files
committed
Minor update.
1 parent 4c039d4 commit ad40a89

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,16 @@ pip install git+https://github.com/tatsy/torchmcubes.git
1414
#### Build only
1515

1616
```shell
17-
# After cloning this repo...
18-
python setup.py build_ext -i
17+
# After cloning this repo and moving into the root folder
18+
poetry build
1919
```
2020

2121
## Usage
2222

23-
See [mcubes.py](./mcubes.py) for the detail.
23+
See [mcubes.py](./mcubes.py) for more details.
2424

2525
```python
2626
import numpy as np
27-
import open3d as o3d
2827

2928
import torch
3029
from torchmcubes import marching_cubes, grid_interp
@@ -53,7 +52,9 @@ verts = verts.cpu().numpy()
5352
faces = faces.cpu().numpy()
5453
colrs = colrs.cpu().numpy()
5554

56-
# Use Open3D for visualization
55+
# Use Open3D for visualization (optional)
56+
import open3d as o3d
57+
5758
mesh = o3d.geometry.TriangleMesh()
5859
mesh.vertices = o3d.utility.Vector3dVector(verts)
5960
mesh.triangles = o3d.utility.Vector3iVector(faces)

mcubes.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,6 @@ def visualize(V, F, C):
9797
collection = PolyCollection(T, closed=True, linewidth=0.1, facecolor=C, edgecolor="black")
9898
ax.add_collection(collection)
9999

100-
plt.tight_layout()
101100
plt.show()
102101

103102

@@ -108,7 +107,7 @@ def main():
108107
args = parser.parse_args()
109108

110109
# Grid data
111-
N = 128
110+
N = 512
112111
Nx, Ny, Nz = N - 8, N, N + 8
113112
x, y, z = np.mgrid[:Nx, :Ny, :Nz]
114113
x = (x / N).astype('float32')

0 commit comments

Comments
 (0)