← Back to team overview

kicad-developers team mailing list archive

Re: New Pcbnew file format.

 




>----- Original Message -----
>From: Wayne Stambaugh <stambaughw@xxxxxxxxxxx>
>To: kicad-developers@xxxxxxxxxxxxxxxxxxx
>Cc: 
>Sent: Friday, April 13, 2012 4:53 AM
>Subject: Re: [Kicad-developers] New Pcbnew file format.
>
[snip]
>>      4) What are the two (at) tags in module_text for? why not only 1
>>               Is one a position relative to the module and one a position relative to
>> the board?
>
>Good question.  It appears that TEXTE_MODULE::m_Pos0 which is relative
>to the anchor position of the module is the only position saved in the
>current format and EDA_TEXT::m_Pos is the absolute position on the board
>which I'm guessing is determined from the position of the module.  I'm
>not sure why it was done this way.  Is there any reason not to dump
>TEXTE_MODULE::m_Pos0 and just use EDA_TEXT::m_Pos?
>
>>>      5) Why does Modules have a different text tag than the pcb itself?  Why not just
>>> have a single text tag which can be placed anywhere?
>
>I agree.  Any text definition within a module grouping obviously is an
>TEXTE_MODULE object and a text definition anywhere else is a TEXTE_PCB
>object.
>
[snip]

I would think that the module has its own text because that is the easiest way to associate the text with a particular module and to manipulate the file (delete part, rotate part). If you make all PCB text equal, you will lose the association with the part.  Consider a module placed at (X,Y).  The text would be placed at (X+dX, Y+dY); if you rotate or move the module it is trivial to calculate the new (correct) position of the text. However, if the text has global coordinates then you need to perform many unnecessary operations - at the least you will need to subtract the offset (X,Y) and determine if there were any rotations previously applied.

- Cirilo


References