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.8 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.
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 |
|
For more examples see the Drawj2d Wiki Examples page.
• DRAW
lines, points, circles, ellipses, arcs, parabolas, arrows and dimension lines
• WRITE
labels using any font. LaTeX typesetting (computer modern font) supported. Single line font available.
• IMPORT
images, pdf, svg, dxf
• SET
color, line width and line type: solid, dashed, dotted, dashdotted
• DRAW TO SCALE
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), rmdoc/rmn/rm (reMarkable), hcl (Drawj2d), dxf (CAD).
• 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.
Download the program from SourceForge. Drawj2d is is free software, subject to the GPL.
To get started, see the Wiki page and get the Program Reference.
Is the application useful for you? A little contribution is a big motivation to continue improving Drawj2d.
This project is generously hosted by SourceForge: