坐标系统

EasyEDA’s editor is based SVG, SVG viewport,(Coordinates increase left-to-right and top-to-bottom, the same as EasyEDA ). But SVG’s origin is fixed at the left top corn, and EasyEDA’s origin can be modified at the any place.

Be careful this, they are different from Cartesian coordinate system

单位

There are two kinds of unit in our editor, SVG Canvas unit and real world EasyEDA unit. SVG Canvas unit is Pixel. The real world EasyEDA unit in schematic is also Pixel, but in PCB, there are mm, mil and inch. We use bellow map to convert Canvas to real world.

  • 1 pixel = 10 mil
  • 1 pixel = 0.254mm
  • 1 pixel = 0.01inch

There are API for these convert.

  • mm2pixel: convert 10mm to pixel
var result = api('unitConvert', {type:'mm2pixel',value:10});
  • mil2pixel: convert 10mil to pixel
var result = api('unitConvert', {type:'mil2pixel',value:10});

There are other convert method, such as inch2pixel, pixel2mm, pixel2mil and pixel2inch.

All EasyEDA’s value is based pixel, if you can keep in mind that 1 pixel equal 10mil or 0.254 mm, you don’t need to use any convert function.
For example, if you want to change a Track to 20mil, so you just need to use 2.


goToTop