← Back to team overview

kicad-developers team mailing list archive

Re: php_polygon.cpp's point_at_infinit3 & 4

 

jean-pierre charras wrote:
Dick H. a écrit :

Jean-Pierre,

1) Can you see where point_at_infinity4 is deleted?


No. deleteting point_at_infinity3 and point_at_infinity4 seems missing

2) Why create these infinity points on the heap rather than on the stack?


I don't know.

3) Have you done a quality check on this code?

4) Are you confident that this is code you want to use in Kicad?

The quality of it does not overly impress me.


All the code in kicad/polygon must be refined, tested and cleaned.
It must be seen as very unstable.
I am not sure to use it.
Only some pieces of this soft are usefull.
This is the reason of this separate directory.

Currently, I am working on the G.U.I to handle zones outlines.
So, to do it, I used existing libraries I found in freePCB, and some pieces of freePCB code, relative to polygon and outline calculation and handling. The 2 libraries php_polygon and GenericPolygonClipperLibrary are used "as this". The other files come from freePCB code and I changed the original code to compile with kicad, but this code is not yet cleaned.

php_polygon and GenericPolygonClipperLibrary (and polygon1 used in gpcb) come from internet (see links.txt). I found some other polygon libraries, but usually with no comments in sources... (hard to use without comments)

The reasons for the choice of using freePCB code are:
- The code has many comments (the are only few comments in gpcb code)
- The code is written in C++ and it is more easy to use with kicad.
- The zone handling in freePCB is very intuitive.

But gpcb seems have more powerfull algorithms for zone handling (gerber output, detection of non connected pads in zones...)
Therefore the gpcb code must also considered.

So the work is starting, but not finished....

Currently, this is mainly the G.U.I. relative to the zone outlines creation and edition which must be evaluated.


Jean-Pierre CHARRAS


OK. The features you are working on are important. I don't want to slow that down. But by explaining the status of these lower level components, as you now have, it should be helpful to others that might be in a position to offer some help.

In coding the specctra dsn file import export as I now am, there may be opportunities to push code I am developing into both places, zone and specctra.

Polyline and path data structures come to mind. We'd have to look at what it would take to move the algorithms you have found, to new cleaner data structures.

I am finding the STL vector class to be quite useful, more so than linked lists in most cases. And for large objects, the :boost::ptr_vector<> is superb since it can delete objects by pointer.

Dick







References