visualdynamics.viz.animate¶
animate
¶
Moving a geometry scene without rebuilding it.
The scene's meshes all share one point buffer (see shared_points), so a
frame is: compute the offsets for the moving nodes, write them through a
numpy view of VTK's memory, and mark it modified. Nothing is allocated and
nothing is rebuilt, which is what keeps large models animatable.
Knows nothing about Qt — the caller drives it.
Classes:
| Name | Description |
|---|---|
PairedAnimator |
Two deflections of one geometry, moving in step. |
GeometryAnimator |
A geometry scene whose nodes move with a deflection. |
EnvelopeAnimator |
One copy of a PSD envelope; a ± pair of these is the picture. |
Functions:
| Name | Description |
|---|---|
animate_shape |
One mode shape moving on a geometry, as the GUI animates it. |
animate_envelope |
A PSD's envelope on a geometry, as the GUI shows it: two copies |
animate_ods |
The operating deflection shape of complex spectra at one line, |
Classes¶
PairedAnimator
¶
PairedAnimator(
first: GeometryAnimator, second: GeometryAnimator
)
Two deflections of one geometry, moving in step.
Each copy keeps its own point buffer and its own automatic scale, so two mode shapes of different normalization compare by shape — which is what overlaying them is for.
Attributes:
| Name | Type | Description |
|---|---|---|
deflection |
Any
|
The first copy's — for a pair sharing one deflection (the |
Source code in src/visualdynamics/viz/animate.py
GeometryAnimator
¶
GeometryAnimator(
plotter: Any,
geometry: Geometry,
deflection: Deflection,
unit_system: UnitSystem | None = None,
fraction: float = 0.1,
colormap: bool = False,
clim: tuple[float, float] | None = None,
scalar_name: str = "displacement",
**draw: Any,
)
A geometry scene whose nodes move with a deflection.
deflection supplies offsets for the nodes it moves; everything else
holds its base position. parameter means phase in radians for a mode
shape and a sample index for time data.
Methods:
| Name | Description |
|---|---|
set_parameter |
Place the nodes for this phase or sample index. |
reset |
Put every node back where it started. |
Source code in src/visualdynamics/viz/animate.py
Methods:¶
set_parameter
¶
Place the nodes for this phase or sample index.
Source code in src/visualdynamics/viz/animate.py
reset
¶
Put every node back where it started.
EnvelopeAnimator
¶
EnvelopeAnimator(
plotter: Any,
geometry: Geometry,
deflection: Any,
sign: float = 1.0,
**kwargs: Any,
)
Bases: GeometryAnimator
One copy of a PSD envelope; a ± pair of these is the picture.
sign mirrors the pattern through the scale, so the window's one
Scale control still drives both copies through PairedAnimator.
The parameter is the abscissa line — the envelope has no phase to
sweep — and colour is absolute: dB below the loudest node at any
line, the one channel left to carry level once every line deflects
at full size.
Source code in src/visualdynamics/viz/animate.py
Functions:¶
animate_shape
¶
animate_shape(
geometry: Geometry,
shapes: ShapeSet,
mode: int = 0,
*,
unit_system: UnitSystem | None = None,
scale: float = 1.0,
colormap: bool = True,
cycle_seconds: float = 2.0,
theme: Any = None,
screenshot: str | None = None,
show: bool = True,
) -> Any
One mode shape moving on a geometry, as the GUI animates it.
Colored by displacement on viridis like the desktop scene. With
screenshot the deflected shape is rendered to a file at peak
phase instead — an animation has no still to save, so the still is
the one that shows the shape.
Source code in src/visualdynamics/viz/animate.py
animate_envelope
¶
animate_envelope(
geometry: Geometry,
data: Any,
records: Any = None,
*,
frequency: float | None = None,
quantity: str | None = None,
unit_system: UnitSystem | None = None,
scale: float = 1.0,
colormap: bool = True,
theme: Any = None,
screenshot: str | None = None,
show: bool = True,
) -> Any
A PSD's envelope on a geometry, as the GUI shows it: two copies deflected ±sqrt(PSD) at one line, coloured dB below the loudest.
One quantity at a time — newtons and metres per second squared cannot share a normalization — defaulting to the commonest among the records. Cross records are left out: their phase belongs to an operating deflection shape, not an envelope.
Source code in src/visualdynamics/viz/animate.py
266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 | |
animate_ods
¶
animate_ods(
geometry: Geometry,
data: Any,
records: Any = None,
*,
frequency: float | None = None,
unit_system: UnitSystem | None = None,
scale: float = 1.0,
colormap: bool = True,
cycle_seconds: float = 2.0,
theme: Any = None,
screenshot: str | None = None,
show: bool = True,
) -> Any
The operating deflection shape of complex spectra at one line, as the GUI animates it when the object is selected with a geometry.
The pattern is the records' complex values at the chosen frequency
— the strongest line when none is named — swept in phase like a
complex mode. Record choice follows animation_records: one record
per DOF, first reference of a whole FRF.