importtimeimportnumpyasnpimporttorchfromtorchmcubesimportmarching_cubes,grid_interp# Grid dataN=128xs=np.linspace(-1.0,1.0,N,endpoint=True,dtype="float32")ys=np.linspace(-1.0,1.0,N,endpoint=True,dtype="float32")zs=np.linspace(-1.0,1.0,N,endpoint=True,dtype="float32")zs,ys,xs=np.meshgrid...
importtimeimportnumpyasnpimporttorchfromtorchmcubesimportmarching_cubes,grid_interp# Grid dataN=128xs=np.linspace(-1.0,1.0,N,endpoint=True,dtype="float32")ys=np.linspace(-1.0,1.0,N,endpoint=True,dtype="float32")zs=np.linspace(-1.0,1.0,N,endpoint=True,dtype="float32")zs,ys,xs=np.meshgrid...
执行上述步骤后,pip 将从Python包索引(PyPI)下载并安装 mcubes 库。安装完成后,你就可以在你的Python项目中导入并使用 mcubes 了。 这里是一个简单的示例代码,展示了如何使用 mcubes 库: python import mcubes # 创建一个简单的立方体网格 grid = mcubes.marching_cubes(lambda x, y, z: (x-0.5)**2 +...
Marching Cubes Marching Cubes算法是三维数据场等值面生成的经典算法,是体素单元内等值面抽取技术的代表。今天我将进行简单的介绍一下。(It is for extracting a polygonal mesh of an isosurface from a three-dimensional scalar field)。 步骤: 1.确定包含等值面的体素和相应的边。 见上图,8个数据点分别位于该...
from mcubes import marching_cubes import nvdiffrast.torch as dr from einops import rearrange, repeat @@ -175,7 +175,7 @@ def extract_mesh( grid_size=mesh_resolution, ) vertices, faces = mcubes.marching_cubes( vertices, faces = marching_cubes( grid_out['sigma'].squeeze(0).squeeze(-...
import time import numpy as np import torch from torchmcubes import marching_cubes, grid_interp # Grid data N = 128 xs = np.linspace(-1.0, 1.0, N, endpoint=True, dtype="float32") ys = np.linspace(-1.0, 1.0, N, endpoint=True, dtype="float32") zs = np.linspace(-1.0, 1.0, N...
File "D:\3d\TripoSR\env\lib\site-packages\torchmcubes_init.py", line 12, in marching_cubes return mc.mcubes_cuda(vol, thresh) AttributeError: module 'torchmcubes_module' has no attribute 'mcubes_cuda'. Did you mean: 'mcubes_cpu'?
importnumpyasnpimportopen3daso3dimporttorchfromtorchmcubesimportmarching_cubes,grid_interp# Grid dataN=128x,y,z=np.mgrid[:N, :N, :N]x=(x/N).astype('float32')y=(y/N).astype('float32')z=(z/N).astype('float32')# Implicit function (metaball)f0=(x-0.35)**2+(y-0.35)**2+(z...
jlovericmentioned this issueMar 5, 2024 Cannot import D:\comfy\ComfyUI_windows_portable\ComfyUI\custom_nodes\ComfyUI-Flowty-TripoSR module for custom nodes: cannot import name 'marching_cubes' from 'torchmcubes' (unknown location)flowtyone/ComfyUI-Flowty-TripoSR#5 Closed...
import torchmcubes_module as mc def marching_cubes(vol, thresh): """ vol: 3D torch tensor thresh: threshold """ if vol.is_cuda: return mc.mcubes_cuda(vol, thresh) else: return mc.mcubes_cpu(vol, thresh) def grid_interp(vol, points): """ Interpolate volume data at given points ...