kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #41548
[PATCH] Add support for hatched zones in eagle import
-
To:
KiCad Developers <kicad-developers@xxxxxxxxxxxxxxxxxxx>
-
From:
Thomas Pointhuber <thomas.pointhuber@xxxxxx>
-
Date:
Fri, 12 Jul 2019 20:23:31 +0200
-
Autocrypt:
addr=thomas.pointhuber@xxxxxx; prefer-encrypt=mutual; keydata= mQINBFKxhfoBEADDCVK/vsBRi6BnOVSNa+2+xDQt+rBZt7D7BiTm6vaH/NYh+MFyujViIwIt dducp1y09Bkheqfy1tZVBznAC9L/+scePboOeTRTOMtghp041RXC6K7B4J3RMO0++9XdgDlC KLkNhpyPhb2uKVtGBzZjAPyV9udScv5AnQGrPvE1fIs7CreUPj+sSnRYb0sp5qZRaSpXSmKU NyTFEQtuaR1RXl0Dekj4BfXOr+RBdy8oewvGL64uJYd1ddsJ+uKLURbAZCd4n76g/7y1M+T+ Z0fsO7JT8HPA/4O9FrYHEl6dQTgCos3HsWqqP0xHzW9eR/xTXtNGJ8NSMO11Fla6U27Fb6os XFutSczwkoF3bkhLufodg1y9z+MZ3G5hBidYKRJMxFBLcKqtmcgwfSFI9IP50XH0RY1aOLXJ YsSO/1U+h5LHIYWirLvy6UvWdPD/+cSZgG6JxrHnd/gz0YxzNy8RNo9eGZx34+UTVw6OlKfP CnHvT56Dd9ntRxZ+okKvxSE2/Lc97/xrQj/L1Lgqo6QeHRRmn0V7tAGQR5iYTTVzitjnwGxm St8W4rUJRGdOhpig4r5vy8tZvZ9sJlNkQ2ah1iVTCV1+YBivuKi9EtMCEIoks9AfAPs9iFgl ftmT+5GKq5AA6QuXH9wwlgzJZKQi1UeB4i8RxKnN0De1tINesQARAQABtCxUaG9tYXMgUG9p bnRodWJlciA8dGhvbWFzLnBvaW50aHViZXJAZ214LmF0PokCVAQTAQgAPgIbIwULCQgHAgYV CAkKCwIEFgIDAQIeAQIXgBYhBFeMngIV9HTw3olSRscJ2HTtryVWBQJb8U0eB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ZfNswWMX3yxKFcPW dYhw9pBfZ9Q=
-
Openpgp:
preference=signencrypt
-
User-agent:
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.1
Hi,
I made a small patch to import hatched zones from eagle.
In this patch I removed the call to ```SetHatch``` which didn't seem to
do anything, and only was used when p.spacing was defined. Can someone
tell me if this was OK? Did not noticed any changes in behavior.
Regards, Thomas
From 5df6e279c635a888a1087a11f0d24d94f3333b64 Mon Sep 17 00:00:00 2001
From: Thomas Pointhuber <thomas.pointhuber@xxxxxx>
Date: Fri, 12 Jul 2019 20:11:21 +0200
Subject: [PATCH] Add support for hatched zones in eagle import
---
pcbnew/eagle_plugin.cpp | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/pcbnew/eagle_plugin.cpp b/pcbnew/eagle_plugin.cpp
index 55b596a51..871b90a6a 100644
--- a/pcbnew/eagle_plugin.cpp
+++ b/pcbnew/eagle_plugin.cpp
@@ -1199,12 +1199,15 @@ ZONE_CONTAINER* EAGLE_PLUGIN::loadPolygon( wxXmlNode* aPolyNode )
zone->SetDoNotAllowCopperPour( true );
zone->SetHatchStyle( ZONE_CONTAINER::NO_HATCH );
}
+ else if( p.pour == EPOLYGON::HATCH )
+ {
+ int spacing = p.spacing ? p.spacing->ToPcbUnits() : 50 * IU_PER_MILS;
- // if spacing is set the zone should be hatched
- // However, use the default hatch step, p.spacing value has no meaning for KiCad
- // TODO: see if this parameter is related to a grid fill option.
- if( p.spacing )
- zone->SetHatch( ZONE_CONTAINER::DIAGONAL_EDGE, zone->GetDefaultHatchPitch(), true );
+ zone->SetFillMode( ZFM_HATCH_PATTERN );
+ zone->SetHatchFillTypeThickness( p.width.ToPcbUnits() );
+ zone->SetHatchFillTypeGap( spacing - p.width.ToPcbUnits() );
+ zone->SetHatchFillTypeOrientation( 0 );
+ }
// We divide the thickness by half because we are tracing _inside_ the zone outline
// This means the radius of curvature will be twice the size for an equivalent EAGLE zone
--
2.22.0
Attachment:
signature.asc
Description: OpenPGP digital signature