Skip to content

Commit

Permalink
DOCS: Update variable descriptions in visualization examples (#915)
Browse files Browse the repository at this point in the history
  • Loading branch information
WassCodeur authored Jul 30, 2024
1 parent 08d4948 commit 69f3b1c
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 26 deletions.
12 changes: 7 additions & 5 deletions docs/examples/viz_animated_surfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,15 @@ def update_surface(x, y, equation, cmap_name="viridis"):

###############################################################################
# Variables and their usage:
# :time - float: initial value of the time variable i.e. value of the time variable at
# the beginning of the program; (default = 0)
#
# time: float
# initial value of the time variable i.e. value of the time variable at
# the beginning of the program; (default = 0)
# dt: float
# amount by which ``time`` variable is incremented for every iteration
# of timer_callback function (default = 0.1)
# amount by which ``time`` variable is incremented for every iteration
# of timer_callback function (default = 0.1)
# lower_xbound: float
# lower bound of the x values in which the function is plotted
# lower bound of the x values in which the function is plotted
# (default = -1)
# upper_xbound: float
# Upper bound of the x values in which the function is plotted
Expand Down
23 changes: 14 additions & 9 deletions docs/examples/viz_bezier_interpolator.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,22 @@
# =============================
# In order to make a cubic bezier curve based animation, you need four values
# for every keyframe:
#
# 1- Timestamp: The time that the keyframe is assigned to.
# 2- value: The value of the keyframe. This might be position, quaternion, or
# scale value.
# 3- In control point: The control point used when the value is the destination
# value.
#
# 2- Value: The value of the keyframe. This might be position, quaternion, or scale
# value.
#
# 3- In control point: The control point used when the value is the destination value.
#
# 4- Out control point: The control point used when the value is the departure
# value::
# value::
#
# keyframe 0 -----------------> keyframe 1
# (time-0) (value-0) (out-cp-0) -----------------> (time-1) (value-1) (in-cp-1)
# keyframe 0 -----------------> keyframe 1
# (time-0) (value-0) (out-cp-0) -----------------> (time-1) (value-1) (in-cp-1)
# keyframe 1 -----------------> keyframe 2
# (time-1) (value-1) (out-cp-1) -----------------> (time-2) (value-2) (in-cp-2)
#
# keyframe 1 -----------------> keyframe 2
# (time-1) (value-1) (out-cp-1) -----------------> (time-2) (value-2) (in-cp-2)

keyframe_1 = {"value": [-2, 0, 0], "out_cp": [-15, 6, 0]}
keyframe_2 = {"value": [18, 0, 0], "in_cp": [27, 18, 0]}
Expand Down Expand Up @@ -79,10 +82,12 @@
#
# Cubic Bezier keyframes consists of 4 data per keyframe
# Timestamp, position, in control point, and out control point.
#
# - In control point is the cubic bezier control point for the associated
# position when this position is the destination position.
# - Out control point is the cubic bezier control point for the associated
# position when this position is the origin position or departing position.
#
# Note: If a control point is not provided or set `None`, this control point
# will be the same as the position itself.

Expand Down
2 changes: 1 addition & 1 deletion docs/examples/viz_billboard_sdf_spheres.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@
###############################################################################
# References
# ----------
# .. [Hart1996] Hart, John C. "Sphere tracing: A geometric method for the
# .. _[Hart1996] Hart, John C. "Sphere tracing: A geometric method for the
# antialiased ray tracing of implicit surfaces." The Visual
# Computer 12.10 (1996): 527-545.
#
Expand Down
30 changes: 19 additions & 11 deletions docs/examples/viz_emwave_animation.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,25 @@ def update_coordinates(wavenumber, ang_frq, time, phase_angle):


###############################################################################
# Variable(s) and their description-
# npoints: For high quality rendering, keep the number of npoints high
# but kindly note that higher values for npoints will slow down the
# rendering process (default = 800)
# wavelength : wavelength of the wave (default = 2)
# wavenumber : 2*pi/wavelength
# time: time (default time i.e. time at beginning of the animation = 0)
# incre_time: value by which time is incremented for each call of
# timer_callback (default = 0.1)
# angular_frq: angular frequency (default = 0.1)
# phase_angle: phase angle (default = 0.002)
# Variable(s) and their description
#
# npoints: int
# For high quality rendering, keep the number of npoints high
# but kindly note that higher values for npoints will slow down the
# rendering process (default = 800)
# wavelength: int
# wavelength of the wave (default = 2)
# wavenumber: float
# 2*pi/wavelength
# time: float
# time (default time i.e. time at beginning of the animation = 0)
# incre_time: float
# value by which time is incremented for each call of
# timer_callback (default = 0.1)
# angular_frq: float
# angular frequency (default = 0.1)
# phase_angle: float
# phase angle (default = 0.002)


npoints = 800
Expand Down

0 comments on commit 69f3b1c

Please sign in to comment.