← Back to team overview

kicad-developers team mailing list archive

Re: Possible hang in SHAPE_POLY_SET ::Fracture() (from Bug 1632648:] Filled zone crashes KiCad in Stable 4.0.4)

 

Le 12/10/2016 à 15:08, jp charras a écrit :
> Le 12/10/2016 à 14:53, Tomasz Wlostowski a écrit :
>> On 12.10.2016 14:49, jp charras wrote:
>>> Hi Orson and Tomasz,
>>>
>>> A few days ago I had a look at this issue, previously reported to the Kicad forum.
>>> Although it happens on 4.04 and not in the current version, I am thinking it is not fixed (it does
>>> not happen just because there are a few changes which generate a slightly different zone shape).
>>>
>>> It happens because in SHAPE_POLY_SET::fractureSingle( POLYGON& paths ) this code:
>>>
>>>     // keep connecting holes to the main outline, until there's no holes left...
>>>     while( num_unconnected > 0 )
>>>     {
>>> <skipped>
>>>         num_unconnected -= processEdge( edges, smallestX );
>>>     }
>>> hangs if processEdge returns 0.
>>>
>>> processEdge can return 0, and this is the case with the minimal board I attached.
>>>
>>> May I ask you to have a look into this suspicious code (I am not familiar with it)?
>>>
>>> Thanks.
>>>
>> Hi JP,
>>
>> Does the file outline created by 4.0.4 contain duplicate vertices?
>>
>> Tom
>>
> 
> I don't know (not really easy to say).
> 
> Have a look at (in zones_convert_brd_items_to_polygons_with_Boost.cpp, kicad 4.04), line 456:
>     fractured.Fracture();
> It does not use the fast mode, and therefore the polygons are made strictly simple before fracturing
> (unless I missed something).
> and it hangs.
> 
> If modified like this
>     fractured.Fracture( true );
> It uses the fast mode, and therefore the polygons are not made strictly simple before fracturing,
> but Fracture does not hang (perhaps just because the geometry has just changed a bit).
> 
> Note also the current code (in master) uses always the fast mode.
> 
> 

"Does the file outline created by 4.0.4 contain duplicate vertices?"

As I said, I don't know, but a corner could be common to 2 different polygons (I mean: a corner of a
polygon which could have the same coordinate as a corner of a second polygon) after making polygons
strictly simple.

-- 
Jean-Pierre CHARRAS


References