vispy.visuals.filters.clipping_planes module#

class vispy.visuals.filters.clipping_planes.PlanesClipper(clipping_planes: ndarray | None = None, coord_system: str = 'scene')#

Bases: Filter

Clips visual output based on arbitrary clipping planes.

Parameters:
cliping_planesArrayLike

Each plane is defined by a position and a normal vector (magnitude is irrelevant). Shape: (n_planes, 2, 3)

coord_systemstr

Coordinate system used by the clipping planes (see visuals.transforms.transform_system.py)

FRAG_CODE = '\n    void clip() {\n        float distance_from_clip = $clip_with_planes($itransform($v_position).xyz);\n        if (distance_from_clip < 0.)\n            discard;\n    }\n    '#
VERT_CODE = '\n    void clip() {\n        // pass position as varying for interpolation\n        $v_position = gl_Position;\n    }\n    '#
property clipping_planes: ndarray#

Get the set of planes used to clip the mesh. Each plane is defined by a position and a normal vector (magnitude is irrelevant). Shape: (n_planes, 2, 3)

property coord_system: str#

Coordinate system used by the clipping planes (see visuals.transforms.transform_system.py)