QA: fix altium qa tests now the altium to pcbnew coordiantes are rounded

to the near 10nm value.
This commit is contained in:
jean-pierre charras 2022-03-24 12:36:46 +01:00
parent 2e689901fc
commit 93066004f1
4 changed files with 44 additions and 42 deletions

View File

@ -838,7 +838,7 @@ SHAPE_POLY_SET* APERTURE_MACRO::GetApertureMacroShape( const GERBER_DRAW_ITEM* a
{ {
m_shape.BooleanSubtract( holeBuffer, SHAPE_POLY_SET::PM_FAST ); m_shape.BooleanSubtract( holeBuffer, SHAPE_POLY_SET::PM_FAST );
holeBuffer.RemoveAllContours(); holeBuffer.RemoveAllContours();
} }
} }
} }

View File

@ -49,34 +49,36 @@ struct ALTIUM_TO_KICAD_UNIT_CASE
/** /**
* A list of valid internal unit conversation factors * A list of valid internal unit conversation factors
* Rem: altium to kicad importer rounds cordinates to the near 10 nm value when
* converting altium values in 0.01 mil to pcbnew units (1 nm)
*/ */
static const std::vector<ALTIUM_TO_KICAD_UNIT_CASE> altium_to_kicad_unit = { static const std::vector<ALTIUM_TO_KICAD_UNIT_CASE> altium_to_kicad_unit = {
// Some simple values // Some simple values
{ 0, 0 }, { 0, 0 },
{ 1, 3 }, { 1, 0 },
{ 2, 5 }, { 2, 10 },
{ 3, 8 }, { 3, 10 },
{ 10, 25 }, { 10, 30 },
{ 20, 51 }, { 20, 50 },
{ 30, 76 }, { 30, 80 },
// Edge Cases // Edge Cases
{ 845466002, 2147483645 }, { 845466002, 2147483640 },
{ -845466002, -2147483645 }, { -845466002, -2147483640 },
// Clamp bigger values // Clamp bigger values
{ 845466003, 2147483646 }, { 845466003, 2147483640 },
{ -845466003, -2147483646 }, { -845466003, -2147483640 },
{ 1000000000, 2147483646 }, { 1000000000, 2147483640 },
{ -1000000000, -2147483646 }, { -1000000000, -2147483640 },
// imperial rounded units as input // imperial rounded units as input (rounded to the near 10 nm value)
{ 100, 254 }, { 100, 250 },
{ 200, 508 }, { 200, 510 },
{ 300, 762 }, { 300, 760 },
{ 400, 1016 }, { 400, 1020 },
{ 500, 1270 }, { 500, 1270 },
{ 600, 1524 }, { 600, 1520 },
{ 700, 1778 }, { 700, 1780 },
{ 800, 2032 }, { 800, 2030 },
{ 900, 2286 }, { 900, 2290 },
{ 1000, 2540 }, { 1000, 2540 },
// metric rounded units as input // metric rounded units as input
{ 394, 1000 }, { 394, 1000 },
@ -158,12 +160,12 @@ static const std::vector<READ_KICAD_UNIT_CASE> read_kicad_unit_property = {
// Decimal Places // Decimal Places
{ "0.1mil", 2540 }, { "0.1mil", 2540 },
{ "-0.1mil", -2540 }, { "-0.1mil", -2540 },
{ "0.01mil", 254 }, { "0.01mil", 250 },
{ "-0.01mil", -254 }, { "-0.01mil", -250 },
{ "0.001mil", 25 }, { "0.001mil", 30 },
{ "-0.001mil", -25 }, { "-0.001mil", -30 },
{ "0.0001mil", 3 }, { "0.0001mil", 0 },
{ "-0.0001mil", -3 }, { "-0.0001mil", 0 },
{ "0.00001mil", 0 }, { "0.00001mil", 0 },
{ "-0.00001mil", -0 }, { "-0.00001mil", -0 },
// Big Numbers // Big Numbers
@ -175,18 +177,18 @@ static const std::vector<READ_KICAD_UNIT_CASE> read_kicad_unit_property = {
{ "-1000mil", -25400000 }, { "-1000mil", -25400000 },
{ "10000mil", 254000000 }, { "10000mil", 254000000 },
{ "-10000mil", -254000000 }, { "-10000mil", -254000000 },
// Edge Cases // Edge Cases, values are rounded to the near available 10nm
{ "84546.6002mil", 2147483645 }, { "84546.6002mil", 2147483640 },
{ "-84546.6002mil", -2147483645 }, { "-84546.6002mil", -2147483640 },
// Clamp bigger values // Clamp bigger values, values are rounded to the near available 10nm
{ "84546.6003mil", 2147483646 }, { "84546.6003mil", 2147483640 },
{ "-84546.6003mil", -2147483646 }, { "-84546.6003mil", -2147483640 },
{ "100000mil", 2147483646 }, { "100000mil", 2147483640 },
{ "-100000mil", -2147483646 }, { "-100000mil", -2147483640 },
{ "1000000mil", 2147483646 }, { "1000000mil", 2147483640 },
{ "-1000000mil", -2147483646 }, { "-1000000mil", -2147483640 },
{ "10000000mil", 2147483646 }, { "10000000mil", 2147483640 },
{ "-10000000mil", -2147483646 }, { "-10000000mil", -2147483640 },
// Incorrect suffix // Incorrect suffix
{ "100", 0 }, { "100", 0 },
{ "100mils", 0 }, { "100mils", 0 },

View File

@ -133,7 +133,7 @@
(solder_mask_margin 0.05) (thermal_bridge_angle 45) (tstamp 1009eeb8-4be8-49ff-871d-1e30079ffe54)) (solder_mask_margin 0.05) (thermal_bridge_angle 45) (tstamp 1009eeb8-4be8-49ff-871d-1e30079ffe54))
(pad "39" smd rect (at -2.835 1.835 180) (size 1.33 1.33) (layers "F.Cu" "F.Paste" "F.Mask") (pad "39" smd rect (at -2.835 1.835 180) (size 1.33 1.33) (layers "F.Cu" "F.Paste" "F.Mask")
(solder_mask_margin 0.05) (thermal_bridge_angle 45) (tstamp f21e0d2f-30e3-44a7-b089-f9815487c7f8)) (solder_mask_margin 0.05) (thermal_bridge_angle 45) (tstamp f21e0d2f-30e3-44a7-b089-f9815487c7f8))
(pad "39" smd rect (at -1.000003 0) (size 1.33 1.33) (layers "F.Cu" "F.Paste" "F.Mask") (pad "39" smd rect (at -1.000000 0) (size 1.33 1.33) (layers "F.Cu" "F.Paste" "F.Mask")
(solder_mask_margin 0.05) (thermal_bridge_angle 45) (tstamp 047aa3bb-6884-4df5-83ed-7ea551b329b1)) (solder_mask_margin 0.05) (thermal_bridge_angle 45) (tstamp 047aa3bb-6884-4df5-83ed-7ea551b329b1))
(pad "39" smd rect (at -1 -1.835) (size 1.33 1.33) (layers "F.Cu" "F.Paste" "F.Mask") (pad "39" smd rect (at -1 -1.835) (size 1.33 1.33) (layers "F.Cu" "F.Paste" "F.Mask")
(solder_mask_margin 0.05) (thermal_bridge_angle 45) (tstamp c35a9928-3453-4c10-b581-c909a87ff023)) (solder_mask_margin 0.05) (thermal_bridge_angle 45) (tstamp c35a9928-3453-4c10-b581-c909a87ff023))

View File

@ -10,7 +10,7 @@
(effects (font (size 1.27 1.27) (thickness 0.15))) (effects (font (size 1.27 1.27) (thickness 0.15)))
(tstamp 784b6458-3ae8-48f4-9482-731714d7927e) (tstamp 784b6458-3ae8-48f4-9482-731714d7927e)
) )
(fp_text user "Mask Exp" (at -19.746 7.238164 unlocked) (layer "Dwgs.User") (fp_text user "Mask Exp" (at -19.746 7.238160 unlocked) (layer "Dwgs.User")
(effects (font (size 1.524 1.524) (thickness 0.254)) (justify left bottom)) (effects (font (size 1.524 1.524) (thickness 0.254)) (justify left bottom))
(tstamp 1b0f55f9-5fa5-489c-9db2-e63c29ecdd31) (tstamp 1b0f55f9-5fa5-489c-9db2-e63c29ecdd31)
) )