pygfx.objects.Line

class pygfx.objects.Line(geometry=None, material=None, *, visible=True, render_order=0, render_mask='auto')

Bases: WorldObject

An object representing a line using a list of vertices (3D positions).

Some materials will render the line as a continuous line, while other materials will consider each pair of consequtive points a segment.

The picking info of a Line (the result of renderer.get_pick_info()) will for most materials include vertex_index (int) and segment_coord (float, sub-segment coordinate).

Parameters:
  • geometry (Geometry) – The data defining the shape of the object.

  • material (Material) – The data defining the appearence of the object.

  • visible (bool) – Whether the object is visible.

  • render_order (int) – The render order (when applicable for the renderer’s blend mode).

  • render_mask (str) – Determines the render passes that the object is rendered in. It’s recommended to let the renderer decide, using “auto”.

  • position (Vector) – The position of the object in the world. Default (0, 0, 0).

Examples

Boundary Boxes

Boundary Boxes

Lights

Lights

Orbit Camera

Orbit Camera

Line Drawing Performance

Line Drawing Performance

Line Segments

Line Segments

Gizmo to transform world objects

Gizmo to transform world objects

Thick Lines

Thick Lines

Point Picking

Point Picking

Use a Skybox

Use a Skybox

Panzoom Camera

Panzoom Camera

Line Drawing

Line Drawing

Scene Overlay

Scene Overlay

Directional Shadow 1

Directional Shadow 1

Subplots 1

Subplots 1

Mesh and Volume Slicing 2

Mesh and Volume Slicing 2

Volume and Mesh Slicing 1

Volume and Mesh Slicing 1

Directional Shadow 2

Directional Shadow 2

Multi-Object Selection

Multi-Object Selection

Spotlights

Spotlights

Spotlight Shadow

Spotlight Shadow

Axes Helper 1

Axes Helper 1

Axis Helper 2

Axis Helper 2

Text anchor

Text anchor

Text size

Text size

Integrate pygfx in Qt

Integrate pygfx in Qt

Two Canvases

Two Canvases

Peformance of drawing many Lines

Peformance of drawing many Lines