The goal of this package is to prepare geometric objects for rendering in a figure or in a gui. This package is intended to support graphical output via matplotlib.
Stores data necessary to draw one of the polygons from a surface.
Return the quadruple (x1,y1,x2,y2) where x1 and y1 are the minimal x- and y-coordinates and x2 and y2 are the maximal x-and y- cordinates.
Returns a plot of the GraphicalPolygon.
EXAMPLES:
sage: from flatsurf import *
sage: s = similarity_surfaces.example()
sage: from flatsurf.graphical.surface import GraphicalSurface
sage: gs = GraphicalSurface(s)
sage: gs.graphical_polygon(0).set_fill_color("red")
sage: gs.graphical_polygon(0).plot()
Graphics object consisting of 2 graphics primitives
Return the transformation of point into graphical coordinates.
EXAMPLES:
sage: from flatsurf import *
sage: from flatsurf.graphical.surface import GraphicalSurface
sage: s = similarity_surfaces.example()
sage: gs = GraphicalSurface(s)
sage: gs.graphical_polygon(0).set_fill_color("red")
sage: gs.graphical_polygon(0).plot()
Graphics object consisting of 2 graphics primitives
Return the quadruple (x1,y1,x2,y2) where x1 and y1 are the minimal x- and y-coordinates of a visible graphical polygon and x2 and y2 are the maximal x-and y- cordinates of a visible graphical polygon.
Returns the truth value of the statement ‘The polygon opposite edge (p,e) is adjacent to that edge.’
Move the polygon across the prescribed edge so that is adjacent.
EXAMPLES:
sage: from flatsurf.geometry.similarity_surface_generators import SimilaritySurfaceGenerators
sage: s = SimilaritySurfaceGenerators.example()
sage: from flatsurf.graphical.surface import GraphicalSurface
sage: gs = GraphicalSurface(s)
sage: print("Polygon 0: "+str(gs.graphical_polygon(0).vertices()))
Polygon 0: [(0.0, 0.0), (2.0, -2.0), (2.0, 0.0)]
sage: print("Polygon 1: "+str(gs.graphical_polygon(1).vertices()))
Polygon 1: [(0.0, 0.0), (2.0, 0.0), (1.0, 3.0)]
sage: print("Polygon 0, edge 0 is opposite "+str(gs.opposite_edge(0,0)))
Polygon 0, edge 0 is opposite (1, 1)
sage: gs.make_adjacent(0,0)
sage: print("Polygon 0: "+str(gs.graphical_polygon(0).vertices()))
Polygon 0: [(0.0, 0.0), (2.0, -2.0), (2.0, 0.0)]
sage: print("Polygon 1: "+str(gs.graphical_polygon(1).vertices()))
Polygon 1: [(0.4, -2.8), (2.0, -2.0), (0.0, 0.0)]
Move the polygon across the prescribed edge so that is adjacent, and make the moved polygon visible.
Given the label p of a polygon and an edge e in that polygon returns the pair (pp, ee) to which this edge is glued.
Returns a plot of the GraphicalSurface
EXAMPLES:
sage: from flatsurf.geometry.similarity_surface_generators import SimilaritySurfaceGenerators
sage: s = SimilaritySurfaceGenerators.example()
sage: from flatsurf.graphical.surface import GraphicalSurface
sage: gs = GraphicalSurface(s)
sage: gs.make_visible(1)
sage: gs.plot()
Graphics object consisting of 9 graphics primitives
EXAMPLES:
from flatsurf.geometry.similarity_surface_generators import SimilaritySurfaceGenerators
s=SimilaritySurfaceGenerators.example()
from flatsurf.graphical.surface import GraphicalSurface
gs=GraphicalSurface(s)
gs.make_visible(1)
from flatsurf.geometry.tangent_bundle import *
tb = SimilaritySurfaceTangentBundle(s)
V=tb.surface().vector_space()
v=SimilaritySurfaceTangentVector(tb, 0, V((1,-0.5)), V((3,-1)))
from flatsurf.geometry.straight_line_trajectory import *
seg = SegmentInPolygon(v)
from flatsurf.graphical.straight_line_trajectory import *
gseg = GraphicalSegmentInPolygon(gs, seg)
show(gs.plot()+gseg.plot())
Allows for the rendering of a straight-line trajectory through a graphical surface.
EXAMPLES:
from flatsurf.geometry.similarity_surface_generators import SimilaritySurfaceGenerators
s=SimilaritySurfaceGenerators.example()
from flatsurf.graphical.surface import GraphicalSurface
gs=GraphicalSurface(s)
gs.make_visible(1)
from flatsurf.geometry.tangent_bundle import *
K.<sqrt2>=NumberField(x^2-2,embedding=1)
tb = SimilaritySurfaceTangentBundle(s)
from flatsurf.sage.modules.free_module_element import vector
v=SimilaritySurfaceTangentVector(tb, 0, vector((1,-1)), vector((sqrt2,-1)))
from flatsurf.geometry.straight_line_trajectory import *
traj = StraightLineTrajectory(v)
traj.flow(100)
traj.flow(-5)
from flatsurf.graphical.straight_line_trajectory import *
gtraj = GraphicalStraightLineTrajectory(gs, traj)
show(gs.plot()+gtraj.plot())