====== BigObject Visual::Polytope ======
//from application [[..:polytope|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).
===== Methods =====
==== no category ====
{{anchor:directed_graph:}}
? **''DIRECTED_GRAPH([[..:polytope:LinearProgram |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:
:: ''[[..:polytope:LinearProgram |LinearProgram]]'' ''lp'': a Linear Program object attached to the polytope
? Returns:
:''[[..:polytope:Visual_Polytope |Visual::Polytope]]''
? 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;
----
{{anchor:lattice:}}
? **''LATTICE()''**
:: Visualize the ''[[..:polytope:Polytope#LATTICE_POINTS |LATTICE_POINTS]]'' of a polytope
? Options:
: option list ''[[..:common#Visual_PointSet_decorations |Visual::PointSet::decorations]]''
? Returns:
:''[[..:polytope:Visual_Polytope |Visual::Polytope]]''
? Example:
:: Visualizes the lattice points of the threedimensional cube.
:: > cube(3)->VISUAL->LATTICE;
----
{{anchor:lattice_colored:}}
? **''LATTICE_COLORED()''**
:: Visualize the ''[[..:polytope:Polytope#LATTICE_POINTS |LATTICE_POINTS]]'' of a polytope in different colors (interior / boundary / vertices)
? Options:
: option list ''[[..:common#Visual_PointSet_decorations |Visual::PointSet::decorations]]''
? Returns:
:''[[..:polytope:Visual_Polytope |Visual::Polytope]]''
? 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;
----
{{anchor:min_max_face:}}
? **''MIN_MAX_FACE([[..:polytope:LinearProgram |LinearProgram]] lp)''**
:: Illustrate the behavior of a linear objective function on the polytope. Draw the facets contained in ''[[..:polytope:LinearProgram#MAXIMAL_FACE |MAXIMAL_FACE]]'' and ''[[..:polytope:LinearProgram#MINIMAL_FACE |MINIMAL_FACE]]'' in distinct colors.
? Parameters:
:: ''[[..:polytope:LinearProgram |LinearProgram]]'' ''lp'': a LinearProgram object attached to the polytope.
? Options:
:
:: ''[[..:common#Color |Color]]'' ''min'': minimal face decoration (default: yellow vertices and/or facets)
:: ''[[..:common#Color |Color]]'' ''max'': maximal face decoration (default: red vertices and/or facets)
? Returns:
:''[[..:polytope:Visual_Polytope |Visual::Polytope]]''
? 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");
----
{{anchor:steiner:}}
? **''STEINER()''**
:: Add the [[..:polytope:Polytope#STEINER_POINTS |STEINER_POINTS]] to the 3-d visualization. The facets become transparent.
? Options:
: option list ''[[..:common#Visual_PointSet_decorations |Visual::PointSet::decorations]]''
? Returns:
:''[[..:polytope:Visual_Polytope |Visual::Polytope]]''
? 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;
----
{{anchor:triangulation:}}
? **''TRIANGULATION([[..:common#Array |Array]]<[[..:common#Set |Set]]<[[..:common#Int |Int]]%%>>%% t)''**
:: Add the triangulation to the drawing. You may specify any triangulation of the current polytope. Per default, the [[..:polytope:Cone#TRIANGULATION |TRIANGULATION]] property is taken. (Currently there is only one possible alternative triangulation: [[..:polytope:Cone#TRIANGULATION_INT |TRIANGULATION_INT]]). **Hint:** Use the method __Method -> Effect -> Explode Group of Geometries__ of [[:external_software#JavaView|JavaView]] for better insight in the internal structure.
? Parameters:
:: ''[[..:common#Array |Array]]<[[..:common#Set |Set]]<[[..:common#Int |Int]]%%>>%%'' ''t'': facets of the triangulation
? Options:
: option list ''[[..:common#Visual_Polygons_decorations |Visual::Polygons::decorations]]''
? Returns:
:''[[..:polytope:Visual_Polytope |Visual::Polytope]]''
? 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");
----
{{anchor:triangulation_boundary:}}
? **''TRIANGULATION_BOUNDARY()''**
:: Draw the edges of the [[..:polytope:Visual_Polytope#TRIANGULATION_BOUNDARY |TRIANGULATION_BOUNDARY]]. The facets are made transparent.
? Options:
: option list ''[[..:graph#Visual_Graph_decorations |Visual::Graph::decorations]]''
? Returns:
:''[[..:polytope:Visual_Polytope |Visual::Polytope]]''
? 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;
----
{{anchor:vertex_colors:}}
? **''VERTEX_COLORS([[..:polytope:LinearProgram |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:
:: ''[[..:polytope:LinearProgram |LinearProgram]]'' ''lp'': a LinearProgram object attached to the polytope
? Options:
:
:: ''[[..:common#Color |Color]]'' ''min'': minimal vertex color (default: yellow)
:: ''[[..:common#Color |Color]]'' ''max'': maximal vertex color (default: red)
? Returns:
:''[[..:polytope:Visual_Polytope |Visual::Polytope]]''
? 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");
----