class_docstr: Clips visual output based on arbitrary clipping planes.
  
  Parameters
  ----------
  cliping_planes : ArrayLike
      Each plane is defined by a position and a normal vector (magnitude is irrelevant). Shape: (n_planes, 2, 3)
  coord_system : str
      Coordinate system used by the clipping planes (see visuals.transforms.transform_system.py)
docstr: Build the code snippet used to clip the volume based on self.clipping_planes.
docstr_tok: ["Build","the","code","snippet","used","to","clip","the","volume","based","on","self.clipping_planes","."]
code: def _build_clipping_planes_glsl(n_planes: int) -> str:
      """Build the code snippet used to clip the volume based on self.clipping_planes."""
      func_template = """
              float clip_planes(vec3 loc) {{
                  float distance_from_clip = 3.4e38; // max float
                  {clips};
                  return distance_from_clip;
              }}
          """
      # the vertex is considered clipped if on the "negative" side of the plane
      clip_template = """
              vec3 relative_vec{idx} = loc - $clipping_plane_pos{idx};
              float distance_from_clip{idx} = dot(relative_vec{idx}, $clipping_plane_norm{idx});
              distance_from_clip = min(distance_from_clip{idx}, distance_from_clip);
              """
      all_clips = []
      for idx in range(n_planes):
          all_clips.append(clip_template.format(idx=idx))
      formatted_code = func_template.format(clips="".join(all_clips))
      return formatted_code
  
file_path: vispy/vispy/visuals/filters/clipping_planes.py
imports: from __future__ import annotations
  from typing import Optional
  from functools import lru_cache
  import numpy
  from ..shaders import Function, Varying
  from .base_filter import Filter
label_desc: Use image node_id 4 for calling the PlanesClipper obj's underlying member method code with example usage: obj._build_clipping_planes_glsl(n_planes) and returns: formatted_code