← Back to team overview

kicad-developers team mailing list archive

Re: Plotting/exporting in nanometres, take 2


On 04/30/2012 05:39 AM, Lorenzo Marcantonio wrote:
> I looked in depth in the affected code. Some refactoring, too.
> What's changed:
> - Public functions with CamelCase names (I liked more the standard_library
>   ones, but we just need to decide once);
> - The dummy PlotImage (drawing only a rectangle) was moved to the base since
>   everyone except the Postscript engine uses the same implementation;
> - The userToDevice stuff uses return by value;
> - Comment formatting changed, most duplicate comment removed and put in the
>   header;
> - Used the DEG2RAD / RAD2DEG macros instead of explicitly computing 180.0/M_PI
>   and so on
> - Completely reworked the marker code (I hit the 13 symbol limit more than one
>   time...); Now it's bitmask based and there are 58 symbols defined (and a
>   class constant to define this limit);
> - To discuss: something a construction like this was used in the routines:
>     static std::vector< wxPoint > corner_list;                                             
>     corner_list.clear();
>   I suppose that would be to avoid reconstructing a vector at each call?
>   However, the clear() simply junk the memory and forces reallocation so I
>   don't see a gain in doing this... if it was a fixed vector and the elements
>   were simply reassigned it could be an idea; for now I simply removed the
>   static and the clear call (i.e. a fresh vector for each call);
> - Tried to give a better name to some scaling factor (for example in the
>   worksheet plotting code I renamed conv_unit to iusPerMil);
> There still the plot width adjustment which I don't like... OTOH I've seen the
> polyline code used for the 'filled circle' in the DXF engine: I think its a
> clever solution. Wide tracks could be generated with the sketched oval code...
> The issue is that DXF has no under/over relationship between primitives (and
> neither between layers; a DXF layer doesn't work like a layer in gimp or
> photoshop). In the newer acad this was fixed with scripts and/or commands which
> change the internal display list (handle renumbering maybe? the newer DXF have
> a DRAWORDER command and the SORTENTSTABLE and it's specified that the entities
> are drawn in handle order otherwise) but AFAIK there is no way in a 'classic'
> DXF (i.e. R13 or R14) to say 'this entity has to go over that one'.
> Another thing is that seems that nothing else but acad handles polyline width :(
> I also toyed with text export as DXF entities with mixed results: importing
> into acad gives good results (probably because I'm using a very similar ISO
> font), qcad/librecad instead get the alignment wrong (maybe is a qcad issue,
> and it uses another font, anyway). If someone is interested I can finish this
> (it would be an option for the DXF plotter, like "export text as text
> entities"). Putting references/fields on other layers would be probably a lot
> more useful. Just tell me what you think about it.

The PS plots could benefit from an option to export text also, which I would be inclined
to use probably on on schematics, and love to use it there.  I use a script to convert a
bunch of *.ps files all into one big PDF file.

makepdf.sh ----------------------------------------------------------

ps2pdf -sPAPERSIZE=11x17 @ps2pdf.cmd project.pdf

ps2pdf.cmd ----------------------------------------------------------

-f ks8695px.ps ks8695px-blockdiagram.sch.ps ks8695px-cpu.sch.ps \
ks8695px-fpga.sch.ps ks8695px-ethernet.sch.ps ks8695px-ethernet.sch-poe.sch.ps \
ks8695px-fiber.sch.ps ks8695px-flash.sch.ps ks8695px-jtag_reset.sch.ps \
ks8695px-pci.sch.ps ks8695px-power.sch.ps ks8695px-cpu_power.sch.ps \
ks8695px-rtc.sch.ps ks8695px-sdram.sch.ps ks8695px-serial.sch.ps \
ks8695px-straps.sch.ps ks8695px-cfcard.sch.ps ks8695px-serial.sch-Port4.ps

I am not mistaken, this would make it possible to search within the PDF file for strings then.


Thank you very much for this very large, high quality body of work Lorenzo.


Follow ups