Skip to content

Commit

Permalink
add more comments
Browse files Browse the repository at this point in the history
  • Loading branch information
kwea123 committed May 26, 2020
1 parent b1af183 commit 6ea0410
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions extract_mesh.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@
"\n",
"# The below lines are for visualization, COMMENT OUT once you find the best range and increase N!\n",
"vertices, triangles = mcubes.marching_cubes(sigma, sigma_threshold)\n",
"\n",
"mesh = trimesh.Trimesh(vertices/N, triangles)\n",
"mesh.show()"
]
Expand All @@ -118,8 +117,8 @@
"metadata": {},
"outputs": [],
"source": [
"# You can already export \"colorless\" mesh if you don't need color\n",
"mcubes.export_mesh(vertices, triangles, f\"{scene_name}.dae\")"
"# # You can already export \"colorless\" mesh if you don't need color\n",
"# mcubes.export_mesh(vertices, triangles, f\"{scene_name}.dae\")"
]
},
{
Expand All @@ -135,10 +134,13 @@
"metadata": {},
"outputs": [],
"source": [
"assert N==512, \\\n",
" 'Please set N to 512 in the two above cell! Remember to comment out the visualization code (last 3 lines)!'\n",
"\n",
"a = 1-np.exp(-(xmax-xmin)/N*sigma)\n",
"a = a.flatten()\n",
"rgb = (rgbsigma[:, :3].numpy()*255).astype(np.uint32)\n",
"i = np.where(a>0)[0] # valid indices\n",
"i = np.where(a>0)[0] # valid indices (alpha>0)\n",
"\n",
"rgb = rgb[i]\n",
"a = a[i]\n",
Expand Down

0 comments on commit 6ea0410

Please sign in to comment.