Changes in version 0.5.2¶
New Features¶
-
ControlEventdataclass — extensible metadata passed to all control handlers. Currently carriesbrowser_id; additional fields can be added without breaking existing handler signatures. Import frompytanga.viz. -
get_label_ids(entity_id) → list[str]— new method onScene,Visualizer, andVizSceneHandleto look up label IDs attached to an entity. Replaces the removed(entity_id, label_id)tuple return fromadd(). -
flush(fit_camera=True)— explicit camera auto-fit. Callviz.flush(fit_camera=True)after all entities are added to have the frontend adjust the camera to encompass them. Disabled by default; the camera no longer auto-fits on first entity arrival.
Bug Fixes¶
-
Unified browser connection detection across
start(),run(), andVisualizerApp.run(). All three now wait for the frontend"ready"WebSocket round-trip, proving both HTTP page load and WebSocket connectivity before proceeding. -
Fixed browser timeout when GPU crashes during WebGL initialization.
initScene()is now fault-tolerant: if the WebGL renderer fails, the WebSocket still connects and sends the"ready"message. -
Fixed orbit target drifting away from world origin when entities arrived via WebSocket. The camera orbit point now stays at
(0,0,0)regardless of entity placement. -
Fixed sphere flickering in animations caused by floating-point epsilon changes in
radius/extenttriggering full mesh rebuilds every frame. Both live streaming (inPlaceUpdate) and animated HTML exports (applyFrameUpdate) now use tolerance-based comparison (ε = 10⁻⁹). -
Added missing
reflection_point.jsrenderer for theReflectionPointoperator. Removed stale reference to the non-existentreflection_origin.jsfrom the export bootstrap renderer list. -
add()return type isstr(neverlist[str]). The(entity_id, label_id)tuple is no longer returned. Useget_label_ids(entity_id)instead. -
Fixed missing comma in
demo_title_annotation.pyand redundantimport mathintwo_body_gravity.py.
Doc Changes¶
- Updated
add()return type and documentedget_label_ids()invisualizer.md. - Updated all control handler signatures in
interactive.mdto use the new(value, event: ControlEvent)signature. - Documented
flush(fit_camera=False)invisualizer.md. - Replaced bare style parameters (
size=0.15,wireframe=True) with style classes (PointStyle(size=0.15),SphereStyle(wireframe=True)) in all example scripts. - Replaced unicode subscripts with KaTeX math expression strings
(
$P_1$,$\pi$, etc.) in example labels.