-
Notifications
You must be signed in to change notification settings - Fork 1
A Simple Example
Once we have measured the dimensions of the meter (see Getting Started) we can start to draw the new label. For this example we are using a cheap panel meter (like this one) with a label measuring 76 mm wide, by 45 mm tall, 4 mm above the needle bearing. The needle bearing needs a clear area of 13 mm radius. There are screw holes of radius 0.75 mm, 67 mm apart, 7 mm above the needle bearing.
First, create a new Python script and import meter.py. It is a good idea to specify that this is a Unicode file, in case you want to use special symbols on the meter text. We also include "#!/usr/bin/env python" for portability between different operating systems.
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
import meter
Next, create a meter object. Ours will be called simplemeter:
# Create the meter object
simplemeter = meter.Meter(
# Dimensions for scale label (mm)
label_width = 76, label_height = 45, label_offset = 4,
# Radius of meter movement cutout (mm)
cutout_radius = 13,
# Screwholes at 31mm centres, 7mm from origin, dia 1.5mm
screw_centres = 67.0, screw_offset = 7.0, screw_radius = 0.75,
# fsd
fsd = 90,
)
Next, we will add a µA (micro Amps) scale.
(to do)
Finally, we will write the SVG for our label to a file.
f=open("simple.svg",'w')
f.write(simplemeter.write_svg())
f.close
We can open the svg file in an SVG viewer, and print it to any printer. Firefox has SVG viewing and printing capabilities.