diff --git a/include/geometry/shape_arc.h b/include/geometry/shape_arc.h index db3bd3bd55..9de2b4166e 100644 --- a/include/geometry/shape_arc.h +++ b/include/geometry/shape_arc.h @@ -1,7 +1,7 @@ /* * This program source code file is part of KiCad, a free EDA CAD application. * - * Copyright (C) 2017 CERN + * Copyright (C) 2018 CERN * @author Tomasz Wlostowski * * This program is free software; you can redistribute it and/or @@ -36,8 +36,9 @@ public: SHAPE_ARC() : SHAPE( SH_ARC ), m_width( 0 ) {}; - SHAPE_ARC( const VECTOR2I& pc, const VECTOR2I& p0, double aCenterAngle, int aWidth = 0 ) : - SHAPE( SH_ARC ), m_p0( p0 ), m_pc( pc ), m_centralAngle( aCenterAngle ) + SHAPE_ARC( const VECTOR2I& aArcCenter, const VECTOR2I& aArcStartPoint, + double aCenterAngle, int aWidth = 0 ) : + SHAPE( SH_ARC ), m_p0( aArcStartPoint ), m_pc( aArcCenter ), m_centralAngle( aCenterAngle ) { }; diff --git a/pcbnew/router/pns_kicad_iface.cpp b/pcbnew/router/pns_kicad_iface.cpp index d97a5aefc1..f23cf3e488 100644 --- a/pcbnew/router/pns_kicad_iface.cpp +++ b/pcbnew/router/pns_kicad_iface.cpp @@ -849,7 +849,7 @@ bool PNS_KICAD_IFACE::syncGraphicalItem( PNS::NODE* aWorld, DRAWSEGMENT* aItem ) { case S_ARC: { - SHAPE_ARC arc( aItem->GetStart(), aItem->GetEnd(), (double) aItem->GetAngle() / 10.0 ); + SHAPE_ARC arc( aItem->GetCenter(), aItem->GetArcStart(), (double) aItem->GetAngle() / 10.0 ); auto l = arc.ConvertToPolyline(); @@ -861,6 +861,7 @@ bool PNS_KICAD_IFACE::syncGraphicalItem( PNS::NODE* aWorld, DRAWSEGMENT* aItem ) break; } + case S_SEGMENT: { SHAPE_SEGMENT *seg = new SHAPE_SEGMENT( aItem->GetStart(), aItem->GetEnd(), aItem->GetWidth() ); @@ -868,6 +869,23 @@ bool PNS_KICAD_IFACE::syncGraphicalItem( PNS::NODE* aWorld, DRAWSEGMENT* aItem ) break; } + + case S_CIRCLE: + { + // SHAPE_CIRCLE has no ConvertToPolyline() method, so use a 360.0 SHAPE_ARC + SHAPE_ARC circle( aItem->GetCenter(), aItem->GetEnd(), 360.0 ); + + auto l = circle.ConvertToPolyline(); + + for( int i = 0; i < l.SegmentCount(); i++ ) + { + SHAPE_SEGMENT *seg = new SHAPE_SEGMENT( l.CSegment(i), aItem->GetWidth() ); + segs.push_back( seg ); + } + + break; + } + default: break; }