documentation:polytope:visual_polytope

Available versions of this document: latest release, release 4.11, release 4.10, release 4.9, release 4.8, release 4.7, release 4.6, release 4.5, release 4.4, release 4.3, release 4.2, release 4.1, release 4.0, release 3.6, release 3.5, nightly master

Reference documentation for older polymake versions: release 3.4, release 3.3, release 3.2

BigObject Visual::Polytope

from application polytope

Visualization of a polytope as a graph (if 1d), or as a solid object (if 2d or 3d), or as a Schlegel diagram (4d).

DIRECTED_GRAPH(LinearProgram lp)

Illustrate the behavior of a linear objective function on the polytope. Superpose the drawing with the directed graph induced by the objective function.

Parameters:

LinearProgram lp: a Linear Program object attached to the polytope

Returns:
Example:

Attaches a linear program to the 3-dimensional cube and visualizes the directed graph, giving the cube a blue facet color

 > $p = cube(3);
 > $p->LP = new LinearProgram(LINEAR_OBJECTIVE=>[0,0,0,1]);
 > $p->VISUAL(FacetColor=>"blue")->DIRECTED_GRAPH;


LATTICE()

Visualize the LATTICE_POINTS of a polytope

Options:
Returns:
Example:

Visualizes the lattice points of the threedimensional cube.

 > cube(3)->VISUAL->LATTICE;


LATTICE_COLORED()

Visualize the LATTICE_POINTS of a polytope in different colors (interior / boundary / vertices)

Options:
Returns:
Example:

Creates the threedimensional unit cube scaled by 1.5 and displays the colored version of its lattice points

 > cube(3,(3/2),0)->VISUAL->LATTICE_COLORED;


MIN_MAX_FACE(LinearProgram lp)

Illustrate the behavior of a linear objective function on the polytope. Draw the facets contained in MAXIMAL_FACE and MINIMAL_FACE in distinct colors.

Parameters:

LinearProgram lp: a LinearProgram object attached to the polytope.

Options:

Color min: minimal face decoration (default: yellow vertices and/or facets)

Color max: maximal face decoration (default: red vertices and/or facets)

Returns:
Example:

Attaches a linear program to the threedimensional cube and displays the minimal/maximal faces in a different color, choosing purple instead of the default red for the maximal face

 > $p = cube(3);
 > $p->LP = new LinearProgram(LINEAR_OBJECTIVE=>[0,1,0,0]);
 > $p->VISUAL->MIN_MAX_FACE(max=>"purple");


STEINER()

Add the STEINER_POINTS to the 3-d visualization. The facets become transparent.

Options:
Returns:
Example:

Displays the Steiner points of a random threedimensional sphere with 20 vertices. The labels of the vertices are turned off.

 > rand_sphere(3,20)->VISUAL(VertexLabels=>"hidden")->STEINER;


TRIANGULATION(Array<Set<Int>> t)

Add the triangulation to the drawing. You may specify any triangulation of the current polytope. Per default, the TRIANGULATION property is taken. (Currently there is only one possible alternative triangulation: TRIANGULATION_INT). Hint: Use the method Method → Effect → Explode Group of Geometries of JavaView for better insight in the internal structure.

Parameters:

Array<Set<Int>> t: facets of the triangulation

Options:
Returns:
Example:

Displays a triangulation of the threedimensional cube. Facets are made transparent and vertices are hidden.

 > cube(3)->VISUAL->TRIANGULATION(FacetTransparency=>0.7,VertexStyle=>"hidden");


TRIANGULATION_BOUNDARY()

Draw the edges of the TRIANGULATION_BOUNDARY. The facets are made transparent.

Options:
Returns:
Example:

Displays the boundary triangulation of the threedimensional cube.

 > cube(3)->VISUAL->TRIANGULATION_BOUNDARY;
Example:

For a slightly different visualization of essentially the same:

 > cube(3)->TRIANGULATION->BOUNDARY->VISUAL;


VERTEX_COLORS(LinearProgram lp)

Illustrate the behavior of a linear objective function on the polytope. Color the vertices according to the values of the objective function.

Parameters:

LinearProgram lp: a LinearProgram object attached to the polytope

Options:

Color min: minimal vertex color (default: yellow)

Color max: maximal vertex color (default: red)

Returns:
Example:

Attaches a linear program to the threedimensional cube and displays the minimal/maximal vertices in a different color, choosing purple instead of the default red for the maximal vertices

 > $p = cube(3);
 > $p->LP = new LinearProgram(LINEAR_OBJECTIVE=>[0,1,0,0]);
 > $p->VISUAL->VERTEX_COLORS(max=>"purple");


  • documentation/polytope/visual_polytope.txt
  • Last modified: 2019/05/21 11:10
  • by 127.0.0.1