Commit 6ae1471e authored by charras's avatar charras

more about zones

parent 4539c8c4
......@@ -9,7 +9,7 @@ COMMON_GLOBL wxString g_BuildVersion
# include "config.h"
(wxT(KICAD_SVN_VERSION))
# else
(wxT("(20081114-unstable)")) /* main program version */
(wxT("(20081124-unstable)")) /* main program version */
# endif
#endif
;
......@@ -20,7 +20,7 @@ COMMON_GLOBL wxString g_BuildAboutVersion
# include "config.h"
(wxT(KICAD_ABOUT_VERSION))
# else
(wxT("(20081114-unstable)")) /* svn date & rev (normally overridden) */
(wxT("(20081124-unstable)")) /* svn date & rev (normally overridden) */
# endif
#endif
;
......
No preview for this file type
This diff is collapsed.
No preview for this file type
......@@ -2,8 +2,8 @@ msgid ""
msgstr ""
"Project-Id-Version: kicad\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2008-11-22 11:36+0100\n"
"PO-Revision-Date: 2008-11-22 11:37+0100\n"
"POT-Creation-Date: 2008-11-24 21:41+0100\n"
"PO-Revision-Date: 2008-11-24 21:44+0100\n"
"Last-Translator: \n"
"Language-Team: kicad team <jean-pierre.charras@ujf-grenoble.fr>\n"
"MIME-Version: 1.0\n"
......@@ -287,7 +287,7 @@ msgstr "dimension"
#: pcbnew/class_marker.cpp:133
#: pcbnew/class_text_mod.cpp:503
#: pcbnew/class_track.cpp:850
#: pcbnew/class_zone.cpp:789
#: pcbnew/class_zone.cpp:821
msgid "Type"
msgstr "Type"
......@@ -310,7 +310,7 @@ msgstr "Segment"
#: pcbnew/class_pcb_text.cpp:190
#: pcbnew/class_text_mod.cpp:516
#: pcbnew/class_track.cpp:907
#: pcbnew/class_zone.cpp:823
#: pcbnew/class_zone.cpp:855
msgid "Layer"
msgstr "Couche"
......@@ -511,12 +511,12 @@ msgid "Display"
msgstr "Affichage"
#: pcbnew/class_track.cpp:866
#: pcbnew/class_zone.cpp:811
#: pcbnew/class_zone.cpp:843
msgid "NetName"
msgstr "NetName"
#: pcbnew/class_track.cpp:871
#: pcbnew/class_zone.cpp:819
#: pcbnew/class_zone.cpp:851
msgid "NetCode"
msgstr "NetCode"
......@@ -528,27 +528,27 @@ msgstr "Standard"
msgid "Diam"
msgstr "Diam"
#: pcbnew/class_zone.cpp:814
#: pcbnew/class_zone.cpp:846
msgid "Non Copper Zone"
msgstr "Zone non Cuivre"
#: pcbnew/class_zone.cpp:827
#: pcbnew/class_zone.cpp:859
msgid "Corners"
msgstr "Sommets"
#: pcbnew/class_zone.cpp:833
#: pcbnew/class_zone.cpp:865
msgid "No Grid"
msgstr "Pas de Grille"
#: pcbnew/class_zone.cpp:834
#: pcbnew/class_zone.cpp:866
msgid "Fill Grid"
msgstr "Grille de Remplissage"
#: pcbnew/class_zone.cpp:839
#: pcbnew/class_zone.cpp:871
msgid "Hatch lines"
msgstr "Lignes de Hachure"
#: pcbnew/class_zone.cpp:845
#: pcbnew/class_zone.cpp:877
msgid "Corners in DrawList"
msgstr "Sommets en Liste de dessin"
......@@ -2085,7 +2085,7 @@ msgstr "Surbrillance des équipotentielles"
msgid "Local Ratsnest"
msgstr "Montrer le chevelu général"
#: pcbnew/edit.cpp:584
#: pcbnew/edit.cpp:585
msgid "Delete item"
msgstr "Suppression d'éléments"
......@@ -2702,7 +2702,7 @@ msgstr "Impossible de créer fichier "
msgid "File"
msgstr "Fichier"
#: pcbnew/plotgerb.cpp:841
#: pcbnew/plotgerb.cpp:865
#, c-format
msgid "unable to reopen file <%s>"
msgstr "Ne peut pas réouvrir fichier <%s>"
......@@ -3010,19 +3010,19 @@ msgstr " chargé"
msgid "Modules [%d items]"
msgstr "Modules [%d éléments]"
#: pcbnew/dialog_copper_zones.cpp:67
msgid "Zone clearance value:"
msgstr "Valeur isolation zone:"
#: pcbnew/dialog_copper_zones.cpp:70
msgid "Grid :"
msgstr "Grille:"
#: pcbnew/dialog_copper_zones.cpp:350
msgid ""
"Error :\n"
"you must choose a copper bridge value for thermal reliefs bigger than the min zone thickness"
msgstr ""
"Erreur :\n"
"vous devez choisir une valeur pour l'épaisseur de cuivre dans les freins thermiques plus grande que l'épaisseur de cuivre minimum des zones"
#: pcbnew/dialog_copper_zones.cpp:355
#: pcbnew/dialog_copper_zones.cpp:362
msgid "Error : you must choose a layer"
msgstr "Erreur. Vous devez choisir une couche"
#: pcbnew/dialog_copper_zones.cpp:367
#: pcbnew/dialog_copper_zones.cpp:374
msgid "Error : you must choose a net name"
msgstr "Erreur. Vous devez choisir une équipotentielle"
......@@ -4432,8 +4432,8 @@ msgid "No grid (For tests only!)"
msgstr "Pas de grille (pour tests)"
#: pcbnew/dialog_copper_zones_base.cpp:42
msgid "Grid Size for Filling:"
msgstr "Taille de Grille pour Remplissage:"
msgid "Grid Size for Filling"
msgstr "Taille de Grille pour Remplissage"
#: pcbnew/dialog_copper_zones_base.cpp:46
msgid "Include pads"
......@@ -4546,34 +4546,42 @@ msgstr ""
"Si désactivé, les surfaces remplies dans cette zone seront affichées comme des surfaces \"solides\"."
#: pcbnew/dialog_copper_zones_base.cpp:122
msgid "Zone clearance value (mm):"
msgstr "Valeur isolation zone (mm):"
msgid "Zone clearance value"
msgstr "Valeur isolation zone"
#: pcbnew/dialog_copper_zones_base.cpp:129
msgid "Zone min thickness value"
msgstr "Valeur épaisseur min pour zone"
#: pcbnew/dialog_copper_zones_base.cpp:134
msgid "Value of minimun thickness of filled areas"
msgstr "Valeur de l'épaisseur minimum des zones remplies"
#: pcbnew/dialog_copper_zones_base.cpp:133
#: pcbnew/dialog_copper_zones_base.cpp:142
msgid "Export to others zones"
msgstr "Exporter vers autres zones"
#: pcbnew/dialog_copper_zones_base.cpp:134
#: pcbnew/dialog_copper_zones_base.cpp:143
msgid "Export this zone setup to all others copper zones"
msgstr "Exporter ces options vers les autres zones de cuivre"
#: pcbnew/dialog_copper_zones_base.cpp:161
#: pcbnew/dialog_copper_zones_base.cpp:170
msgid "Nets Display Options:"
msgstr "Options d'Affichage des Nets"
#: pcbnew/dialog_copper_zones_base.cpp:163
#: pcbnew/dialog_copper_zones_base.cpp:172
msgid "Alphabetic"
msgstr "Alphabetique"
#: pcbnew/dialog_copper_zones_base.cpp:163
#: pcbnew/dialog_copper_zones_base.cpp:172
msgid "Advanced"
msgstr "Avancé"
#: pcbnew/dialog_copper_zones_base.cpp:165
#: pcbnew/dialog_copper_zones_base.cpp:174
msgid "Net sorting:"
msgstr "Tri des Equipotentielles:"
#: pcbnew/dialog_copper_zones_base.cpp:167
#: pcbnew/dialog_copper_zones_base.cpp:176
msgid ""
"Nets can be sorted:\n"
"By alphabetic order\n"
......@@ -4583,10 +4591,18 @@ msgstr ""
"Paur ordre alphabétique\n"
"Par nombre de pads dans les équipotentielles (avancé)"
#: pcbnew/dialog_copper_zones_base.cpp:171
#: pcbnew/dialog_copper_zones_base.cpp:180
msgid "Filter"
msgstr "Filtre"
#: pcbnew/dialog_copper_zones_base.cpp:185
msgid ""
"Pattern in advanced mode, to filter net names in list\n"
"Net names matching this pattern are not displayed"
msgstr ""
"Modèle en mode avancé, pour filtrer les noms de net en liste\n"
"Les noms de net correspondant à ce modèle ne sont pas listés"
#: pcbnew/globaleditpad.cpp:74
msgid "Edit Pads Global"
msgstr "Pads: Edition globale"
......@@ -10426,7 +10442,7 @@ msgstr "Afficher Modules Cmp"
msgid "Show Modules Cu"
msgstr "Afficher Modules Cu"
#: pcbnew/dialog_copper_zones_base.h:99
#: pcbnew/dialog_copper_zones_base.h:101
msgid "Fill Zones Options"
msgstr "Options de Remplissage de Zone"
......@@ -10750,6 +10766,10 @@ msgstr "Imprimer"
msgid "Create SVG file"
msgstr "Créer Fichier SVG"
#~ msgid "Grid :"
#~ msgstr "Grille:"
#~ msgid "Zone clearance value (mm):"
#~ msgstr "Valeur isolation zone (mm):"
#~ msgid "Comp layer"
#~ msgstr "Couche Cmp"
#~ msgid "New schematic sheet"
......
......@@ -42,7 +42,7 @@ dialog_copper_zone::dialog_copper_zone( WinEDA_PcbFrame* parent, ZONE_SETTING* z
m_Parent = parent;
m_Config = m_Parent->m_Parent->m_EDA_Config;
m_Zone_Setting = zone_setting;
m_NetSorting = 1; // 0 = alphabetic sort, 1 = pad count sort
m_NetSorting = 1; // 0 = alphabetic sort, 1 = pad count sort, and filtering net names
if( m_Config )
{
m_NetSorting = m_Config->Read( ZONE_NET_SORT_OPTION_KEY, 1l );
......@@ -315,10 +315,6 @@ bool dialog_copper_zone::AcceptOptions( bool aPromptForErrors, bool aUseExportab
case 4:
m_Zone_Setting->m_GridFillValue = 0;
#if 0 // I hope this feature works fine ( JP Charras)
DisplayInfo( this, wxT(
"You are using No grid for filling zones\nThis is currently in development and for tests only.\n Do not use for production" ) );
#endif
break;
}
......@@ -347,8 +343,13 @@ bool dialog_copper_zone::AcceptOptions( bool aPromptForErrors, bool aUseExportab
(long) m_Zone_Setting->m_ThermalReliefGapValue );
m_Config->Write(
ZONE_THERMAL_RELIEF_COPPER_WIDTH_STRING_KEY,
(long) m_Zone_Setting->
m_ThermalReliefCopperBridgeValue );
(long) m_Zone_Setting->m_ThermalReliefCopperBridgeValue );
if( m_Zone_Setting->m_ThermalReliefCopperBridgeValue <= m_Zone_Setting->m_ZoneMinThickness )
{
DisplayError( this, _( "Error :\nyou must choose a copper bridge value for thermal reliefs bigger than the min zone thickness" ) );
return false;
}
// If we use only exportable to others zones parameters, exit here:
if( aUseExportableSetupOnly )
......
......@@ -53,7 +53,7 @@ DialogPadPropertiesBase::DialogPadPropertiesBase( wxWindow* parent, wxWindowID i
wxString m_DrillShapeCtrlChoices[] = { _("Circle"), _("Oval") };
int m_DrillShapeCtrlNChoices = sizeof( m_DrillShapeCtrlChoices ) / sizeof( wxString );
m_DrillShapeCtrl = new wxRadioBox( this, ID_RADIOBOX_DRILL_SHAPE, _("Drill Shape:"), wxDefaultPosition, wxDefaultSize, m_DrillShapeCtrlNChoices, m_DrillShapeCtrlChoices, 1, wxRA_SPECIFY_COLS );
m_DrillShapeCtrl->SetSelection( 1 );
m_DrillShapeCtrl->SetSelection( 0 );
m_DrillShapeBoxSizer->Add( m_DrillShapeCtrl, 0, wxALL|wxEXPAND, 5 );
m_MainSizer->Add( m_DrillShapeBoxSizer, 1, wxBOTTOM, 5 );
......
......@@ -569,6 +569,7 @@ void WinEDA_PcbFrame::Process_Special_Functions( wxCommandEvent& event )
zone_container->m_FilledPolysList.clear();;
}
test_connexions( NULL );
Tst_Ratsnest( NULL, 0 ); // Recalculate the active ratsnest, i.e. the unconnected links */
GetScreen()->SetModify();
DrawPanel->Refresh();
break;
......
......@@ -856,7 +856,7 @@ int WinEDA_PcbFrame::Fill_Zone( wxDC* DC, ZONE_CONTAINER* zone_container, bool v
* Calculate the zone filling for the outline zone_container
* The zone outline is a frontier, and can be complex (with holes)
* The filling starts from starting points like pads, tracks.
* If exists the old filling is removed
* If exists, the old filling is removed
* @param DC = current Device Context
* @param zone_container = zone to fill
* @param verbose = true to show error messages
......@@ -873,11 +873,11 @@ int WinEDA_PcbFrame::Fill_Zone( wxDC* DC, ZONE_CONTAINER* zone_container, bool v
return -1;
}
/* Show the Net */
/* Shows the Net */
g_Zone_Default_Setting.m_NetcodeSelection = zone_container->GetNet();
if( g_HightLigt_Status && (g_HightLigth_NetCode != g_Zone_Default_Setting.m_NetcodeSelection) && DC )
{
Hight_Light( DC ); // Remove old hightlight selection
Hight_Light( DC ); // Remove old highlight selection
}
g_HightLigth_NetCode = g_Zone_Default_Setting.m_NetcodeSelection;
......@@ -956,7 +956,8 @@ int WinEDA_PcbFrame::Fill_All_Zones( wxDC* DC, bool verbose )
if( error_level && !verbose )
break;
}
m_Pcb->Test_Connections_To_Copper_Areas( );
test_connexions( NULL );
Tst_Ratsnest( NULL, 0 ); // Recalculate the active ratsnest, i.e. the unconnected links */
DrawPanel->Refresh( true );
return error_level;
}
......
......@@ -3,10 +3,21 @@
/*******************************************/
/* Functions to convert some board items to polygons
(pads, tracks ..)
This is used to calculate filled areas in copper zones.
Filled areas are the full zone area sub all polygons calculated from these items and the clearance area
*/
* (pads, tracks ..)
* This is used to calculate filled areas in copper zones.
* Filled areas are areas remainder of the full zone area after removed all polygons
* calculated from these items shapes and the clearance area
*
* Important note:
* Because filled areas must have a minimum thickness to match with Design rule, they are draw in 2 step:
* 1 - filled polygons are drawn
* 2 - polygon outlines are drawn with a "minimum thickness width" ( or with a minimum thickness pen )
* So outlines of filled polygons are calculated with the constraint they match with clearance,
* taking in account outlines have thickness
* This ensures:
* - areas meet the minimum thickness requirement.
* - shapes are smoothed.
*/
using namespace std;
......@@ -110,7 +121,7 @@ void ZONE_CONTAINER::AddClearanceAreasPolygonsToPolysList( BOARD* aPcb )
* so m_ZoneMinThickness is the min thickness of the filled zones areas
*/
CopyPolygonsFromFilledPolysListToBoolengine( booleng, GROUP_A );
booleng->SetCorrectionFactor( (double) -m_ZoneMinThickness/2 );
booleng->SetCorrectionFactor( (double) -m_ZoneMinThickness / 2 );
booleng->Do_Operation( BOOL_CORRECTION );
/* No copy the new outline in m_FilledPolysList */
......@@ -132,7 +143,7 @@ void ZONE_CONTAINER::AddClearanceAreasPolygonsToPolysList( BOARD* aPcb )
// Calculates the clearance value that meet DRC requirements
int clearance = max( m_ZoneClearance, g_DesignSettings.m_TrackClearence );
clearance += m_ZoneMinThickness/2;
clearance += m_ZoneMinThickness / 2;
/* Add holes (i.e. tracks and pads areas as polygons outlines)
......@@ -176,7 +187,7 @@ void ZONE_CONTAINER::AddClearanceAreasPolygonsToPolysList( BOARD* aPcb )
AddThermalReliefPadPolygon( booleng, *pad,
m_ThermalReliefGapValue,
m_ThermalReliefCopperBridgeValue,
m_ZoneMinThickness);
m_ZoneMinThickness );
break;
case PAD_IN_ZONE:
......@@ -416,24 +427,19 @@ void AddThermalReliefPadPolygon( Bool_Engine* aBooleng,
* aThermalGap must be increased by aMinThicknessValue/2 because drawing external outline
* with a thickness of aMinThicknessValue will reduce gap by aMinThicknessValue/2
*/
aThermalGap += aMinThicknessValue/2;
aThermalGap += aMinThicknessValue / 2;
/* Keep in account the polygon outline thickness
* copper_tickness must be decreased by aMinThicknessValue because drawing outlines
* with a thickness of aMinThicknessValue will increase thickness by aMinThicknessValue
* with a thickness of aMinThicknessValue will increase real thickness by aMinThicknessValue
*/
aCopperThickness -= aMinThicknessValue;
if ( aCopperThickness < 0 )
if( aCopperThickness < 0 )
aCopperThickness = 0;
copper_tickness.x = min( dx, aCopperThickness );
copper_tickness.y = min( dy, aCopperThickness );
if ( copper_tickness.x < aMinThicknessValue )
copper_tickness.x = 0;
if ( copper_tickness.y < aMinThicknessValue )
copper_tickness.y = 0;
switch( aPad.m_PadShape )
{
case PAD_CIRCLE: // Add 4 similar holes
......@@ -468,7 +474,8 @@ void AddThermalReliefPadPolygon( Bool_Engine* aBooleng,
// calculate the starting point of the outter arc
corner.x = copper_tickness.x / 2;
double dtmp = sqrt( ( (double) outer_radius * outer_radius ) - ( (double) corner.x * corner.x ) );
double dtmp =
sqrt( ( (double) outer_radius * outer_radius ) - ( (double) corner.x * corner.x ) );
corner.y = (int) dtmp;
RotatePoint( &corner, 90 );
......@@ -536,7 +543,7 @@ void AddThermalReliefPadPolygon( Bool_Engine* aBooleng,
{
EXCHG( dx, dy );
supp_angle = 900;
EXCHG( copper_tickness.x, copper_tickness.y);
EXCHG( copper_tickness.x, copper_tickness.y );
}
int deltasize = dx - dy; // = distance between shape position and the 2 demi-circle ends centre
// here we have dx > dy
......@@ -554,15 +561,15 @@ void AddThermalReliefPadPolygon( Bool_Engine* aBooleng,
{
corner.x = copper_tickness.x / 2;
corner.y =
(int) sqrt( ((double)outer_radius * outer_radius ) -
( (double)( corner.x - delta ) * ( corner.x - deltasize ) ) );
(int) sqrt( ( (double) outer_radius * outer_radius ) -
( (double) ( corner.x - delta ) * ( corner.x - deltasize ) ) );
corner.x -= deltasize;
/* creates an intermediate point, to have a > 90 deg angle
* between the side and the first segment of arc approximation
*/
wxPoint intpoint = corner;
intpoint.y -= aThermalGap/4;
intpoint.y -= aThermalGap / 4;
corners_buffer.push_back( intpoint + shape_offset );
RotatePoint( &corner, 90 );
}
......@@ -578,11 +585,14 @@ void AddThermalReliefPadPolygon( Bool_Engine* aBooleng,
wxPoint last_corner;
last_corner.y = copper_tickness.y / 2;
int px = outer_radius - (aThermalGap / 4);
last_corner.x = (int) sqrt( ( ( (double) px * px ) - (double) last_corner.y * last_corner.y ) );
last_corner.x =
(int) sqrt( ( ( (double) px * px ) - (double) last_corner.y * last_corner.y ) );
// Arc stop point calculation, the intersecting point of cutout arc and thermal spoke edge
corner_end.y = copper_tickness.y / 2;
corner_end.x = (int) sqrt( ( (double) outer_radius * outer_radius ) - ( (double) corner_end.y * corner_end.y ) );
corner_end.x =
(int) sqrt( ( (double) outer_radius *
outer_radius ) - ( (double) corner_end.y * corner_end.y ) );
RotatePoint( &corner_end, -90 );
// calculate intermediate arc points till limit is reached
......@@ -891,18 +901,21 @@ void AddTextBoxWithClearancePolygon( Bool_Engine* aBooleng,
/***********************************************************************************************************/
int ZONE_CONTAINER::CopyPolygonsFromFilledPolysListToBoolengine( Bool_Engine* aBoolengine, GroupType aGroup )
int ZONE_CONTAINER::CopyPolygonsFromFilledPolysListToBoolengine( Bool_Engine* aBoolengine,
GroupType aGroup )
/************************************************************************************************************/
/** Function CopyPolygonsFromFilledPolysListToBoolengine
* Copy (Add) polygons created by kbool (after Do_Operation) to m_FilledPolysList
* @param aBoolengine = kbool engine
* @param aGroup = group in kbool engine (GROUP_A or GROUP_B only)
* @return the corner count
*/
*/
{
unsigned corners_count = m_FilledPolysList.size();
int count = 0;
unsigned ic = 0;
if( aBoolengine->StartPolygonAdd( aGroup ) )
{
for( ; ic < corners_count; ic++ )
......@@ -919,16 +932,20 @@ int ZONE_CONTAINER::CopyPolygonsFromFilledPolysListToBoolengine( Bool_Engine* aB
return count;
}
/*****************************************************************************************/
int ZONE_CONTAINER::CopyPolygonsFromBoolengineToFilledPolysList( Bool_Engine* aBoolengine )
/*****************************************************************************************/
/** Function CopyPolygonsFromBoolengineToFilledPolysList
* Copy (Add) polygons created by kbool (after Do_Operation) to m_FilledPolysList
* @param aBoolengine = kbool engine
* @return the corner count
*/
*/
{
int count = 0;
while( aBoolengine->StartPolygonGet() )
{
CPolyPt corner( 0, 0, false );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment