← Back to team overview

kicad-developers team mailing list archive

Re: more pythonic scripting API for pcbnew

 

A little experiment, with the suggested * mm / * inch notation.  

https://github.com/KiCad/kicad-python/pull/6/files [1]

Look specially at the tests (last files).

Feel free to comment over the code.

If we could default to mm (my preferred) or inches, we could
save a lot of code (specially to process by human brains
reading python) while retaining all the precision.


Best,
Miguel Ángel Ajo
[1] Note: 2 builds failed because I didn’t make the C++ “pcbnew” module for the tests.


On Sunday, 25 de January de 2015 at 02:56, Tomasz Wlostowski wrote:

> On 25.01.2015 02:50, Miguel Ángel Ajo wrote:
> >  
> > I was just testing that.
> >  
> > Python floats (in all architectures) are double, so the 52 bit fraction (11 bit exp) is always
> > going to hold more information that the 32bits wxPoint /wxSize can hold.
> >  
>  
>  
> Hi Miguel,
>  
> Sorry, I'm a C/C++ guy, so float defaults for me to 32 bits ;) Doubles
> look ok, although the decimal part will be anyway truncated on the way
> from Python to C++ (if we decide to keep the nm as default unit)
>  
> Cheers,
> T.
>  
>  



Follow ups

References