Skip to content

Commit 6e8c992

Browse files
authored
Fix python docs (#108)
* docs: fix missing space * docs: fix collision_mesh.rest_positions not being callable in Python * docs: fix function names in example.ipynb for ipctk 1.3.0
1 parent 5b95801 commit 6e8c992

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

docs/source/tutorial/getting_started.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ To start we need the current positions of the ``vertices``. For this tutorial, l
7777

7878
.. code-block:: python
7979
80-
vertices = collision_mesh.rest_positions()
80+
vertices = collision_mesh.rest_positions.copy()
8181
vertices[:, 1] *= 0.01 # Squash the bunny in the y-direction
8282
8383
Using these deformed positions, we can build the set of active collisions.
@@ -249,7 +249,7 @@ Adaptive Barrier Stiffness
249249

250250
The last piece of the barrier potential is the barrier stiffness. This is a weight that is multiplied by the barrier potential to better scale it relative to the energy potential. This can be a fixed value or adaptive.
251251

252-
To compute the adaptive barrier stiffness, we can use two functions: ``initial_barrier_stiffness`` and ``update_barrier_stiffness``. The function ``initial_barrier_stiffness``computes the initial value from the current energy and barrier potential gradients. This function also provides a minimum and maximum value for the barrier stiffness. The function ``update_barrier_stiffness`` updates the barrier stiffness if the minimum distance has become too small.
252+
To compute the adaptive barrier stiffness, we can use two functions: ``initial_barrier_stiffness`` and ``update_barrier_stiffness``. The function ``initial_barrier_stiffness`` computes the initial value from the current energy and barrier potential gradients. This function also provides a minimum and maximum value for the barrier stiffness. The function ``update_barrier_stiffness`` updates the barrier stiffness if the minimum distance has become too small.
253253

254254
.. md-tab-set::
255255

python/example.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91058,8 +91058,8 @@
9105891058
"d = numpy.geomspace(1e-12, 0.2, 1000)\n",
9105991059
"dhat = 0.1\n",
9106091060
"b = numpy.vectorize(lambda x: barrier(x, dhat))(d)\n",
91061-
"b_grad = numpy.vectorize(lambda x: barrier_gradient(x, dhat))(d)\n",
91062-
"b_hess = numpy.vectorize(lambda x: barrier_hessian(x, dhat))(d)\n",
91061+
"b_grad = numpy.vectorize(lambda x: barrier_first_derivative(x, dhat))(d)\n",
91062+
"b_hess = numpy.vectorize(lambda x: barrier_second_derivative(x, dhat))(d)\n",
9106391063
"fig = go.Figure(data=[go.Scatter(x=d, y=b, name=\"b(x)\"), go.Scatter(x=d, y=b_grad, name=r\"\\nabla b(x)\"), go.Scatter(x=d, y=b_hess, name=r\"\\nabla^2 b(x)\")])\n",
9106491064
"fig.update_layout(yaxis_range=[-1000, 1000])\n",
9106591065
"fig.show()"

0 commit comments

Comments
 (0)