pyglut polyhedrons

pyglut – python opengl utilities

platform:Linux, Windows
synopsis:pyopengl programming helper classes and functions set.

Plato polyhedrons

Tetrahedron

class pyglut.Tetrahedron(side_length, display_mode="lined", lines_color=False, faces_color=False, lines_width=1, display_ls=False)

Generate an tetrahedron object with the given side length settings.

Parameters:
  • side_length – The side length of the tetrahedron sides.
  • display_mode

    How to display the tetrahedron.

    • “lined” -> Only the lines will be displayed.
    • “faced” -> Only the faces will be displayed.
    • “twice” -> The lines and the faces will be displayed.
  • lines_color – An objet from type Color representing the lines color.
  • faces_color

    The faces color(s).

    • An objet from type Color representing the faces color.
    • An 4-items-list from objects from type Color. One item per tetrahedron face.
  • lines_width – An integer representing the lines width.
  • display_ls – Define if the localview should be display.
Tetrahedron.update_pos(matrix)

Method to apply changing contains in the matrix argument on the tetrahedron object.

Parameters:matrix – An object from type Matrix configurate to contains the wanted changings.
Tetrahedron.display()

Tetrahedron displaying method towards the settings.

Tetrahedron.set_display_mode(display_mode)

Change the polyhedron display mode.

Parameters:display_mode

can take as value:

  • “lined” -> Only the lines will be displayed.
  • “faced” -> Only the faces will be displayed.
  • “twice” -> The lines and the faces will be displayed.
Tetrahedron.set_lines_color(lines_color)

Change the lines color from the polyhedron.

Parameters:lines_color – An objet from type Color representing the lines color.
Tetrahedron.set_faces_color(faces_color)

Change the faces color(s) from the polyhedron.

Parameters:faces_color
  • An objet from type Color representing the faces color.
  • An 4-items-list from objects from type Color. One item per tetrahedron face.
Tetrahedron.set_lines_width(lines_width)

Change the lines width from the polyhedron.

Parameters:lines_width – An integer representing the lines width.
Tetrahedron.set_display_ls(display_ls) :

Change the Localview displaying setting.

Parameters:display_ls – Define if the localview should be display.
Tetrahedron.set_side_length(side_length)

Change the sides length from tetrahedron.

Parameters:side_length – An float representing the tetrahedron sides length.

Note

documentation

The Tetrahedron object has an private documentation display method: Tetrahedron.__doc__()

Tetrahedron.side_length

The tetrahedron sides length.

Tetrahedron.lines_color

The tetrahedron lines color.

Tetrahedron.faces_color

The tetrahedron faces color(s).

Tetrahedron.polyhedron

The tetrahedron polygons.

Tetrahedron.ls

The tetrahedron’s localview.

Tetrahedron.center

The center of the polyhedron as an object from type Vertex.

Tetrahedron.display_ls

Tetrahedron localview displaying boolean value.

Cube

class pyglut.Cube(side_length, display_mode="lined", lines_color=False, faces_color=False, lines_width=1, display_ls=False)

Generate an cube object with the given side length settings.

Parameters:
  • side_length – The side length of the cube sides.
  • display_mode

    How to display the cube.

    • “lined” -> Only the lines will be displayed.
    • “faced” -> Only the faces will be displayed.
    • “twice” -> The lines and the faces will be displayed.
  • lines_color – An objet from type Color representing the lines color.
  • faces_color

    The faces color(s).

    • An objet from type Color representing the faces color.
    • An 6-items-list from objects from type Color. One item per cube face.
  • lines_width – An integer representing the lines width.
  • display_ls – Define if the localview should be display.
Cube.update_pos(matrix)

Method to apply changing contains in the matrix argument on the cube object.

Parameters:matrix – An object from type Matrix configurate to contains the wanted changings.
Cube.display()

Cube displaying method towards the settings.

Cube.set_display_mode(display_mode)

Change the polyhedron display mode.

Parameters:display_mode

can take as value:

  • “lined” -> Only the lines will be displayed.
  • “faced” -> Only the faces will be displayed.
  • “twice” -> The lines and the faces will be displayed.
Cube.set_lines_color(lines_color)

Change the lines color from the polyhedron.

Parameters:lines_color – An objet from type Color representing the lines color.
Cube.set_faces_color(faces_color)

Change the faces color(s) from the polyhedron.

Parameters:faces_color
  • An objet from type Color representing the faces color.
  • An 6-items-list from objects from type Color. One item per cube face.
Cube.set_lines_width(lines_width)

Change the lines width from the polyhedron.

Parameters:lines_width – An integer representing the lines width.
Cube.set_display_ls(display_ls) :

Change the Localview displaying setting.

Parameters:display_ls – Define if the localview should be display.
Cube.set_side_length(side_length)

Change the sides length from cube.

Parameters:side_length – An float representing the cube sides length.

Note

documentation

The Cube object has an private documentation display method: Cube.__doc__()

Cube.side_length

The cube sides length.

Cube.lines_color

The cube lines color.

Cube.faces_color

The cube faces color(s).

Cube.polyhedron

The cube polygons.

Cube.ls

The cube’s localview.

Cube.center

The center of the polyhedron as an object from type Vertex.

Cube.display_ls

Cube localview displaying boolean value.

Octahedron

class pyglut.Octahedron(side_length, display_mode="lined", lines_color=False, faces_color=False, lines_width=1, display_ls=False)

Generate an octahedron object with the given side length settings.

Parameters:
  • side_length – The side length of the octahedron sides.
  • display_mode

    How to display the octahedron.

    • “lined” -> Only the lines will be displayed.
    • “faced” -> Only the faces will be displayed.
    • “twice” -> The lines and the faces will be displayed.
  • lines_color – An objet from type Color representing the lines color.
  • faces_color

    The faces color(s).

    • An objet from type Color representing the faces color.
    • An 8-items-list from objects from type Color. One item per octahedron face.
  • lines_width – An integer representing the lines width.
  • display_ls – Define if the localview should be display.
Octahedron.update_pos(matrix)

Method to apply changing contains in the matrix argument on the octahedron object.

Parameters:matrix – An object from type Matrix configurate to contains the wanted changings.
Octahedron.display()

Octahedron displaying method towards the settings.

Octahedron.set_display_mode(display_mode)

Change the polyhedron display mode.

Parameters:display_mode

can take as value:

  • “lined” -> Only the lines will be displayed.
  • “faced” -> Only the faces will be displayed.
  • “twice” -> The lines and the faces will be displayed.
Octahedron.set_lines_color(lines_color)

Change the lines color from the polyhedron.

Parameters:lines_color – An objet from type Color representing the lines color.
Octahedron.set_faces_color(faces_color)

Change the faces color(s) from the polyhedron.

Parameters:faces_color
  • An objet from type Color representing the faces color.
  • An 8-items-list from objects from type Color. One item per octahedron face.
Octahedron.set_lines_width(lines_width)

Change the lines width from the polyhedron.

Parameters:lines_width – An integer representing the lines width.
Octahedron.set_display_ls(display_ls) :

Change the Localview displaying setting.

Parameters:display_ls – Define if the localview should be display.
Octahedron.set_side_length(side_length)

Change the sides length from octahedron.

Parameters:side_length – An float representing the octahedron sides length.

Note

documentation

The Octahedron object has an private documentation display method: Octahedron.__doc__()

Octahedron.side_length

The octahedron sides length.

Octahedron.lines_color

The octahedron lines color.

Octahedron.faces_color

The octahedron faces color(s).

Octahedron.polyhedron

The octahedron polygons.

Octahedron.ls

The octahedron’s localview.

Octahedron.center

The center of the polyhedron as an object from type Vertex.

Octahedron.display_ls

Octahedron localview displaying boolean value.

Dodecahedron

class pyglut.Dodecahedron(side_length, display_mode="lined", lines_color=False, faces_color=False, lines_width=1, display_ls=False)

Generate an dodecahedron object with the given side length settings.

Parameters:
  • side_length – The side length of the dodecahedron sides.
  • display_mode

    How to display the dodecahedron.

    • “lined” -> Only the lines will be displayed.
    • “faced” -> Only the faces will be displayed.
    • “twice” -> The lines and the faces will be displayed.
  • lines_color – An objet from type Color representing the lines color.
  • faces_color

    The faces color(s).

    • An objet from type Color representing the faces color.
    • An 12-items-list from objects from type Color. One item per dodecahedron face.
  • lines_width – An integer representing the lines width.
  • display_ls – Define if the localview should be display.
Dodecahedron.update_pos(matrix)

Method to apply changing contains in the matrix argument on the dodecahedron object.

Parameters:matrix – An object from type Matrix configurate to contains the wanted changings.
Dodecahedron.display()

Dodecahedron displaying method towards the settings.

Dodecahedron.set_display_mode(display_mode)

Change the polyhedron display mode.

Parameters:display_mode

can take as value:

  • “lined” -> Only the lines will be displayed.
  • “faced” -> Only the faces will be displayed.
  • “twice” -> The lines and the faces will be displayed.
Dodecahedron.set_lines_color(lines_color)

Change the lines color from the polyhedron.

Parameters:lines_color – An objet from type Color representing the lines color.
Dodecahedron.set_faces_color(faces_color)

Change the faces color(s) from the polyhedron.

Parameters:faces_color
  • An objet from type Color representing the faces color.
  • An 12-items-list from objects from type Color. One item per dodecahedron face.
Dodecahedron.set_lines_width(lines_width)

Change the lines width from the polyhedron.

Parameters:lines_width – An integer representing the lines width.
Dodecahedron.set_display_ls(display_ls) :

Change the Localview displaying setting.

Parameters:display_ls – Define if the localview should be display.
Dodecahedron.set_side_length(side_length)

Change the sides length from dodecahedron.

Parameters:side_length – An float representing the dodecahedron sides length.

Note

documentation

The Dodecahedron object has an private documentation display method: Dodecahedron.__doc__()

Dodecahedron.side_length

The dodecahedron sides length.

Dodecahedron.lines_color

The dodecahedron lines color.

Dodecahedron.faces_color

The dodecahedron faces color(s).

Dodecahedron.polyhedron

The dodecahedron polygons.

Dodecahedron.ls

The dodecahedron’s localview.

Dodecahedron.center

The center of the polyhedron as an object from type Vertex.

Dodecahedron.display_ls

Dodecahedron localview displaying boolean value.

Icosahedron

class pyglut.Icosahedron(side_length, display_mode="lined", lines_color=False, faces_color=False, lines_width=1, display_ls=False)

Generate an icosahedron object with the given side length settings.

Parameters:
  • side_length – The side length of the icosahedron sides.
  • display_mode

    How to display the icosahedron.

    • “lined” -> Only the lines will be displayed.
    • “faced” -> Only the faces will be displayed.
    • “twice” -> The lines and the faces will be displayed.
  • lines_color – An objet from type Color representing the lines color.
  • faces_color

    The faces color(s).

    • An objet from type Color representing the faces color.
    • An 20-items-list from objects from type Color. One item per icosahedron face.
  • lines_width – An integer representing the lines width.
  • display_ls – Define if the localview should be display.
Icosahedron.update_pos(matrix)

Method to apply changing contains in the matrix argument on the icosahedron object.

Parameters:matrix – An object from type Matrix configurate to contains the wanted changings.
Icosahedron.display()

Icosahedron displaying method towards the settings.

Icosahedron.set_display_mode(display_mode)

Change the polyhedron display mode.

Parameters:display_mode

can take as value:

  • “lined” -> Only the lines will be displayed.
  • “faced” -> Only the faces will be displayed.
  • “twice” -> The lines and the faces will be displayed.
Icosahedron.set_lines_color(lines_color)

Change the lines color from the polyhedron.

Parameters:lines_color – An objet from type Color representing the lines color.
Icosahedron.set_faces_color(faces_color)

Change the faces color(s) from the polyhedron.

Parameters:faces_color
  • An objet from type Color representing the faces color.
  • An 20-items-list from objects from type Color. One item per icosahedron face.
Icosahedron.set_lines_width(lines_width)

Change the lines width from the polyhedron.

Parameters:lines_width – An integer representing the lines width.
Icosahedron.set_display_ls(display_ls) :

Change the Localview displaying setting.

Parameters:display_ls – Define if the localview should be display.
Icosahedron.set_side_length(side_length)

Change the sides length from icosahedron.

Parameters:side_length – An float representing the icosahedron sides length.

Note

documentation

The Icosahedron object has an private documentation display method: Icosahedron.__doc__()

Icosahedron.side_length

The icosahedron sides length.

Icosahedron.lines_color

The icosahedron lines color.

Icosahedron.faces_color

The icosahedron faces color(s).

Icosahedron.polyhedron

The icosahedron polygons.

Icosahedron.ls

The icosahedron’s localview.

Icosahedron.center

The center of the polyhedron as an object from type Vertex.

Icosahedron.display_ls

Icosahedron localview displaying boolean value.

Other polyhedrons

Polyhedron with 26 faces

class pyglut.Poly26Hedron(side_length, display_mode="lined", lines_color=False, quads_color=False, triangles_color=False, lines_width=1, display_ls=False)

Generate an polyhedron with 26 faces, 18 quads and 8 triangles, object with the given side length settings.

Parameters:
  • side_length – The side length of the polyhedron with 26 faces sides.
  • display_mode

    How to display the polyhedron with 26 faces.

    • “lined” -> Only the lines will be displayed.
    • “faced” -> Only the faces will be displayed.
    • “twice” -> The lines and the faces will be displayed.
  • lines_color – An objet from type Color representing the lines color.
  • quads_color

    The quads color(s).

    • An objet from type Color representing the faces color.
    • An 18-items-list from objects from type Color. One item per polyhedron quads face.
  • triangles_color

    The triangles color(s).

    • An objet from type Color representing the faces color.
    • An 8-items-list from objects from type Color. One item per polyhedron triangle face.
  • lines_width – An integer representing the lines width.
  • display_ls – Define if the localview should be display.
Poly26Hedron.update_pos(matrix)

Method to apply changing contains in the matrix argument on the polyhedron with 26 faces object.

Parameters:matrix – An object from type Matrix configurate to contains the wanted changings.
Poly26Hedron.display()

polyhedron with 26 faces displaying method towards the settings.

Poly26Hedron.set_display_mode(display_mode)

Change the polyhedron display mode.

Parameters:display_mode

can take as value:

  • “lined” -> Only the lines will be displayed.
  • “faced” -> Only the faces will be displayed.
  • “twice” -> The lines and the faces will be displayed.
Poly26Hedron.set_lines_color(lines_color)

Change the lines color from the polyhedron.

Parameters:lines_color – An objet from type Color representing the lines color.
Poly26Hedron.set_quads_color(quads_color)

Change the quads faces color(s) from the polyhedron.

Parameters:quads_color
  • An objet from type Color representing the faces color.
  • An 18-items-list from objects from type Color. One item per polyhedron quads face.
Poly26Hedron.set_triangles_color(triangles_color)

Change the triangles faces color(s) from the polyhedron.

Parameters:triangles_color
  • An objet from type Color representing the faces color.
  • An 8-items-list from objects from type Color. One item per polyhedron triangle face.
Poly26Hedron.set_lines_width(lines_width)

Change the lines width from the polyhedron.

Parameters:lines_width – An integer representing the lines width.
Poly26Hedron.set_display_ls(display_ls) :

Change the Localview displaying setting.

Parameters:display_ls – Define if the localview should be display.
Poly26Hedron.set_side_length(side_length)

Change the sides length from polyhedron with 26 faces.

Parameters:side_length – An float representing the polyhedron with 26 faces sides length.

Note

documentation

The Poly26Hedron object has an private documentation display method: Poly26Hedron.__doc__()

Poly26Hedron.side_length

The 26 faces polyhedron sides length.

Poly26Hedron.lines_color

The polyhedron lines color.

Poly26Hedron.triangles_color

The polyhedron triangles color(s).

Poly26Hedron.quads_color

The polyhedron quads color(s).

Poly26Hedron.quads

The polyhedron quads container.

Poly26Hedron.triangles

The polyhedron triangles container.

Poly26Hedron.ls

The 26 faces polyhedron ‘s localview.

Poly26Hedron.center

The center of the polyhedron as an object from type Vertex.

Poly26Hedron.display_ls

The 26 faces polyhedron localview displaying boolean value.

Polyhedron with 32 faces

class pyglut.Poly32Hedron(side_length, display_mode="lined", lines_color=False, pentagons_color=False, triangles_color=False, lines_width=1, display_ls=False)

Generate an polyhedron with 32 faces, 20 triangles and 12 pentagons, object with the given side length settings.

Parameters:
  • side_length – The side length of the polyhedron with 32 faces sides.
  • display_mode

    How to display the polyhedron with 32 faces.

    • “lined” -> Only the lines will be displayed.
    • “faced” -> Only the faces will be displayed.
    • “twice” -> The lines and the faces will be displayed.
  • lines_color – An objet from type Color representing the lines color.
  • triangles_color

    The triangles color(s).

    • An objet from type Color representing the faces color.
    • An 20-items-list from objects from type Color. One item per polyhedron triangles face.
  • pentagons_color

    The pentagons color(s).

    • An objet from type Color representing the faces color.
    • An 12-items-list from objects from type Color. One item per polyhedron triangle face.
  • lines_width – An integer representing the lines width.
  • display_ls – Define if the localview should be display.
Poly32Hedron.update_pos(matrix)

Method to apply changing contains in the matrix argument on the polyhedron with 32 faces object.

Parameters:matrix – An object from type Matrix configurate to contains the wanted changings.
Poly32Hedron.display()

polyhedron with 32 faces displaying method towards the settings.

Poly32Hedron.set_display_mode(display_mode)

Change the polyhedron display mode.

Parameters:display_mode

can take as value:

  • “lined” -> Only the lines will be displayed.
  • “faced” -> Only the faces will be displayed.
  • “twice” -> The lines and the faces will be displayed.
Poly32Hedron.set_lines_color(lines_color)

Change the lines color from the polyhedron.

Parameters:lines_color – An objet from type Color representing the lines color.
Poly32Hedron.set_triangles_color(triangles_color)

Change the triangles faces color(s) from the polyhedron.

Parameters:triangles_color
  • An objet from type Color representing the faces color.
  • An 20-items-list from objects from type Color. One item per polyhedron triangle face.
Poly32Hedron.set_pentagons_color(pentagons_color)

Change the pentagons faces color(s) from the polyhedron.

Parameters:pentagons_color
  • An objet from type Color representing the faces color.
  • An 12-items-list from objects from type Color. One item per polyhedron pentagon face.
Poly32Hedron.set_lines_width(lines_width)

Change the lines width from the polyhedron.

Parameters:lines_width – An integer representing the lines width.
Poly32Hedron.set_display_ls(display_ls) :

Change the Localview displaying setting.

Parameters:display_ls – Define if the localview should be display.
Poly32Hedron.set_side_length(side_length)

Change the sides length from polyhedron with 32 faces.

Parameters:side_length – An float representing the polyhedron with 32 faces sides length.

Note

documentation

The Poly32Hedron object has an private documentation display method: Poly32Hedron.__doc__()

Poly32Hedron.side_length

The 32 faces polyhedron sides length.

Poly32Hedron.lines_color

The polyhedron lines color.

Poly26Hedron.triangles_color

The polyhedron triangles color(s).

Poly26Hedron.pentagons_color

The polyhedron pentagons color(s).

Poly32Hedron.triangles

The polyhedron triangles container.

Poly32Hedron.pentagons

The polyhedron pentagons container.

Poly32Hedron.ls

The 32 faces polyhedron ‘s localview.

Poly32Hedron.center

The center of the polyhedron as an object from type Vertex.

Poly32Hedron.display_ls

The 32 faces polyhedron localview displaying boolean value.

Fulleren and toros

Fulleren

class pyglut.Fulleren(side_length, display_mode="lined", lines_color=False, pentagons_color=False, hexagons_color=False, lines_width=1, display_ls=False)

Generate an fulleren, 20 hexagons and 12 pentagons, object with the given side length settings.

Parameters:
  • side_length – The side length of the fullerens sides.
  • display_mode

    How to display the fulleren.

    • “lined” -> Only the lines will be displayed.
    • “faced” -> Only the faces will be displayed.
    • “twice” -> The lines and the faces will be displayed.
  • lines_color – An objet from type Color representing the lines color.
  • pentagons_color

    The pentagons color(s).

    • An objet from type Color representing the faces color.
    • An 12-items-list from objects from type Color. One item per polyhedron pentagon face.
  • hexagons_color

    The hexagons color(s).

    • An objet from type Color representing the faces color.
    • An 20-items-list from objects from type Color. One item per polyhedron hexagon face.
  • lines_width – An integer representing the lines width.
  • display_ls – Define if the localview should be display.
Fulleren.update_pos(matrix)

Method to apply changing contains in the matrix argument on the fulleren object.

Parameters:matrix – An object from type Matrix configurate to contains the wanted changings.
Fulleren.display()

fulleren displaying method towards the settings.

Fulleren.set_display_mode(display_mode)

Change the polyhedron display mode.

Parameters:display_mode

can take as value:

  • “lined” -> Only the lines will be displayed.
  • “faced” -> Only the faces will be displayed.
  • “twice” -> The lines and the faces will be displayed.
Fulleren.set_lines_color(lines_color)

Change the lines color from the polyhedron.

Parameters:lines_color – An objet from type Color representing the lines color.
Fulleren.set_hexagons_color(hexagons_color)

Change the hexagons faces color(s) from the polyhedron.

Parameters:hexagons_color
  • An objet from type Color representing the faces color.
  • An 20-items-list from objects from type Color. One item per polyhedron hexagons face.
Fulleren.set_pentagons_color(pentagons_color)

Change the pentagons faces color(s) from the polyhedron.

Parameters:pentagons_color
  • An objet from type Color representing the faces color.
  • An 12-items-list from objects from type Color. One item per polyhedron pentagon face.
Fulleren.set_lines_width(lines_width)

Change the lines width from the polyhedron.

Parameters:lines_width – An integer representing the lines width.
Fulleren.set_display_ls(display_ls) :

Change the Localview displaying setting.

Parameters:display_ls – Define if the localview should be display.
Fulleren.set_side_length(side_length)

Change the sides length from fulleren.

Parameters:side_length – An float representing the fulleren sides length.

Note

documentation

The Fulleren object has an private documentation display method: Fulleren.__doc__()

Fulleren.side_length

The fulleren sides length.

Fulleren.lines_color

The fulleren lines color.

Fulleren.faces_color

The fulleren faces color(s).

Fulleren.hexagons

The fulleren hexagons container.

Fulleren.pentagons

The fulleren pentagons container.

Fulleren.ls

The fulleren’s localview.

Fulleren.center

The center of the polyhedron as an object from type Vertex.

Fulleren.display_ls

Fulleren localview displaying boolean value.

Toros

class pyglut.Toros(base_polygon, base_radius, toros_radius, display_mode="lined", lines_color=False, faces_color=False, lines_width=1, display_ls=False)

Generate an toros object with the given radius and basis polygone settings.

Parameters:
  • base – The base polygon edges number, for the toros generation.
  • base_radius – The base polygon radius, for the toros generation.
  • toros_radius – The toros radius (without the base polygon radius).
  • display_mode

    How to display the toros.

    • “lined” -> Only the lines will be displayed.
    • “faced” -> Only the faces will be displayed.
    • “twice” -> The lines and the faces will be displayed.
  • lines_color – An objet from type Color representing the lines color.
  • faces_color – The faces color(s). An objet from type Color representing the faces color.
  • lines_width – An integer representing the lines width.
  • display_ls – Define if the localview should be display.
Toros.update_pos(matrix)

Method to apply changing contains in the matrix argument on the toros object.

Parameters:matrix – An object from type Matrix configurate to contains the wanted changings.
Toros.display()

Toros displaying method towards the settings.

Toros.set_display_mode(display_mode)

Change the polyhedron display mode.

Parameters:display_mode

can take as value:

  • “lined” -> Only the lines will be displayed.
  • “faced” -> Only the faces will be displayed.
  • “twice” -> The lines and the faces will be displayed.
Toros.set_lines_color(lines_color)

Change the lines color from the polyhedron.

Parameters:lines_color – An objet from type Color representing the lines color.
Toros.set_faces_color(faces_color)

Change the faces color(s) from the polyhedron.

Parameters:faces_color – An objet from type Color representing the faces color.
Toros.set_lines_width(lines_width)

Change the lines width from the polyhedron.

Parameters:lines_width – An integer representing the lines width.
Toros.set_display_ls(display_ls) :

Change the Localview displaying setting.

Parameters:display_ls – Define if the localview should be display.
Toros.set_base_polygon(base_polygon)

Change the toros basis polygon.

Parameters:base_polygon – The base polygon edges number, for the toros generation.
Toros.set_base_radius(base_radius)

Change the toros base polygon radius.

Parameters:base_radius – The base polygon radius, for the toros generation.
Toros.set_toros_radius(toros_radius)

Change the toros radius (without the base polygon radius).

Parameters:toros_radius – The toros radius (without the base polygon radius).

Note

documentation

The Toros object has an private documentation display method: Toros.__doc__()

Toros.base_polygon

The base polygon edges number, for the toros generation.

Toros.base_radius

The base polygon radius, for the toros generation.

Tors.toros_radius

The toros radius (without the base polygon radius).

Toros.lines_color

The toros lines color.

Toros.faces_color

The toros faces color(s).

Toros.toros

The toros polygons container.

Toros.ls

The toros’s localview.

Toros.center

The center of the polyhedron as an object from type Vertex.

Toros.display_ls

Toros localview displaying boolean value.

Spheres

Quad_Sphere

class pyglut.Quad_Sphere(radius, basis, display_mode="lined", lines_color=False, faces_color=False, lines_width=1, display_ls=False)

Generate an quad sphere object with the given radius and polygone basis.

Parameters:
  • radius – The radius of the sphere to generate.
  • basis

    The basis polygon for the sphere generation.

    The basis must be: basis % 2 == 0.

  • display_mode

    How to display the sphere.

    • “lined” -> Only the lines will be displayed.
    • “faced” -> Only the faces will be displayed.
    • “twice” -> The lines and the faces will be displayed.
  • lines_color – An objet from type Color representing the lines color.
  • faces_color – An objet from type Color representing the faces color.
  • lines_width – An integer representing the lines width.
  • display_ls – Define if the localview should be display.
Quad_Sphere.update_pos(matrix)

Method to apply changing contains in the matrix argument on the sphere object.

Parameters:matrix – An object from type Matrix configurate to contains the wanted changings.
Quad_Sphere.display()

Quad_Sphere displaying method towards the settings.

Quad_Sphere.set_display_mode(display_mode)

Change the sphere display mode.

Parameters:display_mode

can take as value:

  • “lined” -> Only the lines will be displayed.
  • “faced” -> Only the faces will be displayed.
  • “twice” -> The lines and the faces will be displayed.
Quad_Sphere.set_lines_color(lines_color)

Change the lines color from the sphere.

Parameters:lines_color – An objet from type Color representing the lines color.
Quad_Sphere.set_faces_color(faces_color)

Change the faces color(s) from the sphere.

Parameters:faces_color – An objet from type Color representing the faces color.
Quad_Sphere.set_lines_width(lines_width)

Change the lines width from the sphere.

Parameters:lines_width – An integer representing the lines width.
Quad_Sphere.set_display_ls(display_ls) :

Change the Localview displaying setting.

Parameters:display_ls – Define if the localview should be display.
Quad_Sphere.set_basis(basis)

Change sphere basis polygon.

Parameters:basis – An integer representing the sphere base polygon edges number.
Quad_Sphere.set_radius(radius)

Change sphere radius.

Parameters:radius – An float representing the sphere radius.

Note

documentation

The Quad_Sphere object has an private documentation display method: Quad_Sphere.__doc__()

Quad_Sphere.radius

The sphere radius.

Quad_Sphere.basis

The sphere basis polygon.

Quad_Sphere.lines_color

The sphere lines color.

Quad_Sphere.faces_color

The sphere faces color.

Quad_Sphere.polygons

The sphere polygons.

Quad_Sphere.ls

The sphere’s localview.

Quad_Sphere.center

The center of the sphere as an object from type Vertex.

Quad_Sphere.display_ls

Quad_Sphere localview displaying boolean value.

Trigon_Sphere

class pyglut.Trigon_Sphere(radius, basis, display_mode="lined", lines_color=False, faces_color=False, lines_width=1, display_ls=False)

Generate an quad sphere object with the given radius and polygone basis.

Parameters:
  • radius – The radius of the sphere to generate.
  • basis

    The basis polygon for the sphere generation.

    The basis must be: basis % 4 == 0.

  • display_mode

    How to display the sphere.

    • “lined” -> Only the lines will be displayed.
    • “faced” -> Only the faces will be displayed.
    • “twice” -> The lines and the faces will be displayed.
  • lines_color – An objet from type Color representing the lines color.
  • faces_color – An objet from type Color representing the faces color.
  • lines_width – An integer representing the lines width.
  • display_ls – Define if the localview should be display.
Trigon_Sphere.update_pos(matrix)

Method to apply changing contains in the matrix argument on the sphere object.

Parameters:matrix – An object from type Matrix configurate to contains the wanted changings.
Trigon_Sphere.display()

Trigon_Sphere displaying method towards the settings.

Trigon_Sphere.set_display_mode(display_mode)

Change the sphere display mode.

Parameters:display_mode

can take as value:

  • “lined” -> Only the lines will be displayed.
  • “faced” -> Only the faces will be displayed.
  • “twice” -> The lines and the faces will be displayed.
Trigon_Sphere.set_lines_color(lines_color)

Change the lines color from the sphere.

Parameters:lines_color – An objet from type Color representing the lines color.
Trigon_Sphere.set_faces_color(faces_color)

Change the faces color(s) from the sphere.

Parameters:faces_color – An objet from type Color representing the faces color.
Trigon_Sphere.set_lines_width(lines_width)

Change the lines width from the sphere.

Parameters:lines_width – An integer representing the lines width.
Trigon_Sphere.set_display_ls(display_ls) :

Change the Localview displaying setting.

Parameters:display_ls – Define if the localview should be display.
Trigon_Sphere.set_basis(basis)

Change sphere basis polygon.

Parameters:basis

An integer representing the sphere base polygon edges number.

The basis must be: basis % 4 == 0.

Trigon_Sphere.set_radius(radius)

Change sphere radius.

Parameters:radius – An float representing the sphere radius.

Note

documentation

The Trigon_Sphere object has an private documentation display method: Trigon_Sphere.__doc__()

Trigon_Sphere.radius

The sphere radius.

Trigon_Sphere.basis

The sphere basis polygon.

Trigon_Sphere.lines_color

The sphere lines color.

Trigon_Sphere.faces_color

The sphere faces color.

Trigon_Sphere.trigons

The sphere trigons.

Trigon_Sphere.ls

The sphere’s localview.

Trigon_Sphere.center

The center of the sphere as an object from type Vertex.

Trigon_Sphere.display_ls

Trigon_Sphere localview displaying boolean value.