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.draw2DFunction
draw2D(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 : The MetaPostBoard to be used.
  • drawNodes : Set this value to "false" in order to not show the nodes in the output
  • drawVerteces : Set this value to "false" in order to not show the verteces in the output
  • drawEdges : 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 type Boundary can be passed here. This will be shown in the color specified by domain_color.

The MeatPostBoard

These methods are based on the MetaPostBoard structure:

HighVoronoi.MetaPostBoardType
MetaPostBoard

Provides a board to display a two-dimensional VoronoiGeometry in MetaPost text format using draw2D.

HighVoronoi.MetaPostBoardMethod

The 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 scaling
  • vertex_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 verteces
  • edge_color="blue": color of edges
  • domain_color="": color the domain, in case a domain argument is passed to the draw2D-function. Also it displays the domain that was passed to a VoronoiGeometry during instatiation
  • board::Boundary: provides a board: every node or vertex outside this board is not drawn