Skip to content

Commit cbb3c37

Browse files
committed
Update README.md
1 parent ad40a89 commit cbb3c37

File tree

2 files changed

+8
-10
lines changed

2 files changed

+8
-10
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,4 +69,4 @@ o3d.visualization.draw_geometries([mesh, wire], window_name='Marching cubes (CUD
6969

7070
## Copyright
7171

72-
MIT License 2019-2021 (c) Tatsuya Yatagawa
72+
MIT License 2019-2024 (c) Tatsuya Yatagawa

mcubes.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,7 @@
11
import argparse
22

33
import numpy as np
4-
import matplotlib.pyplot as plt
5-
6-
# isort: off
7-
# import open3d as o3d
84
import torch
9-
# isort: on
10-
11-
import numpy as np
125
import matplotlib.pyplot as plt
136
from matplotlib.collections import PolyCollection
147

@@ -68,6 +61,11 @@ def yrotate(theta):
6861

6962

7063
def visualize(V, F, C):
64+
"""
65+
This function is inspired by the following URL:
66+
https://blog.scientific-python.org/matplotlib/custom-3d-engine/
67+
"""
68+
7169
V = (V - (V.max(0) + V.min(0)) / 2) / max(V.max(0) - V.min(0))
7270
MVP = perspective(40, 1, 1, 100) @ \
7371
translate(0, 0, -2.5) @ \
@@ -94,7 +92,7 @@ def visualize(V, F, C):
9492
frameon=False,
9593
)
9694

97-
collection = PolyCollection(T, closed=True, linewidth=0.1, facecolor=C, edgecolor="black")
95+
collection = PolyCollection(T, closed=True, linewidth=0.1, facecolor=C, edgecolor='black')
9896
ax.add_collection(collection)
9997

10098
plt.show()
@@ -107,7 +105,7 @@ def main():
107105
args = parser.parse_args()
108106

109107
# Grid data
110-
N = 512
108+
N = 128
111109
Nx, Ny, Nz = N - 8, N, N + 8
112110
x, y, z = np.mgrid[:Nx, :Ny, :Nz]
113111
x = (x / N).astype('float32')

0 commit comments

Comments
 (0)