From 93066004f1b41bdec120d28d3339d8b3da43d896 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Thu, 24 Mar 2022 12:36:46 +0100 Subject: [PATCH] QA: fix altium qa tests now the altium to pcbnew coordiantes are rounded to the near 10nm value. --- gerbview/am_primitive.cpp | 2 +- .../plugins/altium/test_altium_parser.cpp | 80 ++++++++++--------- .../Espressif ESP32-WROOM-32.kicad_mod | 2 +- .../pcblib/TracksTest.pretty/MASKS.kicad_mod | 2 +- 4 files changed, 44 insertions(+), 42 deletions(-) diff --git a/gerbview/am_primitive.cpp b/gerbview/am_primitive.cpp index ec128d696b..969afb77bc 100644 --- a/gerbview/am_primitive.cpp +++ b/gerbview/am_primitive.cpp @@ -838,7 +838,7 @@ SHAPE_POLY_SET* APERTURE_MACRO::GetApertureMacroShape( const GERBER_DRAW_ITEM* a { m_shape.BooleanSubtract( holeBuffer, SHAPE_POLY_SET::PM_FAST ); holeBuffer.RemoveAllContours(); - } + } } } diff --git a/qa/common/plugins/altium/test_altium_parser.cpp b/qa/common/plugins/altium/test_altium_parser.cpp index 8e287993f7..7edbe108e0 100644 --- a/qa/common/plugins/altium/test_altium_parser.cpp +++ b/qa/common/plugins/altium/test_altium_parser.cpp @@ -49,34 +49,36 @@ struct ALTIUM_TO_KICAD_UNIT_CASE /** * 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 = { // Some simple values { 0, 0 }, - { 1, 3 }, - { 2, 5 }, - { 3, 8 }, - { 10, 25 }, - { 20, 51 }, - { 30, 76 }, + { 1, 0 }, + { 2, 10 }, + { 3, 10 }, + { 10, 30 }, + { 20, 50 }, + { 30, 80 }, // Edge Cases - { 845466002, 2147483645 }, - { -845466002, -2147483645 }, + { 845466002, 2147483640 }, + { -845466002, -2147483640 }, // Clamp bigger values - { 845466003, 2147483646 }, - { -845466003, -2147483646 }, - { 1000000000, 2147483646 }, - { -1000000000, -2147483646 }, - // imperial rounded units as input - { 100, 254 }, - { 200, 508 }, - { 300, 762 }, - { 400, 1016 }, + { 845466003, 2147483640 }, + { -845466003, -2147483640 }, + { 1000000000, 2147483640 }, + { -1000000000, -2147483640 }, + // imperial rounded units as input (rounded to the near 10 nm value) + { 100, 250 }, + { 200, 510 }, + { 300, 760 }, + { 400, 1020 }, { 500, 1270 }, - { 600, 1524 }, - { 700, 1778 }, - { 800, 2032 }, - { 900, 2286 }, + { 600, 1520 }, + { 700, 1780 }, + { 800, 2030 }, + { 900, 2290 }, { 1000, 2540 }, // metric rounded units as input { 394, 1000 }, @@ -158,12 +160,12 @@ static const std::vector read_kicad_unit_property = { // Decimal Places { "0.1mil", 2540 }, { "-0.1mil", -2540 }, - { "0.01mil", 254 }, - { "-0.01mil", -254 }, - { "0.001mil", 25 }, - { "-0.001mil", -25 }, - { "0.0001mil", 3 }, - { "-0.0001mil", -3 }, + { "0.01mil", 250 }, + { "-0.01mil", -250 }, + { "0.001mil", 30 }, + { "-0.001mil", -30 }, + { "0.0001mil", 0 }, + { "-0.0001mil", 0 }, { "0.00001mil", 0 }, { "-0.00001mil", -0 }, // Big Numbers @@ -175,18 +177,18 @@ static const std::vector read_kicad_unit_property = { { "-1000mil", -25400000 }, { "10000mil", 254000000 }, { "-10000mil", -254000000 }, - // Edge Cases - { "84546.6002mil", 2147483645 }, - { "-84546.6002mil", -2147483645 }, - // Clamp bigger values - { "84546.6003mil", 2147483646 }, - { "-84546.6003mil", -2147483646 }, - { "100000mil", 2147483646 }, - { "-100000mil", -2147483646 }, - { "1000000mil", 2147483646 }, - { "-1000000mil", -2147483646 }, - { "10000000mil", 2147483646 }, - { "-10000000mil", -2147483646 }, + // Edge Cases, values are rounded to the near available 10nm + { "84546.6002mil", 2147483640 }, + { "-84546.6002mil", -2147483640 }, + // Clamp bigger values, values are rounded to the near available 10nm + { "84546.6003mil", 2147483640 }, + { "-84546.6003mil", -2147483640 }, + { "100000mil", 2147483640 }, + { "-100000mil", -2147483640 }, + { "1000000mil", 2147483640 }, + { "-1000000mil", -2147483640 }, + { "10000000mil", 2147483640 }, + { "-10000000mil", -2147483640 }, // Incorrect suffix { "100", 0 }, { "100mils", 0 }, diff --git a/qa/data/plugins/altium/pcblib/Espressif ESP32-WROOM-32.pretty/Espressif ESP32-WROOM-32.kicad_mod b/qa/data/plugins/altium/pcblib/Espressif ESP32-WROOM-32.pretty/Espressif ESP32-WROOM-32.kicad_mod index 7dfa384260..eeb5d06792 100644 --- a/qa/data/plugins/altium/pcblib/Espressif ESP32-WROOM-32.pretty/Espressif ESP32-WROOM-32.kicad_mod +++ b/qa/data/plugins/altium/pcblib/Espressif ESP32-WROOM-32.pretty/Espressif ESP32-WROOM-32.kicad_mod @@ -133,7 +133,7 @@ (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") (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)) (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)) diff --git a/qa/data/plugins/altium/pcblib/TracksTest.pretty/MASKS.kicad_mod b/qa/data/plugins/altium/pcblib/TracksTest.pretty/MASKS.kicad_mod index d590c64100..a8d198c6ce 100644 --- a/qa/data/plugins/altium/pcblib/TracksTest.pretty/MASKS.kicad_mod +++ b/qa/data/plugins/altium/pcblib/TracksTest.pretty/MASKS.kicad_mod @@ -10,7 +10,7 @@ (effects (font (size 1.27 1.27) (thickness 0.15))) (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)) (tstamp 1b0f55f9-5fa5-489c-9db2-e63c29ecdd31) )