DMelt:Plots/Technical Drawings
From HandWiki
Limitted access. First login to DataMelt if you are a full DataMelt member. Then login to HandWiki as a user.
Technical drawings
DataMelt supports technical drawings using net.sf.drawj2d.Drawj2d class. One advantage of the package is that you create images
directly in the SVG file format, thus images are fully scalable.
Let us consider an example.
from jhplot import * from net.sf.drawj2d import Drawj2d f="drawing.hcl" out="/home/sergei/work/dmelt/Drawj2d/drawing.svg" s=""" # 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 """ with open(f, "w") as xfile: xfile.write(s) args=["-T" "svg", "-W", "100", "-H", "60", "-o", out, f] c=Drawj2d.Run(args) IViewSVG(out)
This example creates a file with the commands to draw a technical image. Then we read this file, create a SVG scalable image and open this image in jhplot.IViewSVG viewer. The output is:
The complete syntax of the files where drawings are defined is this manual:
![]() | No access to this part. DataMelt members can view this part after login to member area. |
![]() | See more examples in the section Technical drawings |