From a28f68aed777e07c9f78a629f71d5331631a7a2a Mon Sep 17 00:00:00 2001 From: Philipp Schlegel Date: Mon, 26 Aug 2024 15:28:56 +0100 Subject: [PATCH] small update to the docs --- docs/animations.md | 23 +++++++++++++++++++++++ docs/controls.md | 25 ++++++++++++++++++++++++- docs/intro.md | 23 +++++++++++++---------- docs/objects.md | 21 +++++++++++++++++++++ 4 files changed, 81 insertions(+), 11 deletions(-) diff --git a/docs/animations.md b/docs/animations.md index 81979e2..1ac867b 100644 --- a/docs/animations.md +++ b/docs/animations.md @@ -48,3 +48,26 @@ cube rotate faster: You could decouple the rotation from the frame rate by incrementing the rotation depending on how much time has passed since the last call. + + +## What next? + +
+ +- :material-cube:{ .lg .middle } __Objects__ + + --- + + Check out the guide on different object types. + + [:octicons-arrow-right-24: Adding Objects](objects.md) + +- :material-camera-control:{ .lg .middle } __Control__ + + --- + + Learn how to control the viewer, adjust colors, etc. + + [:octicons-arrow-right-24: Controls](controls.md) + +
\ No newline at end of file diff --git a/docs/controls.md b/docs/controls.md index fee786d..e003ce2 100644 --- a/docs/controls.md +++ b/docs/controls.md @@ -132,4 +132,27 @@ To activate them you can either press the `c` hotkey or: >>> v.show_controls() ``` -
jupyter toolbar
\ No newline at end of file +
jupyter toolbar
+ + +## What next? + +
+ +- :material-cube:{ .lg .middle } __Objects__ + + --- + + Check out the guide on different object types. + + [:octicons-arrow-right-24: Adding Objects](objects.md) + +- :material-format-font:{ .lg .middle } __Animations__ + + --- + + Add movement to the viewer. + + [:octicons-arrow-right-24: Animations](animations.md) + +
\ No newline at end of file diff --git a/docs/intro.md b/docs/intro.md index add6dc5..b59250d 100644 --- a/docs/intro.md +++ b/docs/intro.md @@ -20,21 +20,24 @@ cube = gfx.Mesh( # Add to viewer v.add(cube) - -# This will show the viewer this cell -v.show() ``` !!! important - The `.show()` method generates and returns a widget wrapping the `Viewer`. In order for it to be displayed - this _has_ to be on the last line of the cell. The only other alternative is this: + In Jupyter, the `.show()` method generates and displays a widget wrapping the `Viewer`. In a script/terminal, + the `.show()` message will cause the window to appear. By default, the viewer is displayed right away but you + can decide to belay that like so: ```python - from IPython.display import display - display(v.show()) # display the widget + v = oc.Viewer(show=False) # set show=False when initializing the viewer ... - do other stuff + do stuff + ``` + + Then in another cell: + + ```python + v.show() ``` ![cube example](_static/cube_example_jupyter.png) @@ -42,8 +45,8 @@ v.show() !!! tip "Resizing the widget" You can adjust the size of the widget either when creating the viewer via - the `height` and `width` arguments, or afterwards by clicking + dragging the - lower right corner of the widget. + the `size` argument, or afterwards by clicking + dragging the lower right corner of + the widget. ### Sidecar diff --git a/docs/objects.md b/docs/objects.md index bddebd9..98a493a 100644 --- a/docs/objects.md +++ b/docs/objects.md @@ -138,3 +138,24 @@ by `Octarine`? Go check out the [Extending Octarine](extending.md) tutorial to learn how! +## What next? + +
+ +- :material-format-font:{ .lg .middle } __Animations__ + + --- + + Add movement to the viewer. + + [:octicons-arrow-right-24: Animations](animations.md) + +- :material-camera-control:{ .lg .middle } __Control__ + + --- + + Learn how to control the viewer, adjust colors, etc. + + [:octicons-arrow-right-24: Controls](controls.md) + +
\ No newline at end of file