Skip to main content

add_slice_plane_auto

Function add_slice_plane_auto 

Source
pub fn add_slice_plane_auto() -> SlicePlaneHandle
Expand description

Adds a slice plane with an auto-generated name like “Scene Slice Plane 0”.

Mirrors C++ Polyscope’s addSlicePlane() (no-args overload). Returns a handle to the newly created plane. The chosen index is the smallest non-negative integer N for which “Scene Slice Plane N” is not already in use, so removing a middle plane and re-adding will reclaim that index.

Search and creation happen under a single with_context_mut lock — without that, two concurrent callers could pick the same name and one would receive a handle to the other’s plane (since core’s add_slice_plane is an upsert).