← Back to team overview

kicad-developers team mailing list archive

Re: Handling SEGZONEs

 

Le 27/09/2018 à 22:37, Seth Hillbrand a écrit :
> 
> 
> Am Mi., 26. Sep. 2018 um 12:23 Uhr schrieb Wayne Stambaugh
> <stambaughw@xxxxxxxxx <mailto:stambaughw@xxxxxxxxx>>:
> 
>     On 9/26/2018 3:16 PM, Seth Hillbrand wrote:
>     > Hi Wayne-
>     >
>     > That will be more luck of the draw in your memory management. 
>     > connectivity_algo.h:643 gets the filled polygon list, which in the
>     case
>     > of SEGZONE is undefined.
>     >
>     > -Seth
> 
>     Why would a polygon list be created for a SEGZONE object?  JP, do you
>     have any thoughts on this?  As ugly as the old segment filling is, I
>     would prefer that we maintain accuracy.  If the user wants to delete the
>     segments and go with a polygon filled zone, that should be left up to
>     the user.
> 
> 
> Ping, JP.
> 
> Wayne-  We should not be creating a polygon list for the SEGZONE.  This
> is the root of the issue.  If we convert to plain segments, the board
> looks the same and there is no error.  I found a legacy command that
> clears the segments from a SEGZONE specifically.  This command does not
> exist in GAL.
> 
> I suppose the question comes down to how much legacy handling to we want
> to keep around.  Since users cannot create SEGZONEs, it may not make
> sense to maintain the objects and their associated handling complexity. 
> Convert to segment gives us a clean break there.
> 
> If we do want to maintain the actual SEGZONE object on the board, we
> should port the command to clear it over to GAL as well.
> 
> -Seth
> 
Hi Seth,

SEGZONE items were used in the early time of Pcbnew, before using
polygons for zones.

I am guessing there are now very few boards using these SEGZONE objects.

SEGZONE items are the filled part of a zone that was defined by a
outline, but for many reasons, this outline was not stored in the board
file.

Because SEGZONE items are only the filled sub-areas of a zone outline:
- They should not be taken in account in connectivity algo (No problem:
in the early time of Pcbnew they were not taken in account)
No need to convert them in segments: just ignore them in DRC and
connectivity.
When converted in segments, the net name of the filled areas is lost.
- they must be deleted when filling zones (this is the case now).

Now, how to manage these old objects, similar to filled areas inside a
zone outline:

1 - just discard them when loading a file: not the best.
2 - load them and ignore them in connectivity and DRC.
3 - try to convert them in a zone and remove the initial SEGZONE items.
Because the initial zone outline is not known, we cannot know this
outline. We just try to guess a shape.
For instance the convex hull of a group of SEGZONE segment end points
can be a good candidate for the outline and is easy to calculate.
(a given group has the same time stamp, and a net)

Until now, this is the option 2 that is in use.
The more basic fix is just ignore them in connectivity in the new
connectivity code.

-- 
Jean-Pierre CHARRAS


References