KiCad PCB EDA Suite
gerber_file_image.cpp File Reference

a GERBER class handle for a given layer info about used D_CODES and how the layer is drawn More...

#include <convert_to_biu.h>
#include <gerbview.h>
#include <gerbview_frame.h>
#include <gerber_file_image.h>
#include <macros.h>
#include <X2_gerber_attributes.h>
#include <algorithm>
#include <map>
#include <core/arraydim.h>

Go to the source code of this file.

Functions

int scaletoIU (double aCoord, bool isMetric)
 Function scaletoIU converts a distance given in floating point to our internal units. More...
 

Detailed Description

a GERBER class handle for a given layer info about used D_CODES and how the layer is drawn

Definition in file gerber_file_image.cpp.

Function Documentation

◆ scaletoIU()

int scaletoIU ( double  aCoord,
bool  isMetric 
)

Function scaletoIU converts a distance given in floating point to our internal units.

Function scaletoIU converts a distance given in floating point to our internal units.

Convert a distance given in floating point to our internal units.

Definition at line 58 of file rs274_read_XY_and_IJ_coordinates.cpp.

59 {
60  int ret;
61 
62  if( isMetric ) // gerber are units in mm
63  ret = KiROUND( aCoord * IU_PER_MM );
64  else // gerber are units in inches
65  ret = KiROUND( aCoord * IU_PER_MILS * 1000.0 );
66 
67  return ret;
68 }
static constexpr double IU_PER_MM
Mock up a conversion function.
#define IU_PER_MILS
Definition: plotter.cpp:136
constexpr ret_type KiROUND(fp_type v)
Round a floating point number to an integer using "round halfway cases away from zero".
Definition: util.h:73

References IU_PER_MILS, IU_PER_MM, and KiROUND().

Referenced by GERBER_FILE_IMAGE::StepAndRepeatItem().