Skip to content

Commit

Permalink
needle scene move sharp tip at origin
Browse files Browse the repository at this point in the history
  • Loading branch information
ryichando committed Jan 11, 2025
1 parent 47a162e commit b5e6677
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions examples/needle.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,19 @@
"V, F = app.mesh.square(res=129)\n",
"app.asset.add.tri(\"sheet\", V, F)\n",
"\n",
"V, F = app.mesh.cone(height=5, Nr=20, Ny=32, Nb=12, radius=1)\n",
"V, F = app.mesh.cone(height=5, Nr=40, Ny=64, Nb=12, radius=1, sharpen=2)\n",
"app.asset.add.tri(\"cone\", V, F)\n",
"\n",
"V, F, T = app.mesh.icosphere(r=0.25, subdiv_count=4).tetrahedralize()\n",
"app.asset.add.tet(\"sphere\", V, F, T)\n",
"\n",
"scene = app.scene.create(\"needle-sphere\")\n",
"scene.add(\"cone\").scale(0.2).rotate(90, \"x\").at(0, -0.25, 0).jitter().pin()\n",
"scene.add(\"sphere\").at(0, 1, 0).pin().pull().hold(1.0).unpin()\n",
"scene.add(\"cone\").scale(0.2).rotate(90, \"x\").pin()\n",
"scene.add(\"sphere\").at(0, 1.25, 0).pin().pull().hold(1.0).unpin()\n",
"\n",
"n, space = 5, 0.05\n",
"for i in range(n):\n",
" y = (i + 1) * space\n",
" y = (i + 1) * space + 0.25\n",
" deg = i * 90 / n\n",
" obj = scene.add(\"sheet\").direction([1, 0, 0], [0, 1, 0])\n",
" obj.at(0, y, 0).rotate(90, \"x\").rotate(deg + 5 * random.random(), \"y\")\n",
Expand Down

0 comments on commit b5e6677

Please sign in to comment.