I’m playing about with python scripting (invoked using execfile(‘C:/Users/David/Desktop/Kicad_python_scripts/basics.py’)
This particular script states the following
#####################
physical dimensions
#####################
coordinate space of kicad_pcb is in mm. At the beginning of
https://en.wikibooks.org/wiki/Kicad/file_formats#Board_File_Format
“All physical units are in mils (1/1000th inch) unless otherwise noted.”
then later in historical notes, it says,
As of 2013, the PCBnew application creates “.kicad_pcb” files that begin with
“(kicad_pcb (version 3)”. All distances are in millimetres.
the internal coordinate space of pcbnew is 10E-6 mm. (a millionth of a mm)
the coordinate 121550000 corresponds to 121.550000
SCALE = 1000000.0
boardbbox = board.ComputeBoundingBox()
boardxl = boardbbox.GetX()
boardyl = boardbbox.GetY()
boardwidth = boardbbox.GetWidth()
boardheight = boardbbox.GetHeight()
print(“this board is at position {}, {} {} wide and {} high”.format(boardxl,
boardyl,
boardwidth,
boardheight))
The script reports that the board size is 66502281 wide and 51943363 high (66.5 mm wide by 51.9 mm high). However, when I measure the board using the vernier tool in PCBnew the size is 64.21 mm by 49.2 mm.
There is a difference of over 2 mm in the measurements. I wonder why that is and which measurement is the more accurate? Any clues? Thanks.
David.