Mail Archives: geda-user/2015/03/17/23:36:03
On Tue, 17 Mar 2015, Jason White wrote:
> On Tue, Mar 17, 2015 at 3:23 PM, Peter Stuge <peter AT stuge DOT se> wrote:
>> Jason White wrote:
>>>> Which elementary objects would you use instead
>>>
>>> (1) to contain graphical primitives
>>
>> Which are the primitives you have in mind?
>
> Only 5 primitives in conjunction with groups that posses attributes
> are needed to represent an entire PCB design.
> * Line
> * Arc
> * Polygon
> * Circle
> * Text
>
> Each primitive defines its coordinates and layer relative to the group
Coordinates, rotation and scale. Rotation and scale is needed for texts,
the rest could live with recalculated coords. However, once you add
rot+scale to one element, it's easier to add them to all.
An alternative which might be cleaner: rotation and scale (or a
transformation matrix) as a primitive that can have children. This also
means you could rotate a group as a whole. If you think it further, this
alternative suggests you don't store evencoordinates in the primitives,
because there's a transformation that can displace its children.
This idea is not new, a lot of vector-graphics libs/formats do this.
I am not 100% convinced the second alternative is better. I think when
implemented properly, both the first and the second represent a local
optimum. The risk with the first is its limited approach; the main risks
for PCB with the second might be:
- it encourages users and tools to nest endless amount of
transformations making the resulting PCB impossible to read/fix by
hand/text editor
- it is a burden to scripting: the fixed cost of doing any sort of script
that udnerstands the format increases drastcily, and if it has to
manipulate the actual coordinates of existing objects, it becomes real
hard
> I actually had started to collect my thoughts on this matter into a
> document. You can read more here if you'd like. Of course its
> unfinished, so the descriptions are a bit rough.
>
> * https://drive.google.com/file/d/0BwP0qhqyaTIIV2c1TnJYd2JvQms/view?usp=sharing
I might be too old-school for the modern world, but is it possible we do
this sort of writeups at services that work without web2.0 and kilobytes
of javascript? Preferrably something that works with wget and a plain old
text editor or at least yields a plain old html.
Regards,
Igor2
- Raw text -