Skip to content

Commit

Permalink
domino example update
Browse files Browse the repository at this point in the history
  • Loading branch information
ryichando committed Jan 10, 2025
1 parent 69a6147 commit 9f57b27
Showing 1 changed file with 35 additions and 10 deletions.
45 changes: 35 additions & 10 deletions examples/domino.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"from frontend import App\n",
"\n",
"app = App.create(\"domino\")\n",
"V, F, T = app.mesh.box().subdivide(1).tetrahedralize().scale(0.1, 0.3, 0.025)\n",
"V, F, T = app.mesh.box().tetrahedralize().scale(0.1, 0.25, 0.025)\n",
"app.asset.add.tet(\"block\", V, F, T)\n",
"scene = app.scene.create(\"domino\")\n",
"\n",
Expand Down Expand Up @@ -44,13 +44,12 @@
"source": [
"param = app.session.param()\n",
"(\n",
" param.set(\"volume-young-mod\", 1000)\n",
" .set(\"volume-poiss-rat\", 0.499)\n",
" param.set(\"volume-poiss-rat\", 0.49)\n",
" .set(\"friction\", 0.1)\n",
" .set(\"min-newton-steps\", 32)\n",
" .set(\"dt\", 0.01)\n",
" .set(\"fps\", 30)\n",
" .set(\"frames\", 200)\n",
" .set(\"frames\", 250)\n",
")\n",
"\n",
"session = app.session.create(fixed)\n",
Expand Down Expand Up @@ -87,11 +86,11 @@
"outputs": [],
"source": [
"if not app.CI:\n",
" # A quadratic barrier\n",
" param.set(\"barrier\", \"quad\")\n",
" quad_session = app.session.create(fixed)\n",
" quad_session.start(param).preview()\n",
" quad_session.stream()"
" # An increased stiffness\n",
" param.set(\"volume-poiss-rat\", 0.499).set(\"frames\", 32).set(\"barrier\", \"cubic\")\n",
" stiff_cubic_session = app.session.create(fixed)\n",
" stiff_cubic_session.start(param).preview()\n",
" stiff_cubic_session.stream()"
]
},
{
Expand All @@ -102,7 +101,33 @@
"outputs": [],
"source": [
"if not app.CI:\n",
" quad_session.animate()"
" stiff_cubic_session.animate()"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "056ae90d-8383-4ed0-81f8-f52b178aa13a",
"metadata": {},
"outputs": [],
"source": [
"if not app.CI:\n",
" # An increased stiffness quadratic\n",
" param.set(\"barrier\", \"quad\")\n",
" stiff_quad_session = app.session.create(fixed)\n",
" stiff_quad_session.start(param).preview()\n",
" stiff_quad_session.stream()"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "bf7669c6-7cb5-4b9f-a402-17611d051508",
"metadata": {},
"outputs": [],
"source": [
"if not app.CI:\n",
" stiff_quad_session.animate()"
]
}
],
Expand Down

0 comments on commit 9f57b27

Please sign in to comment.