Re: [Kicad-developers] Latest info on copper zones using solid polygons without outline thickness.

2019-06-11 Thread Tomasz Wlostowski
On 09/06/2019 20:51, jp charras wrote:
> First, thanks Tom for your test.
> 
> But are the drawing issues (calculation time and memory overflow) fixed
> by this change?
> They were the main reason of this change.

Yes, the VBO out-of-memory issue is gone now. I haven't measured yet how
much memory we saved but it's ~50% at least (given 6 vertices per
outline segment). Also, the connectivity calculation time got ~30%
better (31 seconds for the old, 20 s for the new one). Great job JP!.

> * Unless bugs, plot functions are updated and are compatible with both
> zone filling algos.

OK, didn't check it.
> 
> * The file format keep trace of the zone filling algo that filled the
> zone (of course, because do not know how the zone was filled can create
> serious issues):
> the flag " (filled_areas_thickness no)" is added in the zone section
> when the fill algo is "do not use thick outline".
> It also ensure a "old" Pcbnew version cannot create broken Gerber files.

OK.
> 
> * The accessor to know the fill algo used to fill the zone is:
>  bool GetFilledPolysUseThickness() const
> that returns false for the new algo.

> 
> * I was not aware of the connectivity issue. Please, fix it.
> Thanks.
> 
Fixed, thanks for the hint. I'll push my changes later in the evening.

> * About the zone setup dialog:
> For me, the choice is temporary, until we are confident with the new algo.
> Usually, when a new option is added, the default choice is: keep the old
> behavior.
> It avoid many bug reports.
> However make the new algo the default could be the best way to test it...
> I am not thrilled by messages like "Use legacy ..." because only core
> developpers know the difference between "legacy" and "current" or "new"
> about algorithms.

OK, in this case I wouldn't use the term 'higher quality', it might be
misleading to many users and make them think the new algorithm is
somewhat inferior to the old one.

Tom


___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] Latest info on copper zones using solid polygons without outline thickness.

2019-06-10 Thread jp charras
Le 10/06/2019 à 03:40, lê văn lập a écrit :
> Dear all DEV !
> I am currently designing pcb using zuken's cr5000 software, I would like
> to contribute to kicad's development, this is gerber when exported from
> cr5000, they use line and arc to create copper zones, hopefully this
> will is a good idea for us
> 

Alas! If your are talking about painting zones by segments, like the
filled (painted) zones shown by your images, this is a very bad idea:

* This is inefficient because it can create *a lot* of segments when the
minimal thickness is low (solid polygons are much more efficient).

* This is prohibited by Gerber file format: see chapter 7.7 of the
current gerber file format specifications (freely available from Ucamco):
Here is what this doc say:

"Painted areas and pads are not suited for PCB fabrication. Sending
files with painted to a PCB fabricator is quite disrespectful."

* For these reasons, this feature was removed from Kicad code some time ago.

If cr5000 software uses only painted zones, this is really a bad idea.

Now adding thick arcs in zone outlines to replace rough arc
approximation for a better shape is an other problem:
It could be a really good idea.
However I am guessing this is not so easy to code.

-- 
Jean-Pierre CHARRAS

___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] Latest info on copper zones using solid polygons without outline thickness.

2019-06-09 Thread lê văn lập
Dear all DEV !
I am currently designing pcb using zuken's cr5000 software, I would like to
contribute to kicad's development, this is gerber when exported from
cr5000, they use line and arc to create copper zones, hopefully this will
is a good idea for us

Vào Th 2, 10 thg 6, 2019 vào lúc 01:51 jp charras 
đã viết:

> Le 09/06/2019 à 19:56, Tomasz Wlostowski a écrit :
> > On 05/06/2019 21:21, jp charras wrote:
> >
> >> It is on the master branch (just committed).
> >
> > Hi JP,
> >
> > I gave it a try with a bunch of designs. Here are my observations:
> > - The filled zones look correct on the super-complex board and the
> > number of unconnected nets is identical to the old algorithm.
> > - There's a serios issue: connectivity algo can generate false positives
> > (thinking zones are connected to tracks or other zones) because is still
> > assumes all zones have thick outlines (see CN_ZONE::ContainsPoint). Did
> > you foresee any means of indicating this in the file format? Should
> > Gerber/other exporters be changed accordingly?
> > - I would rephrase the board setup zone filling option choice - it's the
> > max approximation error that defines the drawing quality, not the fact
> > that zones are outlined with rounded segments. My choice for the option
> > would be a single option "Use legacy zone filling outline method", off
> > by default.
> > - @Wayne/Seth I agree with JP that the change to the zone filling
> > algorithm is not very intrusive (and I also trust Clipper's
> > inflate/erode algorithms - they're used in the current zone filler and
> > never failed us so far).
> >
> > I can fix the connectivity issue. Who's in for Gerber/other exporters
> > (if needed?)
> >
> > Cheers,
> > Tom
>
> First, thanks Tom for your test.
>
> But are the drawing issues (calculation time and memory overflow) fixed
> by this change?
> They were the main reason of this change.
>
> * Unless bugs, plot functions are updated and are compatible with both
> zone filling algos.
>
> * The file format keep trace of the zone filling algo that filled the
> zone (of course, because do not know how the zone was filled can create
> serious issues):
> the flag " (filled_areas_thickness no)" is added in the zone section
> when the fill algo is "do not use thick outline".
> It also ensure a "old" Pcbnew version cannot create broken Gerber files.
>
> * The accessor to know the fill algo used to fill the zone is:
>  bool GetFilledPolysUseThickness() const
> that returns false for the new algo.
>
> * I was not aware of the connectivity issue. Please, fix it.
> Thanks.
>
> * About the zone setup dialog:
> For me, the choice is temporary, until we are confident with the new algo.
> Usually, when a new option is added, the default choice is: keep the old
> behavior.
> It avoid many bug reports.
> However make the new algo the default could be the best way to test it...
> I am not thrilled by messages like "Use legacy ..." because only core
> developpers know the difference between "legacy" and "current" or "new"
> about algorithms.
> In fact, in my mind, the choice should be removed for the stable 6.0
> version: the user has no knowledge to choose the right option.
>
> --
> Jean-Pierre CHARRAS
>
> ___
> Mailing list: https://launchpad.net/~kicad-developers
> Post to : kicad-developers@lists.launchpad.net
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help   : https://help.launchpad.net/ListHelp
>


-- 
LÊ VĂN LẬP
---
Sđt: 01223992496
Email: levanlap2...@gmail.com
___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] Latest info on copper zones using solid polygons without outline thickness.

2019-06-09 Thread jp charras
Le 09/06/2019 à 19:56, Tomasz Wlostowski a écrit :
> On 05/06/2019 21:21, jp charras wrote:
> 
>> It is on the master branch (just committed).
> 
> Hi JP,
> 
> I gave it a try with a bunch of designs. Here are my observations:
> - The filled zones look correct on the super-complex board and the
> number of unconnected nets is identical to the old algorithm.
> - There's a serios issue: connectivity algo can generate false positives
> (thinking zones are connected to tracks or other zones) because is still
> assumes all zones have thick outlines (see CN_ZONE::ContainsPoint). Did
> you foresee any means of indicating this in the file format? Should
> Gerber/other exporters be changed accordingly?
> - I would rephrase the board setup zone filling option choice - it's the
> max approximation error that defines the drawing quality, not the fact
> that zones are outlined with rounded segments. My choice for the option
> would be a single option "Use legacy zone filling outline method", off
> by default.
> - @Wayne/Seth I agree with JP that the change to the zone filling
> algorithm is not very intrusive (and I also trust Clipper's
> inflate/erode algorithms - they're used in the current zone filler and
> never failed us so far).
> 
> I can fix the connectivity issue. Who's in for Gerber/other exporters
> (if needed?)
> 
> Cheers,
> Tom

First, thanks Tom for your test.

But are the drawing issues (calculation time and memory overflow) fixed
by this change?
They were the main reason of this change.

* Unless bugs, plot functions are updated and are compatible with both
zone filling algos.

* The file format keep trace of the zone filling algo that filled the
zone (of course, because do not know how the zone was filled can create
serious issues):
the flag " (filled_areas_thickness no)" is added in the zone section
when the fill algo is "do not use thick outline".
It also ensure a "old" Pcbnew version cannot create broken Gerber files.

* The accessor to know the fill algo used to fill the zone is:
 bool GetFilledPolysUseThickness() const
that returns false for the new algo.

* I was not aware of the connectivity issue. Please, fix it.
Thanks.

* About the zone setup dialog:
For me, the choice is temporary, until we are confident with the new algo.
Usually, when a new option is added, the default choice is: keep the old
behavior.
It avoid many bug reports.
However make the new algo the default could be the best way to test it...
I am not thrilled by messages like "Use legacy ..." because only core
developpers know the difference between "legacy" and "current" or "new"
about algorithms.
In fact, in my mind, the choice should be removed for the stable 6.0
version: the user has no knowledge to choose the right option.

-- 
Jean-Pierre CHARRAS

___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] Latest info on copper zones using solid polygons without outline thickness.

2019-06-09 Thread Tomasz Wlostowski
On 05/06/2019 21:21, jp charras wrote:

> It is on the master branch (just committed).

Hi JP,

I gave it a try with a bunch of designs. Here are my observations:
- The filled zones look correct on the super-complex board and the
number of unconnected nets is identical to the old algorithm.
- There's a serios issue: connectivity algo can generate false positives
(thinking zones are connected to tracks or other zones) because is still
assumes all zones have thick outlines (see CN_ZONE::ContainsPoint). Did
you foresee any means of indicating this in the file format? Should
Gerber/other exporters be changed accordingly?
- I would rephrase the board setup zone filling option choice - it's the
max approximation error that defines the drawing quality, not the fact
that zones are outlined with rounded segments. My choice for the option
would be a single option "Use legacy zone filling outline method", off
by default.
- @Wayne/Seth I agree with JP that the change to the zone filling
algorithm is not very intrusive (and I also trust Clipper's
inflate/erode algorithms - they're used in the current zone filler and
never failed us so far).

I can fix the connectivity issue. Who's in for Gerber/other exporters
(if needed?)

Cheers,
Tom




___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] Latest info on copper zones using solid polygons without outline thickness.

2019-06-05 Thread Seth Hillbrand

On 2019-06-05 14:33, jp charras wrote:

I just committed the final version of fill algo to build solid polygons
in zones:

The current algo creates slightly smaller polygons and draw/plot the
polygon outline with thick segments.
It gives a very good look but creates some issue:
- For very large boards, drawing outlines can be time consumming.
- When exporting copper zones, the exported polygons are smaller than
the actual shape.

The new algo creates filled polygons without thick outlines (therefore
having the right shape)

By default, the new algo is not enabled.

To enable it
- In "kicad_advanced" file config, add "ForceThickZones=0"
- In Pcbnew, "Board Setup/Design Rules", in "Option to fill polygons in
zones", select "No Outline"


Hi JP-

A few questions on this.

- Since this is a board-level setting, is there a reason to put the file 
format tag in each zone container?
- The 3d viewer is about 25% slower on reload time with this option on.  
Do you see this in your tests as well?
- Do we need to hard-code the inflate segments in computeRawFilledAreas 
at 16?


I'm also seeing some floating copper after enabling the option.  See 
attached image.


Best-
Seth___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] Latest info on copper zones using solid polygons without outline thickness.

2019-06-05 Thread jp charras
Le 05/06/2019 à 21:16, Tomasz Wlostowski a écrit :
> On 05/06/2019 20:33, jp charras wrote:
>> Could you test this version on your very large board, and said me if it
>> fixes the very long time calculation to redraw the board on OpenGL.
>> Thanks.
> 
> Sure, will do. Sorry that I didn't follow the whole discussion, where
> can I find the latest code?
> 
> Tom
> 

It is on the master branch (just committed).

-- 
Jean-Pierre CHARRAS

___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] Latest info on copper zones using solid polygons without outline thickness.

2019-06-05 Thread Tomasz Wlostowski
On 05/06/2019 20:33, jp charras wrote:
> Could you test this version on your very large board, and said me if it
> fixes the very long time calculation to redraw the board on OpenGL.
> Thanks.

Sure, will do. Sorry that I didn't follow the whole discussion, where
can I find the latest code?

Tom

___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp