← Back to team overview

kicad-developers team mailing list archive

Re: Question about const SHAPE_LINE_CHAIN Outline() const

 

On 04.04.2016 14:15, Maciej Sumiński wrote:
> On 04/04/2016 01:39 PM, jp charras wrote:
>> Sorry if you already sent me a response to this "old" message (first posted on feb 05)
>> but I did not remember this response.

Hi Jean-Pierre,

If you mean this code in your patch:

SHAPE_RECT::Outline()

- rv.Append( m_p0 );
-        rv.Append( m_p0.x, m_p0.y + m_w );
-        rv.Append( m_p0.x + m_h, m_p0.y + m_w );
-        rv.Append( m_p0.x + m_h, m_p0.y );
+        rv.Append( m_p0.x, m_p0.y + m_h );
+        rv.Append( m_p0.x + m_w, m_p0.y + m_h );
+        rv.Append( m_p0.x + m_w, m_p0.y );

It's OK - there was indeed a bug.

Speaking of the pads patch - I didn't have the time to review the whole
pads patch yet. I like very much the rounded rectangle pads, but IMHO
allowing any arbitrary pad shape (including non-convex shapes) is not
the best way to go. I would rather think about enabling graphical
primitives on copper layers and define how they get their nets (e.g.
inherit them from a given pad of the "parent" footprint). This would not
only deal with custom pad shapes but also enable things like parametric
microwave components.

I'll post a proposal & a review of the patch as soon as I can.

Tom

>>
>> It is annoying for the rounded rect pads which use this method.
>> (I currently use a fixed (modified) version in my patch)
>>
>> I can easily fix it, but I do not want to create bugs in pns router.
>>
>> Thanks.
>>
>>> Orson, Tomasz,
>>>
>>> I am thinking there is a bug in geometry/shape_rect.h:
>>> In
>>> const SHAPE_LINE_CHAIN Outline() const
>>>
>>> m_h and m_w look like they are swapped in calculations, and the outline
>>> is incorrect (assuming m_w is the X axis rect size (width), and m_h is
>>> the Y axis rect size (height)).
>>>
>>> Can you have a look at this?
>>>
>>> Thanks
> 
> Hi Jean-Pierre,
> 
> Just by looking at the code, I am quite positive that you are right in
> this matter, but Tom has to confirm it. He is absent today, so hopefully
> he will respond tomorrow.
> 
> Regards,
> Orson
> 



Follow ups

References