From 8506fb78dba2add80f326ee65be027f66bb6626b Mon Sep 17 00:00:00 2001 From: "Salvador E. Tropea" Date: Wed, 25 Jan 2023 11:05:01 -0300 Subject: [PATCH] [Report][Fixed] Computed size - When using circles and some arcs in the PCB edge Closes #375 --- CHANGELOG.md | 18 +- kibot/gs.py | 9 + kibot/out_report.py | 20 +- kibot/var_base.py | 7 +- .../kicad_6/circle_edge.kicad_pcb | 258 ++++++++++++++++++ tests/reference/6_0_8/circle_edge-report.txt | 2 + tests/test_plot/test_misc.py | 11 + 7 files changed, 303 insertions(+), 22 deletions(-) create mode 100644 tests/board_samples/kicad_6/circle_edge.kicad_pcb create mode 100644 tests/reference/6_0_8/circle_edge-report.txt diff --git a/CHANGELOG.md b/CHANGELOG.md index 1a2ae5b4..579df4c7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -47,20 +47,22 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - SVG: - Options to limit the view box to the used area. ### Fixed -- PCB_Print: - - Images not showing in custom frames. (#352) - - Problems when trying to use groups of layers (i.e. copper) -- iBoM: - - Variant changes to the *.Fab weren't exported. - Now all 2D variant stuff is applied before calling iBoM (#350) +- BoM: + - pre_transform filers can't be logic filters - Copy_Files: - Problems on KiCad 5 (no 3rd party dir) (#357) - Problems with compress output (also Makefile) (#372) -- BoM: - - pre_transform filers can't be logic filters - DOCs - annotate_pcb pre-flight missing options (#360) - annotate_pcb pre-flight wrong example (#360) +- iBoM: + - Variant changes to the *.Fab weren't exported. + Now all 2D variant stuff is applied before calling iBoM (#350) +- PCB_Print: + - Images not showing in custom frames. (#352) + - Problems when trying to use groups of layers (i.e. copper) +- Report: + - Computed size when using circles and some arcs in the PCB edge (#375) ## [1.5.1] - 2022-12-16 ### Fixed diff --git a/kibot/gs.py b/kibot/gs.py index b1c7d99c..2818ed90 100644 --- a/kibot/gs.py +++ b/kibot/gs.py @@ -505,6 +505,15 @@ class GS(object): return g.GetArcStart() return g.GetEnd() + @staticmethod + def get_shape_bbox(s): + """ Bounding box without the width of the trace """ + width = s.GetWidth() + s.SetWidth(0) + bbox = s.GetBoundingBox() + s.SetWidth(width) + return bbox + @staticmethod def get_kiauto_video_name(cmd): """ Compute the name for the video captured by KiAuto """ diff --git a/kibot/out_report.py b/kibot/out_report.py index 016a0b66..8a3891fb 100644 --- a/kibot/out_report.py +++ b/kibot/out_report.py @@ -450,11 +450,13 @@ class ReportOptions(BaseOptions): draw_type = 'DRAWSEGMENT' if GS.ki5 else 'PCB_SHAPE' for d in board.GetDrawings(): if d.GetClass() == draw_type and d.GetLayer() == edge_layer: + bb = GS.get_shape_bbox(d) + start = bb.GetOrigin() + end = bb.GetEnd() if x1 is None: - p = d.GetStart() - x1 = x2 = p.x - y1 = y2 = p.y - for p in [d.GetStart(), d.GetEnd()]: + x1 = x2 = start.x + y1 = y2 = start.y + for p in [start, end]: x2 = max(x2, p.x) y2 = max(y2, p.y) x1 = min(x1, p.x) @@ -463,11 +465,13 @@ class ReportOptions(BaseOptions): for m in GS.get_modules(): for gi in m.GraphicalItems(): if gi.GetClass() == 'MGRAPHIC' and gi.GetLayer() == edge_layer: + bb = GS.get_shape_bbox(gi) + start = bb.GetOrigin() + end = bb.GetEnd() if x1 is None: - p = gi.GetStart() - x1 = x2 = p.x - y1 = y2 = p.y - for p in [gi.GetStart(), gi.GetEnd()]: + x1 = x2 = start.x + y1 = y2 = start.y + for p in [start, end]: x2 = max(x2, p.x) y2 = max(y2, p.y) x1 = min(x1, p.x) diff --git a/kibot/var_base.py b/kibot/var_base.py index 02d73bb4..bb013c6f 100644 --- a/kibot/var_base.py +++ b/kibot/var_base.py @@ -54,12 +54,7 @@ class Edge(object): def get_bbox(self): """ Get the Bounding Box for the shape, without its line width. KiKit uses the value in this way. """ - s = self.shape - width = s.GetWidth() - s.SetWidth(0) - bbox = s.GetBoundingBox() - s.SetWidth(width) - return bbox + return GS.get_shape_bbox(self.shape) def __str__(self): return '{} {}-{}'.format(self.cls, point_str(self.start), point_str(self.end)) diff --git a/tests/board_samples/kicad_6/circle_edge.kicad_pcb b/tests/board_samples/kicad_6/circle_edge.kicad_pcb new file mode 100644 index 00000000..24c7296e --- /dev/null +++ b/tests/board_samples/kicad_6/circle_edge.kicad_pcb @@ -0,0 +1,258 @@ +(kicad_pcb (version 20211014) (generator pcbnew) + + (general + (thickness 0.7584) + ) + + (paper "A4") + (title_block + (title "Miniscope-V4-Rigid-Flex") + (date "2023-01-17") + (rev "4.42") + (company "Aharoni Lab") + ) + + (layers + (0 "F.Cu" signal) + (1 "In1.Cu" signal) + (2 "In2.Cu" signal) + (3 "In3.Cu" signal) + (4 "In4.Cu" signal) + (31 "B.Cu" signal) + (32 "B.Adhes" user "B.Adhesive") + (33 "F.Adhes" user "F.Adhesive") + (34 "B.Paste" user) + (35 "F.Paste" user) + (36 "B.SilkS" user "B.Silkscreen") + (37 "F.SilkS" user "F.Silkscreen") + (38 "B.Mask" user) + (39 "F.Mask" user) + (40 "Dwgs.User" user "User.Drawings") + (41 "Cmts.User" user "User.Comments") + (42 "Eco1.User" user "User.Eco1") + (43 "Eco2.User" user "User.Eco2") + (44 "Edge.Cuts" user) + (45 "Margin" user) + (46 "B.CrtYd" user "B.Courtyard") + (47 "F.CrtYd" user "F.Courtyard") + (48 "B.Fab" user) + (49 "F.Fab" user) + ) + + (setup + (stackup + (layer "F.SilkS" (type "Top Silk Screen")) + (layer "F.Paste" (type "Top Solder Paste")) + (layer "F.Mask" (type "Top Solder Mask") (thickness 0.01)) + (layer "F.Cu" (type "copper") (thickness 0.035)) + (layer "dielectric 1" (type "core") (thickness 0.2032) (material "FR4") (epsilon_r 4.5) (loss_tangent 0.02)) + (layer "In1.Cu" (type "copper") (thickness 0.018)) + (layer "dielectric 2" (type "prepreg") (thickness 0.07 locked) (material "FR4") (epsilon_r 4.5) (loss_tangent 0.02)) + (layer "In2.Cu" (type "copper") (thickness 0.018)) + (layer "dielectric 3" (type "core") (thickness 0.05 locked) (material "Polyimide") (epsilon_r 3.2) (loss_tangent 0.004)) + (layer "In3.Cu" (type "copper") (thickness 0.018)) + (layer "dielectric 4" (type "prepreg") (thickness 0.07 locked) (material "FR4") (epsilon_r 4.5) (loss_tangent 0.02)) + (layer "In4.Cu" (type "copper") (thickness 0.018)) + (layer "dielectric 5" (type "core") (thickness 0.2032) (material "FR4") (epsilon_r 4.5) (loss_tangent 0.02)) + (layer "B.Cu" (type "copper") (thickness 0.035)) + (layer "B.Mask" (type "Bottom Solder Mask") (thickness 0.01)) + (layer "B.Paste" (type "Bottom Solder Paste")) + (layer "B.SilkS" (type "Bottom Silk Screen")) + (copper_finish "ENIG") + (dielectric_constraints no) + ) + (pad_to_mask_clearance 0.0254) + (solder_mask_min_width 0.1016) + (aux_axis_origin 100.25 130.5) + (pcbplotparams + (layerselection 0x0031cfc_ffffffff) + (disableapertmacros false) + (usegerberextensions false) + (usegerberattributes false) + (usegerberadvancedattributes false) + (creategerberjobfile false) + (svguseinch false) + (svgprecision 6) + (excludeedgelayer true) + (plotframeref false) + (viasonmask false) + (mode 1) + (useauxorigin false) + (hpglpennumber 1) + (hpglpenspeed 20) + (hpglpendiameter 15.000000) + (dxfpolygonmode true) + (dxfimperialunits true) + (dxfusepcbnewfont true) + (psnegative false) + (psa4output false) + (plotreference true) + (plotvalue true) + (plotinvisibletext false) + (sketchpadsonfab false) + (subtractmaskfromsilk false) + (outputformat 1) + (mirror false) + (drillshape 0) + (scaleselection 1) + (outputdirectory "Output/") + ) + ) + + (net 0 "") + + (gr_circle (center 110.113273 91.583453) (end 113.513273 91.583453) (layer "In3.Cu") (width 0.3048) (fill none) (tstamp 00000000-0000-0000-0000-00005dfcb650)) + (gr_arc (start 105.97 86.66) (mid 105.111125 87.181679) (end 104.14 87.44) (layer "In3.Cu") (width 0.3048) (tstamp 00000000-0000-0000-0000-00005dfcb65e)) + (gr_line (start 105.97 86.66) (end 107.92 88.97) (layer "In3.Cu") (width 0.3048) (tstamp 00000000-0000-0000-0000-00005dfcb663)) + (gr_arc (start 104.14 87.9) (mid 104.273377 87.544188) (end 104.6 87.35) (layer "In3.Cu") (width 0.3048) (tstamp 156b3179-207e-4cf3-a3fd-160922f18cdc)) + (gr_arc (start 105.54 86.96) (mid 105.981539 86.878363) (end 106.36 87.12) (layer "In3.Cu") (width 0.3048) (tstamp 1b4b5e0c-d4f2-4b34-81cc-46c2fba04f5a)) + (gr_arc (start 102.79 86.68) (mid 103.209353 86.959505) (end 103.39 87.43) (layer "In3.Cu") (width 0.3048) (tstamp 1ea9b0f4-f6e5-4aed-953a-3e325084f18a)) + (gr_arc (start 107.43 88.39) (mid 107.650719 88.926098) (end 107.45 89.47) (layer "In3.Cu") (width 0.3048) (tstamp 75c7ba0f-61c6-4ed8-9f33-6ecdbd2703d5)) + (gr_circle (center 103.75 84) (end 106.5 84) (layer "In3.Cu") (width 0.5) (fill none) (tstamp a24c46cc-0689-49a7-87aa-834a1d16b108)) + (gr_arc (start 108.48 88.6) (mid 107.921825 88.698479) (end 107.44 88.4) (layer "In3.Cu") (width 0.3048) (tstamp acb17fe9-ebb2-4bfa-807a-e49866929d05)) + (gr_arc (start 103.39 87.43) (mid 103.555181 87.019242) (end 103.96 86.84) (layer "In3.Cu") (width 0.3048) (tstamp d182c4ac-5947-42a9-a5d0-91b68f63cd4d)) + (gr_line (start 102.25 97.5) (end 105.25 97.5) (layer "B.SilkS") (width 0.2032) (tstamp 00000000-0000-0000-0000-00005d7dc0fe)) + (gr_arc (start 102.68934 98.93934) (mid 103.75 98.5) (end 104.81066 98.93934) (layer "B.SilkS") (width 0.12) (tstamp 00000000-0000-0000-0000-00005f02a3a4)) + (gr_arc (start 104.81066 101.06066) (mid 103.75 101.5) (end 102.68934 101.06066) (layer "B.SilkS") (width 0.12) (tstamp ef008297-a756-483d-a4b0-03d35aed5d7f)) + (gr_arc (start 100.999999 99.250001) (mid 101.310659 100) (end 100.999999 100.749999) (layer "F.SilkS") (width 0.12) (tstamp 150d217e-07c2-4835-b837-e6d5264e764e)) + (gr_arc (start 106.500001 100.749999) (mid 106.189341 100) (end 106.500001 99.250001) (layer "F.SilkS") (width 0.12) (tstamp 5ef30a05-7495-4587-8bd3-82804233a40e)) + (gr_rect (start 50 50) (end 250 150) (layer "Dwgs.User") (width 0.1) (fill none) (tstamp f22df2fd-8c9e-46ff-aa7a-b6dee838b5ca)) + (gr_line (start 98.75 108.5) (end 98.75 117.5) (layer "Eco1.User") (width 0.15) (tstamp 00000000-0000-0000-0000-00005d79ce29)) + (gr_line (start 113.25 109.5) (end 113.25 117.5) (layer "Eco1.User") (width 0.15) (tstamp 00000000-0000-0000-0000-00005d79d26f)) + (gr_line (start 101.25 102.5) (end 106.25 102.5) (layer "Eco1.User") (width 0.15) (tstamp 00000000-0000-0000-0000-00005d79d3b6)) + (gr_line (start 112.25 130.5) (end 112.25 122.5) (layer "Eco1.User") (width 0.15) (tstamp 00000000-0000-0000-0000-00005d7a6808)) + (gr_line (start 100.25 127.5) (end 100.25 130.5) (layer "Eco1.User") (width 0.15) (tstamp 00000000-0000-0000-0000-00005d7d5d55)) + (gr_line (start 112.25 122.5) (end 98.75 122.5) (layer "Eco1.User") (width 0.15) (tstamp 00000000-0000-0000-0000-00005d7d6672)) + (gr_line (start 108.75 118) (end 108.75 109) (layer "Eco1.User") (width 0.15) (tstamp 00ce6242-5980-4eae-a742-ffb279e555b8)) + (gr_arc (start 101.25 98) (mid 100.957107 98.707107) (end 100.25 99) (layer "Eco1.User") (width 0.15) (tstamp 068b4e01-cca6-4c03-8025-bcb3c277ab49)) + (gr_line (start 106.25 98) (end 106.25 93) (layer "Eco1.User") (width 0.15) (tstamp 06f078d1-5a50-4fb6-8b35-11f65b896989)) + (gr_arc (start 107.25 99) (mid 106.542893 98.707107) (end 106.25 98) (layer "Eco1.User") (width 0.15) (tstamp 097b00fe-f8db-4fac-b091-7c63392631e4)) + (gr_line (start 106.25 93) (end 101.25 93) (layer "Eco1.User") (width 0.15) (tstamp 41eb0fcf-f80f-48c2-8945-5fc340692969)) + (gr_arc (start 106.25 102) (mid 106.542893 101.292893) (end 107.25 101) (layer "Eco1.User") (width 0.15) (tstamp 44d555fa-fd30-4949-bff6-6c4aec2b6453)) + (gr_line (start 120.75 117.5) (end 120.75 109.5) (layer "Eco1.User") (width 0.15) (tstamp 450a0a2f-7373-469c-9d64-36c215576356)) + (gr_line (start 98.75 122.5) (end 98.75 126) (layer "Eco1.User") (width 0.15) (tstamp 4b23fe07-da95-4366-9293-85a839d99887)) + (gr_line (start 101.25 93) (end 101.25 98) (layer "Eco1.User") (width 0.15) (tstamp 4e6e95c4-d089-4308-808b-4cd14724cfaf)) + (gr_line (start 101.25 102.5) (end 101.25 102) (layer "Eco1.User") (width 0.15) (tstamp 5b05a06c-5789-4f89-88c3-17684d1dd25a)) + (gr_arc (start 98.75 117.5) (mid 99.103553 117.646447) (end 99.25 118) (layer "Eco1.User") (width 0.15) (tstamp 6255c1c5-21f6-475c-a0aa-112cbe266465)) + (gr_line (start 108.25 108.5) (end 98.75 108.5) (layer "Eco1.User") (width 0.15) (tstamp a275afba-a192-49bc-8de5-55af2bd9d5a5)) + (gr_line (start 98.75 126) (end 100.25 127.5) (layer "Eco1.User") (width 0.15) (tstamp a6cbd3fb-e8b8-4942-9268-c0620af12467)) + (gr_arc (start 107.25 99) (mid 108.25 100) (end 107.25 101) (layer "Eco1.User") (width 0.15) (tstamp aa1beff6-2a81-4e37-8033-9f254dfb1d9b)) + (gr_arc (start 108.75 109) (mid 108.396447 108.853553) (end 108.25 108.5) (layer "Eco1.User") (width 0.15) (tstamp ab6f9a96-030f-4feb-a0a1-7d69b995fcb9)) + (gr_line (start 106.25 102.5) (end 106.25 102) (layer "Eco1.User") (width 0.15) (tstamp af13700a-48f5-417f-99b6-1ff2b85aae22)) + (gr_arc (start 100.25 101) (mid 100.957107 101.292893) (end 101.25 102) (layer "Eco1.User") (width 0.15) (tstamp bc7769fa-1186-423c-bf1c-7c4e607ff467)) + (gr_line (start 120.75 109.5) (end 113.25 109.5) (layer "Eco1.User") (width 0.15) (tstamp cc8af275-a819-4aae-9231-a22dd469748c)) + (gr_line (start 99.25 118) (end 108.75 118) (layer "Eco1.User") (width 0.15) (tstamp dd67972a-d3bd-4cd1-865f-421356170083)) + (gr_line (start 100.25 130.5) (end 112.25 130.5) (layer "Eco1.User") (width 0.15) (tstamp e2db4e7f-db32-4494-8b98-b6537336794d)) + (gr_arc (start 100.25 101) (mid 99.25 100) (end 100.25 99) (layer "Eco1.User") (width 0.15) (tstamp f41c1143-536a-4bc6-9e13-d5b1ae6df2ce)) + (gr_line (start 113.25 117.5) (end 120.75 117.5) (layer "Eco1.User") (width 0.15) (tstamp fe92670a-e9c0-40b8-85c4-95b8fe635e67)) + (gr_circle (center 110.113273 91.583453) (end 113.524023 91.583453) (layer "Eco2.User") (width 0.6185) (fill none) (tstamp 00000000-0000-0000-0000-00005dfcb64a)) + (gr_circle (center 103.75 84) (end 106.45 84) (layer "Eco2.User") (width 0.8) (fill none) (tstamp 00000000-0000-0000-0000-00005dfcb64b)) + (gr_line (start 102.25 130.5) (end 100.25 130.5) (layer "Edge.Cuts") (width 0.05) (tstamp 00000000-0000-0000-0000-00005d7d8979)) + (gr_line (start 110.25 116) (end 111.75 116) (layer "Edge.Cuts") (width 0.05) (tstamp 00000000-0000-0000-0000-00005d7d995e)) + (gr_line (start 107.25 119.5) (end 107.25 121) (layer "Edge.Cuts") (width 0.05) (tstamp 00000000-0000-0000-0000-00005d7d9964)) + (gr_line (start 108.75 109) (end 108.75 109.5) (layer "Edge.Cuts") (width 0.05) (tstamp 00000000-0000-0000-0000-00005d7d996b)) + (gr_line (start 105.25 103.5) (end 105.25 107) (layer "Edge.Cuts") (width 0.05) (tstamp 00000000-0000-0000-0000-00005d7da6f3)) + (gr_line (start 102.25 103.5) (end 102.25 107) (layer "Edge.Cuts") (width 0.05) (tstamp 00000000-0000-0000-0000-00005d7da6f4)) + (gr_line (start 108.25 108.5) (end 106.75 108.5) (layer "Edge.Cuts") (width 0.05) (tstamp 00000000-0000-0000-0000-00005d7da6f6)) + (gr_line (start 100.75 108.5) (end 98.75 108.5) (layer "Edge.Cuts") (width 0.05) (tstamp 00000000-0000-0000-0000-00005d7da6f7)) + (gr_line (start 106.25 93) (end 106.25 98) (layer "Edge.Cuts") (width 0.05) (tstamp 00000000-0000-0000-0000-00005d7da6f8)) + (gr_line (start 108.75 117.5) (end 108.75 118) (layer "Edge.Cuts") (width 0.05) (tstamp 00000000-0000-0000-0000-00005d7fbadd)) + (gr_line (start 106.25 102) (end 106.25 102.5) (layer "Edge.Cuts") (width 0.05) (tstamp 00000000-0000-0000-0000-00005dfcb5bc)) + (gr_line (start 101.25 102) (end 101.25 102.5) (layer "Edge.Cuts") (width 0.05) (tstamp 00000000-0000-0000-0000-00005dfd110b)) + (gr_line (start 127.5 109.5) (end 120.75 109.5) (layer "Edge.Cuts") (width 0.05) (tstamp 00000000-0000-0000-0000-00005ff4e52b)) + (gr_line (start 126.5 110.5) (end 127.5 110.5) (layer "Edge.Cuts") (width 0.05) (tstamp 00000000-0000-0000-0000-00005ff4e576)) + (gr_line (start 127.5 111.5) (end 126.5 111.5) (layer "Edge.Cuts") (width 0.05) (tstamp 00000000-0000-0000-0000-00005ff4e578)) + (gr_line (start 104.75 135.25) (end 104.75 136.25) (layer "Edge.Cuts") (width 0.05) (tstamp 00000000-0000-0000-0000-00005ff4e592)) + (gr_line (start 103.75 135.25) (end 103.75 136.25) (layer "Edge.Cuts") (width 0.05) (tstamp 00000000-0000-0000-0000-00005ff4e593)) + (gr_line (start 106.25 130.5) (end 112.25 130.5) (layer "Edge.Cuts") (width 0.05) (tstamp 00000000-0000-0000-0000-00005ff4e5a1)) + (gr_arc (start 102.25 130.5) (mid 102.957107 130.792893) (end 103.25 131.5) (layer "Edge.Cuts") (width 0.05) (tstamp 0413221b-f286-4c17-944a-11e58b918898)) + (gr_arc (start 107.25 99) (mid 106.542893 98.707107) (end 106.25 98) (layer "Edge.Cuts") (width 0.05) (tstamp 04c77d11-0fb9-4430-bfb9-325c44ebd98a)) + (gr_arc (start 113.25 109.5) (mid 112.81066 110.56066) (end 111.75 111) (layer "Edge.Cuts") (width 0.05) (tstamp 08d343ca-437f-453b-a38e-6927a9a05b10)) + (gr_line (start 104.75 91.5) (end 104.75 88.13633) (layer "Edge.Cuts") (width 0.05) (tstamp 0cab9dd4-e445-4f55-9fd9-2ef5e8a17030)) + (gr_line (start 98.75 117.5) (end 98.75 108.5) (layer "Edge.Cuts") (width 0.05) (tstamp 0cefd65c-e91d-43ef-b20c-d5bdc3db68cc)) + (gr_arc (start 105.25 136.5) (mid 104.25 137.5) (end 103.25 136.5) (layer "Edge.Cuts") (width 0.05) (tstamp 115efaac-3fa1-49b3-a34b-a18378d43b62)) + (gr_arc (start 99.25 118) (mid 99.957107 118.292893) (end 100.25 119) (layer "Edge.Cuts") (width 0.05) (tstamp 16ec0ae4-9e19-4a8a-8742-c81ac79048b2)) + (gr_arc (start 120.75 113) (mid 121.042893 112.292893) (end 121.75 112) (layer "Edge.Cuts") (width 0.05) (tstamp 1a00498c-6240-4ca9-8973-d301fda75d9c)) + (gr_line (start 101.25 98) (end 101.25 93) (layer "Edge.Cuts") (width 0.05) (tstamp 2c99c515-0dc5-41ec-b27e-8c288e677565)) + (gr_arc (start 111.75 116) (mid 112.81066 116.43934) (end 113.25 117.5) (layer "Edge.Cuts") (width 0.05) (tstamp 32163c96-07b6-4b13-84e4-9d286ce0d050)) + (gr_line (start 98.75 126) (end 100.25 127.5) (layer "Edge.Cuts") (width 0.05) (tstamp 383705f8-42df-44d4-aee8-f082a85aa98e)) + (gr_arc (start 108.577148 88.195427) (mid 112.504437 94.433132) (end 107.043463 89.482341) (layer "Edge.Cuts") (width 0.05) (tstamp 38820f16-aedd-4eeb-a059-fa2f5ebc8a6c)) + (gr_arc (start 105.25 103.5) (mid 105.542893 102.792893) (end 106.25 102.5) (layer "Edge.Cuts") (width 0.05) (tstamp 39258c1a-6994-4172-86bc-aeebb54c0b68)) + (gr_line (start 108.75 122.5) (end 112.25 122.5) (layer "Edge.Cuts") (width 0.05) (tstamp 3b493561-5d8d-46fa-92ae-a772e7f28df0)) + (gr_arc (start 100.25 101) (mid 99.25 100) (end 100.25 99) (layer "Edge.Cuts") (width 0.05) (tstamp 3e23d871-567a-4c8c-9473-80c3435202e0)) + (gr_line (start 100.25 121) (end 100.25 119) (layer "Edge.Cuts") (width 0.05) (tstamp 3f919474-55c9-4fb4-aed7-bd525c79c853)) + (gr_arc (start 101.25 102.5) (mid 101.957107 102.792893) (end 102.25 103.5) (layer "Edge.Cuts") (width 0.05) (tstamp 4227d8de-fb35-4e0c-8d83-901bb5ed5def)) + (gr_arc (start 107.25 119.5) (mid 107.68934 118.43934) (end 108.75 118) (layer "Edge.Cuts") (width 0.05) (tstamp 49f6f203-da6d-4406-b218-381a6f350b78)) + (gr_arc (start 98.75 117.5) (mid 99.103553 117.646447) (end 99.25 118) (layer "Edge.Cuts") (width 0.05) (tstamp 4cc7baf3-6a2a-4282-8e5a-7161cc972cf3)) + (gr_line (start 120.75 117.5) (end 120.75 113) (layer "Edge.Cuts") (width 0.05) (tstamp 5220e529-25f1-4046-b2e5-2ee00d69dce7)) + (gr_circle (center 110.113273 91.583453) (end 113.214773 91.583453) (layer "Edge.Cuts") (width 0.05) (fill none) (tstamp 525dd9f9-2a07-4433-b5ab-1852a4cb3db4)) + (gr_arc (start 102.75 91.5) (mid 102.31066 92.56066) (end 101.25 93) (layer "Edge.Cuts") (width 0.05) (tstamp 5c79c072-da61-41d3-8306-9b5d4118778a)) + (gr_arc (start 127.5 110.5) (mid 128 111) (end 127.5 111.5) (layer "Edge.Cuts") (width 0.05) (tstamp 5df4ab9e-598d-480c-bd91-c6d07b9e5c64)) + (gr_arc (start 106.25 102) (mid 106.542893 101.292893) (end 107.25 101) (layer "Edge.Cuts") (width 0.05) (tstamp 5e74fce6-e6da-4ebd-82dd-dc8ea71bd429)) + (gr_arc (start 105.25 131.5) (mid 105.542893 130.792893) (end 106.25 130.5) (layer "Edge.Cuts") (width 0.05) (tstamp 65e96255-a9d6-4b7a-97f6-1267cffac03f)) + (gr_arc (start 102.36646 87.576736) (mid 102.6272 80.333047) (end 106.898949 86.188914) (layer "Edge.Cuts") (width 0.05) (tstamp 6988b516-2713-4cee-8d3b-4d1589efdc66)) + (gr_arc (start 106.931987 86.91705) (mid 106.792233 86.558574) (end 106.898949 86.188914) (layer "Edge.Cuts") (width 0.05) (tstamp 6cbd1862-baa9-44ed-b8b9-34031c026f86)) + (gr_line (start 105.13354 87.576736) (end 105.35885 87.48121) (layer "Edge.Cuts") (width 0.05) (tstamp 6e2ed2e3-ed34-4f08-b540-e67ca6ad5c9b)) + (gr_arc (start 102.36646 87.576736) (mid 102.644912 87.797122) (end 102.75 88.13633) (layer "Edge.Cuts") (width 0.05) (tstamp 70b08606-11a8-4f2b-b50b-1f738061bbbe)) + (gr_arc (start 104.75 136.25) (mid 104.25 136.75) (end 103.75 136.25) (layer "Edge.Cuts") (width 0.05) (tstamp 70e89009-8b94-48b7-956e-7748572b1e60)) + (gr_line (start 98.75 122.5) (end 98.75 126) (layer "Edge.Cuts") (width 0.05) (tstamp 712ff0a5-12a6-42c4-8dd0-474db622ec08)) + (gr_line (start 121.75 112) (end 127.5 112) (layer "Edge.Cuts") (width 0.05) (tstamp 82f39d1e-6eb2-4b3d-86a7-08e500c97db6)) + (gr_arc (start 108.577148 88.195427) (mid 108.196409 88.234043) (end 107.86976 88.034644) (layer "Edge.Cuts") (width 0.05) (tstamp 8c9c6994-5ed8-4336-92f0-3de1dd1b9a07)) + (gr_arc (start 103.75 135.25) (mid 104.25 134.75) (end 104.75 135.25) (layer "Edge.Cuts") (width 0.05) (tstamp 8cc6ff87-180f-47fe-83ff-492360f29e5c)) + (gr_arc (start 127.5 109.5) (mid 128.75 110.75) (end 127.5 112) (layer "Edge.Cuts") (width 0.05) (tstamp 8eb1df53-140e-49bc-b16b-2918c7cc9fde)) + (gr_arc (start 107.00796 88.75778) (mid 107.147612 89.114087) (end 107.043463 89.482341) (layer "Edge.Cuts") (width 0.05) (tstamp 924a7bfc-8594-4bb7-9e6b-a0c626e01e19)) + (gr_arc (start 101.25 98) (mid 100.957107 98.707107) (end 100.25 99) (layer "Edge.Cuts") (width 0.05) (tstamp 94a5b092-af2b-46ad-90b6-77a1bc2a5b72)) + (gr_line (start 105.25 131.5) (end 105.25 136.5) (layer "Edge.Cuts") (width 0.05) (tstamp 959d0233-8b1c-4c65-a8af-018046e7b72d)) + (gr_arc (start 100.25 101) (mid 100.957107 101.292893) (end 101.25 102) (layer "Edge.Cuts") (width 0.05) (tstamp 9b68089e-58c3-49a1-8755-4f1cc50bf105)) + (gr_line (start 103.25 131.5) (end 103.25 136.5) (layer "Edge.Cuts") (width 0.05) (tstamp 9d35e151-d95a-4e25-a220-d51a81540e7b)) + (gr_line (start 106.070187 87.640186) (end 107.00796 88.75778) (layer "Edge.Cuts") (width 0.05) (tstamp 9e0a799c-d9c3-4ff8-83f7-9e8e79944144)) + (gr_circle (center 103.75 84) (end 106.05 84) (layer "Edge.Cuts") (width 0.05) (fill none) (tstamp ac203636-ba8a-4eb4-bcc4-22b2e6cc6876)) + (gr_arc (start 107.25 99) (mid 108.25 100) (end 107.25 101) (layer "Edge.Cuts") (width 0.05) (tstamp af2fe208-329a-4ce8-b497-c15cb4bf16fc)) + (gr_line (start 107.86976 88.034644) (end 106.931987 86.91705) (layer "Edge.Cuts") (width 0.05) (tstamp b0b53c73-703a-4c3e-9f08-5571660d76e4)) + (gr_arc (start 108.75 122.5) (mid 107.68934 122.06066) (end 107.25 121) (layer "Edge.Cuts") (width 0.05) (tstamp ba2afd86-5df3-4007-b519-ae9819780948)) + (gr_line (start 112.25 122.5) (end 112.25 130.5) (layer "Edge.Cuts") (width 0.05) (tstamp c36182a4-7e80-480c-99e3-98665c45b9f2)) + (gr_arc (start 100.25 121) (mid 99.81066 122.06066) (end 98.75 122.5) (layer "Edge.Cuts") (width 0.05) (tstamp c363a9e9-b9f1-451d-93bf-ca5a160befaa)) + (gr_arc (start 108.75 117.5) (mid 109.18934 116.43934) (end 110.25 116) (layer "Edge.Cuts") (width 0.05) (tstamp c466a3fa-f545-461b-8990-bfd3fd680714)) + (gr_line (start 113.25 117.5) (end 120.75 117.5) (layer "Edge.Cuts") (width 0.05) (tstamp c50b18de-0b2a-40b2-abb9-17d97c9ad274)) + (gr_line (start 102.75 88.13633) (end 102.75 91.5) (layer "Edge.Cuts") (width 0.05) (tstamp c90a79c3-3d1a-498a-989c-9508c765e9d8)) + (gr_arc (start 106.25 93) (mid 105.18934 92.56066) (end 104.75 91.5) (layer "Edge.Cuts") (width 0.05) (tstamp ca7c9bbf-51f2-4eaf-97ae-e22204547846)) + (gr_arc (start 110.25 111) (mid 109.18934 110.56066) (end 108.75 109.5) (layer "Edge.Cuts") (width 0.05) (tstamp d6493fab-99ae-424f-9f23-eb1490077703)) + (gr_line (start 120.75 109.5) (end 113.25 109.5) (layer "Edge.Cuts") (width 0.05) (tstamp d85b6741-2895-4e3b-ba15-8f1a81020a36)) + (gr_arc (start 108.75 109) (mid 108.396447 108.853553) (end 108.25 108.5) (layer "Edge.Cuts") (width 0.05) (tstamp e3116027-a0a9-4b79-a9ce-aafa5311be3d)) + (gr_arc (start 105.35885 87.48121) (mid 105.741425 87.440304) (end 106.070187 87.640186) (layer "Edge.Cuts") (width 0.05) (tstamp e4f54159-d98e-4dd4-960b-a8ae43b9e726)) + (gr_arc (start 102.25 107) (mid 101.81066 108.06066) (end 100.75 108.5) (layer "Edge.Cuts") (width 0.05) (tstamp e72879a8-a8e1-4478-9726-641716805b9b)) + (gr_line (start 100.25 130.5) (end 100.25 127.5) (layer "Edge.Cuts") (width 0.05) (tstamp f1b0899c-240a-4af1-bf9a-50e3f649aff5)) + (gr_arc (start 126.5 111.5) (mid 126 111) (end 126.5 110.5) (layer "Edge.Cuts") (width 0.05) (tstamp f2c7c264-b5b9-475e-827b-97215a482d9d)) + (gr_arc (start 104.75 88.13633) (mid 104.855088 87.797122) (end 105.13354 87.576736) (layer "Edge.Cuts") (width 0.05) (tstamp f88e005e-0bee-4790-a2de-e4b9ae5a92a4)) + (gr_arc (start 106.75 108.5) (mid 105.68934 108.06066) (end 105.25 107) (layer "Edge.Cuts") (width 0.05) (tstamp fc20430e-9468-4435-a3aa-0207693fc8d0)) + (gr_line (start 110.25 111) (end 111.75 111) (layer "Edge.Cuts") (width 0.05) (tstamp fdb1170f-c79a-4edf-99e2-2685295d2ec2)) + (gr_text "ASDF" (at 114.71 71.86) (layer "Cmts.User") (tstamp 3680b951-6b60-4c4d-80db-8837881b17e3) + (effects (font (size 1.5 1.5) (thickness 0.2)) (justify left)) + ) + (gr_text "Diode pin numbering according to JEDEC, pin 1 = cathode\nUse F.Fab / B.Fab for pin 1 markings\n\nSpecial Layers:\n\nUser.Eco1 contains rigid section outline\nUser.Eco2 contains flex section bottom side polyimide cutouts\n" (at 132.25 120.5) (layer "Cmts.User") (tstamp 4d257a8a-414c-41a9-ba4c-419d27b29b74) + (effects (font (size 1.5 1.5) (thickness 0.2)) (justify left)) + ) + (gr_text "Internal note:\nLens flex section 1mm longer than theoretical\nlength, 0.5mm shorter than previous length" (at 61.25 89.5) (layer "Cmts.User") (tstamp 9e18b8cd-587d-4608-8fae-93a8543d5ab2) + (effects (font (size 1 1) (thickness 0.15)) (justify left)) + ) + + (group "" (id bceb3aba-1c0a-4d42-9439-ca6ddcf5fe1c) + (members + 0cab9dd4-e445-4f55-9fd9-2ef5e8a17030 + 38820f16-aedd-4eeb-a059-fa2f5ebc8a6c + 525dd9f9-2a07-4433-b5ab-1852a4cb3db4 + 6988b516-2713-4cee-8d3b-4d1589efdc66 + 6cbd1862-baa9-44ed-b8b9-34031c026f86 + 6e2ed2e3-ed34-4f08-b540-e67ca6ad5c9b + 70b08606-11a8-4f2b-b50b-1f738061bbbe + 8c9c6994-5ed8-4336-92f0-3de1dd1b9a07 + 924a7bfc-8594-4bb7-9e6b-a0c626e01e19 + 9e0a799c-d9c3-4ff8-83f7-9e8e79944144 + ac203636-ba8a-4eb4-bcc4-22b2e6cc6876 + b0b53c73-703a-4c3e-9f08-5571660d76e4 + c90a79c3-3d1a-498a-989c-9508c765e9d8 + e4f54159-d98e-4dd4-960b-a8ae43b9e726 + f88e005e-0bee-4790-a2de-e4b9ae5a92a4 + ) + ) +) diff --git a/tests/reference/6_0_8/circle_edge-report.txt b/tests/reference/6_0_8/circle_edge-report.txt new file mode 100644 index 00000000..6b171be9 --- /dev/null +++ b/tests/reference/6_0_8/circle_edge-report.txt @@ -0,0 +1,2 @@ +30.0x57.34 + diff --git a/tests/test_plot/test_misc.py b/tests/test_plot/test_misc.py index 6204302b..3ffa4552 100644 --- a/tests/test_plot/test_misc.py +++ b/tests/test_plot/test_misc.py @@ -1044,6 +1044,17 @@ def test_report_edge_1(test_dir): ctx.clean_up() +@pytest.mark.skipif(context.ki5(), reason="Example in KiCad 6 format") +def test_report_edge_2(test_dir): + """ Meassures the PCB size when using circles in the PCB edge #375 """ + prj = 'circle_edge' + ctx = context.TestContext(test_dir, prj, 'report_edge_1', POS_DIR) + ctx.run() + ctx.expect_out_file(prj+'-report.txt') + ctx.compare_txt(prj+'-report.txt') + ctx.clean_up() + + def test_board_view_1(test_dir): prj = 'glasgow' ctx = context.TestContext(test_dir, prj, 'boardview', POS_DIR)