pygfx.helpers.GridHelper

class pygfx.helpers.GridHelper(size=10.0, divisions=10, color1=(0.35, 0.35, 0.35, 1), color2=(0.1, 0.1, 0.1, 1), thickness=1)

Bases: Line

A WorldObject that shows a grid-shaped wireframe.

The generated grid will be in the xz-plane centered at the origin. To position the grid, manipulate its parent’s position, rotation, etc.

Parameters:
  • size (float) – The size of the wireframe in the direction of the x-, and y-axis.

  • divisions (int) – The number of (evenly spaced) divisions to perform along each axis.

  • color1 (int, float, str, tuple) – The color of the center lines. This is a either a single int or float (gray), a 4-tuple (r,g,b,a) of ints or floats, or a hex-coded color string in one of the following formats: #RGB, #RGBA, #RRGGBB, #RRGGBBAA.

  • color2 (int, float, str, tuple) – The color of non-center lines. This is a either a single int or float (gray), a 4-tuple (r,g,b,a) of ints or floats, or a hex-coded color string in one of the following formats: #RGB, #RGBA, #RRGGBB, #RRGGBBAA.

  • thickness (int) – The thickness in screen units (pixels).

Examples

Gizmo to transform world objects

Gizmo to transform world objects

Axis Helper 2

Axis Helper 2