Skip to content

Commit b6b994f

Browse files
committed
Add more aliases and update docs
1 parent 4ef49fc commit b6b994f

5 files changed

Lines changed: 128 additions & 125 deletions

File tree

docs/libcarna.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ Geometry Types
77
Each scene might contain multiple types of renderable objects. At least one could distinguish between polygonal and
88
volumetric objects. Planes are certainly a third type: They are neither polygonal because they are infinitely extended,
99
nor are they volumetric. It is up to the user to choose a more fine-grained taxonomy if required. Note that each
10-
rendering stage expects to be told which *geometry type* it should render. For example, by using two CuttingPlanesStage
11-
instances with different values for their *geometry type*, one could render multiple cutting planes with different
12-
windowing settings.
10+
renderer expects to be told which *geometry type* it should render. For example, by using two
11+
:class:`libcarna.cutting_planes` renderers with different values for their *geometry type*, one could render multiple
12+
cutting planes with different windowing settings.
1313

1414
API
1515
---

examples/cells.ipynb

Lines changed: 53 additions & 53 deletions
Large diffs are not rendered by default.

examples/cthead.ipynb

Lines changed: 33 additions & 33 deletions
Large diffs are not rendered by default.

examples/introduction.ipynb

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
"id": "3bf7058d",
1515
"metadata": {
1616
"execution": {
17-
"iopub.execute_input": "2025-05-10T22:58:52.685975Z",
18-
"iopub.status.busy": "2025-05-10T22:58:52.685879Z",
19-
"iopub.status.idle": "2025-05-10T22:58:53.242565Z",
20-
"shell.execute_reply": "2025-05-10T22:58:53.242249Z"
17+
"iopub.execute_input": "2025-05-10T23:18:24.147803Z",
18+
"iopub.status.busy": "2025-05-10T23:18:24.147640Z",
19+
"iopub.status.idle": "2025-05-10T23:18:24.711607Z",
20+
"shell.execute_reply": "2025-05-10T23:18:24.711188Z"
2121
},
2222
"vscode": {
2323
"languageId": "plaintext"
@@ -52,10 +52,10 @@
5252
"id": "cd38b675",
5353
"metadata": {
5454
"execution": {
55-
"iopub.execute_input": "2025-05-10T22:58:53.244297Z",
56-
"iopub.status.busy": "2025-05-10T22:58:53.244138Z",
57-
"iopub.status.idle": "2025-05-10T22:58:53.246088Z",
58-
"shell.execute_reply": "2025-05-10T22:58:53.245839Z"
55+
"iopub.execute_input": "2025-05-10T23:18:24.713023Z",
56+
"iopub.status.busy": "2025-05-10T23:18:24.712854Z",
57+
"iopub.status.idle": "2025-05-10T23:18:24.714887Z",
58+
"shell.execute_reply": "2025-05-10T23:18:24.714593Z"
5959
},
6060
"vscode": {
6161
"languageId": "plaintext"
@@ -84,10 +84,10 @@
8484
"id": "8518d1b2",
8585
"metadata": {
8686
"execution": {
87-
"iopub.execute_input": "2025-05-10T22:58:53.247498Z",
88-
"iopub.status.busy": "2025-05-10T22:58:53.247398Z",
89-
"iopub.status.idle": "2025-05-10T22:58:53.249282Z",
90-
"shell.execute_reply": "2025-05-10T22:58:53.249031Z"
87+
"iopub.execute_input": "2025-05-10T23:18:24.715868Z",
88+
"iopub.status.busy": "2025-05-10T23:18:24.715763Z",
89+
"iopub.status.idle": "2025-05-10T23:18:24.717810Z",
90+
"shell.execute_reply": "2025-05-10T23:18:24.717506Z"
9191
},
9292
"vscode": {
9393
"languageId": "plaintext"
@@ -120,10 +120,10 @@
120120
"id": "df9403bf",
121121
"metadata": {
122122
"execution": {
123-
"iopub.execute_input": "2025-05-10T22:58:53.250815Z",
124-
"iopub.status.busy": "2025-05-10T22:58:53.250599Z",
125-
"iopub.status.idle": "2025-05-10T22:58:53.254615Z",
126-
"shell.execute_reply": "2025-05-10T22:58:53.254382Z"
123+
"iopub.execute_input": "2025-05-10T23:18:24.718778Z",
124+
"iopub.status.busy": "2025-05-10T23:18:24.718677Z",
125+
"iopub.status.idle": "2025-05-10T23:18:24.722955Z",
126+
"shell.execute_reply": "2025-05-10T23:18:24.722623Z"
127127
},
128128
"vscode": {
129129
"languageId": "plaintext"
@@ -133,7 +133,7 @@
133133
{
134134
"data": {
135135
"text/plain": [
136-
"<libcarna._spatial.geometry.<locals>.Geometry at 0x795817f55f10>"
136+
"<libcarna._spatial.geometry.<locals>.Geometry at 0x7bc13bd3df10>"
137137
]
138138
},
139139
"execution_count": 4,
@@ -182,10 +182,10 @@
182182
"id": "4a1a1c31",
183183
"metadata": {
184184
"execution": {
185-
"iopub.execute_input": "2025-05-10T22:58:53.256019Z",
186-
"iopub.status.busy": "2025-05-10T22:58:53.255920Z",
187-
"iopub.status.idle": "2025-05-10T22:58:53.257734Z",
188-
"shell.execute_reply": "2025-05-10T22:58:53.257486Z"
185+
"iopub.execute_input": "2025-05-10T23:18:24.723904Z",
186+
"iopub.status.busy": "2025-05-10T23:18:24.723801Z",
187+
"iopub.status.idle": "2025-05-10T23:18:24.725809Z",
188+
"shell.execute_reply": "2025-05-10T23:18:24.725510Z"
189189
},
190190
"vscode": {
191191
"languageId": "plaintext"
@@ -221,10 +221,10 @@
221221
"id": "0ca491a8",
222222
"metadata": {
223223
"execution": {
224-
"iopub.execute_input": "2025-05-10T22:58:53.259171Z",
225-
"iopub.status.busy": "2025-05-10T22:58:53.259073Z",
226-
"iopub.status.idle": "2025-05-10T22:58:53.342741Z",
227-
"shell.execute_reply": "2025-05-10T22:58:53.342431Z"
224+
"iopub.execute_input": "2025-05-10T23:18:24.726862Z",
225+
"iopub.status.busy": "2025-05-10T23:18:24.726674Z",
226+
"iopub.status.idle": "2025-05-10T23:18:24.810663Z",
227+
"shell.execute_reply": "2025-05-10T23:18:24.810293Z"
228228
},
229229
"vscode": {
230230
"languageId": "plaintext"
@@ -253,10 +253,10 @@
253253
"id": "37ff9c22",
254254
"metadata": {
255255
"execution": {
256-
"iopub.execute_input": "2025-05-10T22:58:53.344394Z",
257-
"iopub.status.busy": "2025-05-10T22:58:53.344161Z",
258-
"iopub.status.idle": "2025-05-10T22:58:53.438265Z",
259-
"shell.execute_reply": "2025-05-10T22:58:53.437994Z"
256+
"iopub.execute_input": "2025-05-10T23:18:24.811737Z",
257+
"iopub.status.busy": "2025-05-10T23:18:24.811599Z",
258+
"iopub.status.idle": "2025-05-10T23:18:24.906354Z",
259+
"shell.execute_reply": "2025-05-10T23:18:24.906025Z"
260260
},
261261
"vscode": {
262262
"languageId": "plaintext"
@@ -266,7 +266,7 @@
266266
{
267267
"data": {
268268
"text/plain": [
269-
"<matplotlib.image.AxesImage at 0x795817e174a0>"
269+
"<matplotlib.image.AxesImage at 0x7bc13bbc7c80>"
270270
]
271271
},
272272
"execution_count": 7,
@@ -307,10 +307,10 @@
307307
"id": "10ab7a0a",
308308
"metadata": {
309309
"execution": {
310-
"iopub.execute_input": "2025-05-10T22:58:53.439871Z",
311-
"iopub.status.busy": "2025-05-10T22:58:53.439594Z",
312-
"iopub.status.idle": "2025-05-10T22:58:53.579008Z",
313-
"shell.execute_reply": "2025-05-10T22:58:53.578562Z"
310+
"iopub.execute_input": "2025-05-10T23:18:24.907427Z",
311+
"iopub.status.busy": "2025-05-10T23:18:24.907317Z",
312+
"iopub.status.idle": "2025-05-10T23:18:25.053244Z",
313+
"shell.execute_reply": "2025-05-10T23:18:25.052770Z"
314314
},
315315
"vscode": {
316316
"languageId": "plaintext"

misc/libcarna/_animation.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import numpy as np
77

88
import libcarna
9+
from ._alias import kwalias
910
from ._axes import AxisHint, resolve_axis_hint
1011

1112

@@ -46,6 +47,7 @@ def step(t: float):
4647
spatial.local_transform = libcarna.math.rotation(axis, radians=2 * np.pi * t) @ base_transform
4748
return step
4849

50+
@kwalias('amplitude', 'amp')
4951
@staticmethod
5052
def swing_local(spatial: libcarna.base.Spatial, axis: AxisHint = 'y', amplitude: float = 45) -> Callable[[float], None]:
5153
"""
@@ -54,7 +56,7 @@ def swing_local(spatial: libcarna.base.Spatial, axis: AxisHint = 'y', amplitude:
5456
Arguments:
5557
spatial: The spatial object to be animated.
5658
axis: The axis of rotation. Can be 'x', 'y', 'z', or an arbitrary axis (vector with 3 components).
57-
amplitude: The amplitude of the swing in degrees.
59+
amplitude: The amplitude of the swing in degrees (alias: `amp`).
5860
"""
5961
axis = resolve_axis_hint(axis)
6062
base_transform = spatial.local_transform
@@ -63,6 +65,7 @@ def step(t: float):
6365
spatial.local_transform = libcarna.math.rotation(axis, radians=radians) @ base_transform
6466
return step
6567

68+
@kwalias('amplitude', 'amp')
6669
@staticmethod
6770
def bounce_local(spatial: libcarna.base.Spatial, axis: AxisHint, amplitude: float = 1.0) -> Callable[[float], None]:
6871
"""
@@ -71,7 +74,7 @@ def bounce_local(spatial: libcarna.base.Spatial, axis: AxisHint, amplitude: floa
7174
Arguments:
7275
spatial: The spatial object to be animated.
7376
axis: The axis of the bounce. Can be 'x', 'y', 'z', or an arbitrary axis (vector with 3 components).
74-
amplitude: The amplitude of the bounce.
77+
amplitude: The amplitude of the bounce (alias: `amp`).
7578
"""
7679
axis = resolve_axis_hint(axis)
7780
base_transform = spatial.local_transform

0 commit comments

Comments
 (0)