Draw to scale using a descriptive language.


Drawj2d creates technical line drawings in vector format (pdf, svg, ...). The command line program reads a text file that describes the drawing. The input language consists of commands such as line or label. Coordinates are given in natural units, e.g. [m] or [mm].

The program is implemented in java, thus requires the Java Runtime Environment JRE (1.7 or above). Drawj2d is not a CAD program, it does not provide a graphical user interface. It is inspired by Asymptote, but with a tcl-like syntax and 2D only.

NEWS: Drawj2d 0.9.6 released. Download it!


drawj2d -T svg -W 100 -H 60 drawing.hcl

Drawj2d Input

Drawj2d Output

# variables
set dx 50
set dy 20
# draw
moveto 20 10
label P NW
rectangle $dx $dy
pen 0.35 red
arrowrel $dx $dy
label Q SE
# dimension lines
pen black
moveto 20 42
dimlinerel $dx 0
moveto 82 10
dimlinerel 0 $dy
Drawj2d Output

For more examples see the Drawj2d Wiki Examples page.

Thumbnail Thumbnail Thumbnail Thumbnail Thumbnail Thumbnail Thumbnail Thumbnail Thumbnail Thumbnail


  lines, points, circles, ellipses, arcs, parabolas, arrows and dimension lines, images, dxf

  labels using any font. LaTeX typesetting (computer modern font) supported.

  images, pdf, dxf

  color, line width and line type: solid, dashed, dotted, dashdotted

  1:50, 1:100, 1:20

• different output formats
  Vector formats: pdf (Acrobat Reader, pdfLaTeX), svg (Browser, OpenOffice/LibreOffice), eps (LaTeX), emf (Microsoft Word). Bitmap formats png, bmp. Intermediate formats: tikz (LaTeX), bgd (Fachwerk).

• platform independent
  Drawj2d runs on every platform which runs Java: Linux, Windows, Mac OS X, Unix

• reusable drawings
  Drawings can be parametrised using variables.

• programming language
  Built in string based (tcl-like) scripting language Hecl (hcl) allows advanced features and extensibility.

• mavscript compatible
  Mavscript templates can embed calls to Drawj2d. Thus drawings can be created that depend on calculations.

statics functions for engineers
  E.g. force arrows have their own scale, force vector addition respects equilibrium.


The descriptive Drawj2d vector graphics language has a straightforward syntax. --> Program Reference.

The program's native unit is mm. It is used to define the sheet dimension and the line width. Unless specified otherwise (unitlength ...) a line with the length 1.0 (drawing unit) will be one millimetre long on the sheet.

The default sheet dimension is 210 mm * 297 mm (A4). The width and the hight can be set using the command line options -W and -H, see the example above.

There is a Discussion Forum for questions.

Get started

Download the program from SourceForge. Drawj2d is is free software, subject to the GPL version 2+.

To get started, see the Wiki page and get the Program Reference.

Drawj2d program reference

This project is generously hosted by SourceForge:

SourceForge.net Logo