2D-Output using MetaPost
Similar to LaTeXX, MetaPost is an elegant way to create eps, pdf etc. from a programming language vector graphic code. If you do not have it installed on your PC, you may use the MetaPost generator by Troy Henderson: www.tlhiv.org/mppreview/. However, this link sometimes did not work in the past.
draw2d
The package provides the following output functions:
HighVoronoi.draw2D
— Functiondraw2D(VG::VoronoiGeometry, filename::String; board=MetaPostBoard(), drawNodes=true, drawVerteces=true, drawEdges=true)
Generates MetaPost of VG output in the file with name filename for a two-dimensional VoronoiGeometry.
board
: TheMetaPostBoard
to be used.drawNodes
: Set this value to "false" in order to not show the nodes in the outputdrawVerteces
: Set this value to "false" in order to not show the verteces in the outputdrawEdges
: Set this value to "false" in order to not show the edges in the output
draw2D(Integral::Voronoi_Integral, filename::String; domain=nothing, board=MetaPostBoard(), drawNodes=true, drawVerteces=true, drawEdges=true)
Writes MetaPost code for the internal type Voronoi_Integral, which may be assessed via VoronoiGeometry.Integrator.Integral
. It has one additional parameter:
domain
: A domain of typeBoundary
can be passed here. This will be shown in the color specified bydomain_color
.
The MeatPostBoard
These methods are based on the MetaPostBoard
structure:
HighVoronoi.MetaPostBoard
— TypeMetaPostBoard
Provides a board to display a two-dimensional VoronoiGeometry
in MetaPost text format using draw2D.
HighVoronoi.MetaPostBoard
— MethodThe constructor
MetaPostBoard()
Generates a MetapostBoard where the following <:Real
-type arguments may be passed (=standard value)
scaling=100
: denotes a factor by which every object is magnified (also applies to the coordinates of points)node_size=0.01
: nodes are drawn as a cross. This variable is the size of a cross BEFORE scalingvertex_size=0.003
: same for verteces
Additionally, the following colors may be passed as a <:String
. note that an empty string implies the usage of the MetaPost standard pen color.
nodes_color=""
: the color at which nodes are draw. Empty string implies standard color (typically black)vertex_color="red"
: color vertecesedge_color="blue"
: color of edgesdomain_color=""
: color the domain, in case adomain
argument is passed to thedraw2D
-function. Also it displays the domain that was passed to aVoronoiGeometry
during instatiation- board::Boundary: provides a board: every node or vertex outside this board is not drawn