# Copyright (c) 1997-2004 # Ewgenij Gawrilow, Michael Joswig (Technische Universitaet Berlin, Germany) # http://www.math.tu-berlin.de/polymake, mailto:polymake@math.tu-berlin.de # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation; either version 2, or (at your option) any # later version: http://www.gnu.org/licenses/gpl.txt. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. #----------------------------------------------------------------------------- # $Project: polymake $$Id: steiner.rules 7509 2006-12-15 13:08:59Z thilosch $ object Polytope; # category: Basic properties # A weighted inner point depending on the outer angle called Steiner point for all faces of dimensions `2` to `d`. property STEINER_POINTS $type="matrix"; STEINER_POINTS : HASSE_DIAGRAM, GRAPH, VERTICES, DIM, BOUNDED WEIGHT 6.10 client("steiner_point_all", $this); # category: Visualization # Create a SchlegelDiagram object. # # The projection ray will connect the Steiner points of the polytope # and the projection facet. # # Default zoom factor is 1/2. # return: SchlegelDiagram user_method makeSchlegelSteinerPoints(%make_schlegel_params) { my ($this, $params)=@_; my $P=$this->STEINER_POINTS; $params->{FACET} ||= 0; $params->{ZOOM} ||= "1/2"; new Apps::polytope::SchlegelDiagram ( Polytope => $this, %$params, FACET_POINT => $P->[$params->{FACET}+1], INNER_POINT => $P->[0], ); } package Visual::Color; # Steiner points are drawn in blue custom $steiner_point="0 0 255"; package default; # Steiner points are drawn thicker than the vertices custom $steiner_point_thickness=7; ################################################################################### # # decoration methods adding Steiner points to various drawings # package Visual::Polytope; # Add the @see STEINER_POINTS to the 3-d visualization. # The facets became transparent. user_method STEINER(%Visual::PointSet::decorations) { my ($self, $decor)=@_; $self->basis_solid->FacetStyle="hidden"; my $P=$self->Polytope; my $SP=new Visual::PointSet( Name => "Steiner points of " . $P->name, Points => [ $P->dehomogenize($P->STEINER_POINTS) ], PointColor => $Visual::Color::steiner_point, PointStyle => "thickness $steiner_point_thickness", PointLabels => "hidden", $decor, ); push @{$self->elements}, $SP; visualize($self); } package Visual::Schlegel; # Add the @see STEINER_POINTS to the 4-d visualization. user_method STEINER(%Visual::PointSet::decorations) { my ($self, $decor)=@_; my $SD=$self->Schlegel; my $P=$SD->Polytope; my @steiner_points=@{$P->STEINER_POINTS}; # omit the Steiner point of the whole polytope and the one on the projection facet splice @steiner_points, 0, 1; splice @steiner_points, $SD->FACET, 1; my $SP=new Visual::PointSet( Name => "Steiner points of " . $P->name, Points => $self->append_points(\@steiner_points), PointColor => $Visual::Color::steiner_point, PointStyle => "thickness $steiner_point_thickness", PointLabels => "hidden", $decor ); push @{$self->elements}, $SP; visualize($self); } # Local Variables: # mode: perl # c-basic-offset:3 # End: