H/V/45 constraint overridden to on after reopening

Bug #1847722 reported by Mishka
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
KiCad
Fix Released
Medium
Seth Hillbrand

Bug Description

Hi,

in KiCad 5.99, corners of a zone perimeter can be edited only for zones created during the work session. Saving kicad_pcb file and reopening it will result in inability to drag corners. At the same time edges can be dragged as usual.

Unfortunately, this happens only to my schematics created in KiCad 5.1. Layouts created in KiCad 5.99 seem work fine after pcbnew reopening. I've attached the sample kicad_pcb file which reproduces the issue.

How to reproduce:
1) open the zonetest.kicad_pcb file
2) try to drag zone corner; note it doesn't work
3) drawe a new zone
4) try to drag a corner of the new zone; note it does work this time
5) save the file; close pcbnew; open pcbnew and load the file
6) try to drag a corner of the new zone; note it does not work anymore

Version information:

Application: Pcbnew
Version: (5.99.0-216-gf0b29de6e), debug build
Libraries:
    wxWidgets 3.0.4
    libcurl/7.54.0 LibreSSL/2.0.20 zlib/1.2.11 nghttp2/1.24.0
Platform: Mac OS X (Darwin 17.7.0 x86_64), 64 bit, Little endian, wxMac
Build Info:
    Build date: Oct 9 2019 04:52:13
    wxWidgets: 3.0.4 (wchar_t,STL containers,compatible with 2.8)
    Boost: 1.69.0
    OpenCASCADE Community Edition: 6.9.1
    Curl: 7.54.0
    Compiler: Clang 9.0.0 with C++ ABI 1002

Build settings:
    KICAD_SCRIPTING=ON
    KICAD_SCRIPTING_MODULES=ON
    KICAD_SCRIPTING_PYTHON3=OFF
    KICAD_SCRIPTING_WXPYTHON=ON
    KICAD_SCRIPTING_WXPYTHON_PHOENIX=OFF
    KICAD_SCRIPTING_ACTION_MENU=ON
    BUILD_GITHUB_PLUGIN=ON
    KICAD_USE_OCE=ON
    KICAD_USE_OCC=OFF
    KICAD_SPICE=ON
    KICAD_STDLIB_DEBUG=OFF
    KICAD_STDLIB_LIGHT_DEBUG=OFF
    KICAD_SANITIZE=OFF

Tags: pcbnew
Revision history for this message
Mishka (mike-volokhov) wrote :
Revision history for this message
Mishka (mike-volokhov) wrote :

After playing with this a little bit more I've found that it's related to Constrain outline to H, V, and 45 degrees option. When disabled this option for ALL zones they became editable back again. If I enable this options for any one zone, save and reopen the file, the zone corners are not editable anymore.

Revision history for this message
Rene Poeschl (poeschlr) wrote :

What do you mean: is a zone without this enabled not editable if any other zone has it enabled? This would indeed be a bug.

If only the zone itself is not editable then it behaves as expected (moving any corner would result in the violation of this constrained, this is why it is not possible to do so). There is already a feature request for better feedback in this case.

Revision history for this message
Mishka (mike-volokhov) wrote : Re: [Bug 1847722] Re: Zone corners are not editable anymore

On Oct 11, 2019, at 11:54, Rene Poeschl <email address hidden> wrote:
>
> What do you mean: is a zone without this enabled not editable if any
> other zone has it enabled? This would indeed be a bug.
>
> If only the zone itself is not editable then it behaves as expected
> (moving any corner would result in the violation of this constrained,
> this is why it is not possible to do so). There is already a feature
> request for better feedback in this case.

Hi Rene,

this is how it works for me:

Case 1:

Create two zones. Open first zone properties and ENABLE the Constrain
outline to H, V and 45 degrees option. Open second zone properties and
DISABLE the option. Save file. Close pcbnew. Start the pcbnew again
and open the file. Observe both zones has the option ENABLED.

Case 2:

Create a zone. Set the Constrain outline to H, V and 45 degrees option.
Try to move zone corners - every corner can be freely moved as like
there are no constraints.

Case 2 variation:

Create a constrained zone. Open its properties, disable the constraint,
close properties, open properties again and enable the H, V, 45
constraint option. Try to move zone corners - every corner can be
freely moved as like there are no constraints.

To me it clearly looks like a bug.

--
Cheers,
Mishka

P.S. Going to open another ticket on creating constrained zones: the
very last point is always lost. I.e. you'll end up with one corner
less - triangle instead of square, square instead of pentagon and so on.

Changed in kicad:
milestone: none → 5.1.5
assignee: nobody → jean-pierre charras (jp-charras)
Revision history for this message
jean-pierre charras (jp-charras) wrote : Re: Zone corners are not editable anymore

Sorry, This is not the right bug for my answer.

Changed in kicad:
milestone: 5.1.5 → none
assignee: jean-pierre charras (jp-charras) → nobody
Revision history for this message
Wayne Stambaugh (stambaughw) wrote :

Should this bug be tagged as invalid?

Revision history for this message
Mishka (mike-volokhov) wrote :

@Wayne, I don't think so. The current behavior is definitely weird.

I think this happened due to the fact that the H/V/45 constraint is actually not a zone property, but a global option defined here:

    (kicad_pcb ... (setup ... (zone_45_only yes)))

However, the option checkbox is settable per zone, and it's allowed to have both constrained and non-constrained zones at the same time. However, if you save the file, close it, and reopen it, the global option will be assigned to all zones irrelevant to their prior settings. Moreover, the global option will be set to "yes" if there is at least one zone with the constraint enabled. I.e. you may create several zones, all unconstrained, but as soon as you enable the H/V/45 constraint option for only one of the zones, all other zones will be constrained on the next working session too.

Clearly looks like a bug.

Also, please note that despite the constraint you can still drag edges. This will result in actual violation of the constraint. This issue might be worth yet another report though.

Revision history for this message
Ian McInerney (imcinerney) wrote :

The main issue I see here is that the constrain to H/V/45 is being saved on a global basis for the board file instead of on a per-zone basis. Then Pcbnew uses that global setting for every zone when it opens the file the next time. That makes zones that were not originally made with the constraint active have the constraint (against the designer's wishes).

This is somewhat problematic to fix though, since it will require some rework of where the settings are included in the file format. I have targeted it to 5.1.5 tentatively, but it might have to be in 6.0 if we can't update the file for 5.1.5.

Changed in kicad:
importance: Undecided → Medium
milestone: none → 5.1.5
status: New → Triaged
summary: - Zone corners are not editable anymore
+ H/V/45 constraint overridden to on after reopening
Revision history for this message
KiCad Janitor (kicad-janitor) wrote :

Fixed in revision 8f1c1cf2984d88e334d4783b422a30a4ad7dfa2f
https://git.launchpad.net/kicad/patch/?id=8f1c1cf2984d88e334d4783b422a30a4ad7dfa2f

Changed in kicad:
status: Triaged → Fix Committed
assignee: nobody → Seth Hillbrand (sethh)
Changed in kicad:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.