Pcbnew: circles with diameter of zero

Bug #1392117 reported by Blair Bonnett
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
KiCad
Fix Released
Low
Blair Bonnett

Bug Description

In Pcbnew, it is possible to create circles and arcs with a diameter of zero by setting the 'Point X' and 'Point Y' properties to the same as the 'Center X' and 'Center Y' values (note that both have to be the same; one pair the same and one pair different results in a non-zero diameter).

If a zero diameter circle is the only object on the Edge.Cuts layer, this causes the board not to be rendered in the 3D viewer (on other layers, this doesn't seem to affect the viewer, and nor would I expect it to).

This may also cause problems for other processes e.g., the VRML exporter, as reported in bug 1371656.

I can work up a patch to the edit dialog to prevent this being allowed. Are there any other code branches which could result in a zero-diameter circle?

Tags: pcbnew
Revision history for this message
jean-pierre charras (jp-charras) wrote :

Please, send us a patch. Thanks.

Revision history for this message
Nick Østergaard (nickoe) wrote :

This bug is still valid in 5360, it is possible to edit a circle to get circles like:
(gr_circle (center 275 55) (end 275 55) (layer Cmts.User) (width 0.2))

Revision history for this message
Nick Østergaard (nickoe) wrote :

Also this goes for the arcs.

Revision history for this message
Nick Østergaard (nickoe) wrote :

And line segment.

Blair Bonnett (bcb)
Changed in kicad:
assignee: nobody → Blair Bonnett (blair-bonnett)
importance: Undecided → Low
status: New → Confirmed
Revision history for this message
Blair Bonnett (bcb) wrote :

Proposed patch attached. This adds a itemValuesOK() method to the dialog class which operates in the same manner as padValuesOK() in the pad properties dialog. It checks the radius of circles and arcs, the angle of arcs, the length of line segments, and the set thicknesses of the item.

As a bonus it also sets the title of the dialog based on the type of item being edited.

Tested against r5365 on Arch Linux with wxGTK 3.0.2.

Revision history for this message
Blair Bonnett (bcb) wrote :

Patch updated to also check graphic items in the module editor.

For consistency with the pcbnew dialog, I renamed m_item to m_Item in the module editor dialog.

Revision history for this message
Wayne Stambaugh (stambaughw) wrote : Re: [Bug 1392117] Re: Pcbnew: circles with diameter of zero

Please fix you coding policy formatting issues. I realize that some of
the original code is incorrectly formatted as well which may have cause
the confusion. When in doubt, consult the coding policy.

Your patch appears to fix the invalid arc, circle, and line issue when
editing them via the dialog box. Did you check to see if these errors
can occur when drawing arcs, circles, and lines in the pcb editor?

On 1/12/2015 9:50 PM, Blair Bonnett wrote:
> ** Patch added: "validate_graphic_item_properties_v2.patch"
> https://bugs.launchpad.net/kicad/+bug/1392117/+attachment/4296931/+files/validate_graphic_item_properties_v2.patch
>
> ** Patch removed: "validate_graphic_item_properties_v2.patch"
> https://bugs.launchpad.net/kicad/+bug/1392117/+attachment/4296930/+files/validate_graphic_item_properties_v2.patch
>

Revision history for this message
Blair Bonnett (bcb) wrote :

Sorry about the delay getting back to this.

I've run both dialogs (pcbnew and modedit) through uncrustify and incorporated most of its suggestions. In a couple of places (definition of the member variables, and alignment of the line-wrapped arguments in the constructor implementation) it is not happy with the alignment. I think the alignment in the patch looks better than what uncrustify suggests, and fits better with both the existing code and section 4.1.2 (column alignment) of the coding style guidelines. Let me know if this (or anything else in the patch) is incorrect.

I've had a play with both pcbnew and modedit and neither seems to let you draw zero-size items. At least, they don't appear in the saved files -- I assume this means they aren't created internally, but am not sure how to confirm this.

Attached patch applies cleanly against r5391.

Revision history for this message
Sourcerer (pg-futureware) wrote :

I sometimes had the problem that some component demanded to contain a circle that I don´t need, or that I want hidden. The only way to do it I found was to assign a diameter of 0, since there is no checkbox available to disable that circle. So I would suggest to generally allow 0 as a diameter and to simply skip the whole circle for displaying or vrml exporting when its diameter is 0.

Revision history for this message
Blair Bonnett (bcb) wrote :

What do you mean, demanded? Is this when creating a footprint or something else? To me, it sounds like a separate bug.

Revision history for this message
Wayne Stambaugh (stambaughw) wrote :

I committed your patch in the product branch version r5410. Thank you for your contribution to KiCad.

Changed in kicad:
status: Confirmed → Fix Committed
Jon Neal (reportingsjr)
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.