vispy.visuals.filters.clipping_planes module

class vispy.visuals.filters.clipping_planes.PlanesClipper(clipping_planes=None, coord_system='scene')

Bases: vispy.visuals.filters.base_filter.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        if ($v_distance_from_clip < 0.)\n            discard;\n    }\n    '
VERT_CODE = '\n    void clip() {\n        // Transform back to visual coordinates and clip based on that\n        $v_distance_from_clip = $clip_with_planes($itransform(gl_Position).xyz);\n    }\n    '
property clipping_planes

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

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