Loading common/CMakeLists.txt +1 −1 Original line number Diff line number Diff line Loading @@ -163,6 +163,7 @@ set( COMMON_SRCS config_params.cpp confirm.cpp copy_to_clipboard.cpp convert_basic_shapes_to_polygon.cpp dialog_shim.cpp displlst.cpp draw_frame.cpp Loading Loading @@ -247,7 +248,6 @@ set( PCB_COMMON_SRCS base_screen.cpp eda_text.cpp class_page_info.cpp convert_basic_shapes_to_polygon.cpp pcbcommon.cpp footprint_info.cpp ../pcbnew/basepcbframe.cpp Loading common/common_plotDXF_functions.cpp +85 −14 Original line number Diff line number Diff line Loading @@ -11,6 +11,7 @@ #include <plot_common.h> #include <macros.h> #include <kicad_string.h> #include <convert_basic_shapes_to_polygon.h> /** * Oblique angle for DXF native text Loading Loading @@ -319,25 +320,28 @@ void DXF_PLOTTER::Circle( const wxPoint& centre, int diameter, FILL_T fill, int /** * DXF polygon: doesn't fill it but at least it close the filled ones * DXF does not know thick outline. * It does not know thhick segments, therefore filled polygons with thick outline * are converted to inflated polygon by aWidth/2 */ #include "clipper.hpp" void DXF_PLOTTER::PlotPoly( const std::vector< wxPoint >& aCornerList, FILL_T aFill, int aWidth) { if( aCornerList.size() <= 1 ) return; unsigned last = aCornerList.size() - 1; // Plot outlines with lines (thickness = 0) to define the polygon if( aWidth == 0 || aFill ) if( aWidth <= 0 ) { MoveTo( aCornerList[0] ); for( unsigned ii = 1; ii < aCornerList.size(); ii++ ) LineTo( aCornerList[ii] ); } // Close polygon if 'fill' requested unsigned last = aCornerList.size() - 1; if( aFill ) { if( aCornerList[last] != aCornerList[0] ) Loading @@ -346,8 +350,13 @@ void DXF_PLOTTER::PlotPoly( const std::vector< wxPoint >& aCornerList, PenFinish(); // if the polygon outline has thickness, plot outlines with thick segments if( aWidth > 0 ) return; } // if the polygon outline has thickness, and is not filled // (i.e. is a polyline) plot outlines with thick segments if( aWidth > 0 && !aFill ) { MoveTo( aCornerList[0] ); Loading @@ -355,10 +364,72 @@ void DXF_PLOTTER::PlotPoly( const std::vector< wxPoint >& aCornerList, ThickSegment( aCornerList[ii-1], aCornerList[ii], aWidth, FILLED ); if( aCornerList[last] != aCornerList[0] ) ThickSegment( aCornerList[last], aCornerList[0], aWidth, FILLED ); return; } // The polygon outline has thickness, and is filled // Build and plot the polygon which contains the initial // polygon and its thick outline CPOLYGONS_LIST bufferOutline; CPOLYGONS_LIST bufferPolybase; const int circleToSegmentsCount = 16; // enter outline as polygon: for( unsigned ii = 1; ii < aCornerList.size(); ii++ ) { TransformRoundedEndsSegmentToPolygon( bufferOutline, aCornerList[ii-1], aCornerList[ii], circleToSegmentsCount, aWidth ); } // enter the initial polygon: for( unsigned ii = 0; ii < aCornerList.size(); ii++ ) { CPolyPt polypoint( aCornerList[ii].x, aCornerList[ii].y ); bufferPolybase.Append( polypoint ); } bufferPolybase.CloseLastContour(); // Merge polygons to build the polygon which contains the initial // polygon and its thick outline KI_POLYGON_SET polysBase; // Store the main outline and the final outline KI_POLYGON_SET polysOutline; // Store the thick segments to draw the outline bufferPolybase.ExportTo( polysBase ); bufferOutline.ExportTo( polysOutline ); polysBase += polysOutline; // create the outline which contains thick outline // We should have only one polygon in list, now. wxASSERT( polysBase.size() == 1 ); if( polysBase.size() < 1 ) // should not happen return; KI_POLYGON poly = polysBase[0]; // Expected only one polygon here if( poly.size() < 2 ) // should not happen return; // Now, output the final polygon to DXF file: last = poly.size() - 1; KI_POLY_POINT point = *(poly.begin()); wxPoint startPoint( point.x(), point.y() ); MoveTo( startPoint ); for( unsigned ii = 1; ii < poly.size(); ii++ ) { point = *( poly.begin() + ii ); LineTo( wxPoint( point.x(), point.y() ) ); } // Close polygon, if needed point = *(poly.begin() + last); wxPoint endPoint( point.x(), point.y() ); if( endPoint != startPoint ) LineTo( startPoint ); PenFinish(); } Loading common/common_plotGERBER_functions.cpp +15 −8 Original line number Diff line number Diff line Loading @@ -325,25 +325,32 @@ void GERBER_PLOTTER::PlotPoly( const std::vector< wxPoint >& aCornerList, if( aCornerList.size() <= 1 ) return; // Gerber format does not know filled polygons with thick outline // Thereore, to plot a filled polygon with outline having a thickness, // one should plot outline as thick segments SetCurrentLineWidth( aWidth ); if( aFill ) { fputs( "G36*\n", outputFile ); MoveTo( aCornerList[0] ); for( unsigned ii = 1; ii < aCornerList.size(); ii++ ) { LineTo( aCornerList[ii] ); } if( aFill ) { FinishTo( aCornerList[0] ); fputs( "G37*\n", outputFile ); } else if( aWidth > 0 ) { MoveTo( aCornerList[0] ); for( unsigned ii = 1; ii < aCornerList.size(); ii++ ) LineTo( aCornerList[ii] ); PenFinish(); } } Loading common/common_plotHPGL_functions.cpp +2 −0 Original line number Diff line number Diff line Loading @@ -264,6 +264,8 @@ void HPGL_PLOTTER::PlotPoly( const std::vector<wxPoint>& aCornerList, if( aCornerList.size() <= 1 ) return; SetCurrentLineWidth( aWidth ); MoveTo( aCornerList[0] ); for( unsigned ii = 1; ii < aCornerList.size(); ii++ ) Loading eeschema/dialogs/dialog_libedit_dimensions_base.fbp +1119 −1119 File changed.Preview size limit exceeded, changes collapsed. Show changes Loading
common/CMakeLists.txt +1 −1 Original line number Diff line number Diff line Loading @@ -163,6 +163,7 @@ set( COMMON_SRCS config_params.cpp confirm.cpp copy_to_clipboard.cpp convert_basic_shapes_to_polygon.cpp dialog_shim.cpp displlst.cpp draw_frame.cpp Loading Loading @@ -247,7 +248,6 @@ set( PCB_COMMON_SRCS base_screen.cpp eda_text.cpp class_page_info.cpp convert_basic_shapes_to_polygon.cpp pcbcommon.cpp footprint_info.cpp ../pcbnew/basepcbframe.cpp Loading
common/common_plotDXF_functions.cpp +85 −14 Original line number Diff line number Diff line Loading @@ -11,6 +11,7 @@ #include <plot_common.h> #include <macros.h> #include <kicad_string.h> #include <convert_basic_shapes_to_polygon.h> /** * Oblique angle for DXF native text Loading Loading @@ -319,25 +320,28 @@ void DXF_PLOTTER::Circle( const wxPoint& centre, int diameter, FILL_T fill, int /** * DXF polygon: doesn't fill it but at least it close the filled ones * DXF does not know thick outline. * It does not know thhick segments, therefore filled polygons with thick outline * are converted to inflated polygon by aWidth/2 */ #include "clipper.hpp" void DXF_PLOTTER::PlotPoly( const std::vector< wxPoint >& aCornerList, FILL_T aFill, int aWidth) { if( aCornerList.size() <= 1 ) return; unsigned last = aCornerList.size() - 1; // Plot outlines with lines (thickness = 0) to define the polygon if( aWidth == 0 || aFill ) if( aWidth <= 0 ) { MoveTo( aCornerList[0] ); for( unsigned ii = 1; ii < aCornerList.size(); ii++ ) LineTo( aCornerList[ii] ); } // Close polygon if 'fill' requested unsigned last = aCornerList.size() - 1; if( aFill ) { if( aCornerList[last] != aCornerList[0] ) Loading @@ -346,8 +350,13 @@ void DXF_PLOTTER::PlotPoly( const std::vector< wxPoint >& aCornerList, PenFinish(); // if the polygon outline has thickness, plot outlines with thick segments if( aWidth > 0 ) return; } // if the polygon outline has thickness, and is not filled // (i.e. is a polyline) plot outlines with thick segments if( aWidth > 0 && !aFill ) { MoveTo( aCornerList[0] ); Loading @@ -355,10 +364,72 @@ void DXF_PLOTTER::PlotPoly( const std::vector< wxPoint >& aCornerList, ThickSegment( aCornerList[ii-1], aCornerList[ii], aWidth, FILLED ); if( aCornerList[last] != aCornerList[0] ) ThickSegment( aCornerList[last], aCornerList[0], aWidth, FILLED ); return; } // The polygon outline has thickness, and is filled // Build and plot the polygon which contains the initial // polygon and its thick outline CPOLYGONS_LIST bufferOutline; CPOLYGONS_LIST bufferPolybase; const int circleToSegmentsCount = 16; // enter outline as polygon: for( unsigned ii = 1; ii < aCornerList.size(); ii++ ) { TransformRoundedEndsSegmentToPolygon( bufferOutline, aCornerList[ii-1], aCornerList[ii], circleToSegmentsCount, aWidth ); } // enter the initial polygon: for( unsigned ii = 0; ii < aCornerList.size(); ii++ ) { CPolyPt polypoint( aCornerList[ii].x, aCornerList[ii].y ); bufferPolybase.Append( polypoint ); } bufferPolybase.CloseLastContour(); // Merge polygons to build the polygon which contains the initial // polygon and its thick outline KI_POLYGON_SET polysBase; // Store the main outline and the final outline KI_POLYGON_SET polysOutline; // Store the thick segments to draw the outline bufferPolybase.ExportTo( polysBase ); bufferOutline.ExportTo( polysOutline ); polysBase += polysOutline; // create the outline which contains thick outline // We should have only one polygon in list, now. wxASSERT( polysBase.size() == 1 ); if( polysBase.size() < 1 ) // should not happen return; KI_POLYGON poly = polysBase[0]; // Expected only one polygon here if( poly.size() < 2 ) // should not happen return; // Now, output the final polygon to DXF file: last = poly.size() - 1; KI_POLY_POINT point = *(poly.begin()); wxPoint startPoint( point.x(), point.y() ); MoveTo( startPoint ); for( unsigned ii = 1; ii < poly.size(); ii++ ) { point = *( poly.begin() + ii ); LineTo( wxPoint( point.x(), point.y() ) ); } // Close polygon, if needed point = *(poly.begin() + last); wxPoint endPoint( point.x(), point.y() ); if( endPoint != startPoint ) LineTo( startPoint ); PenFinish(); } Loading
common/common_plotGERBER_functions.cpp +15 −8 Original line number Diff line number Diff line Loading @@ -325,25 +325,32 @@ void GERBER_PLOTTER::PlotPoly( const std::vector< wxPoint >& aCornerList, if( aCornerList.size() <= 1 ) return; // Gerber format does not know filled polygons with thick outline // Thereore, to plot a filled polygon with outline having a thickness, // one should plot outline as thick segments SetCurrentLineWidth( aWidth ); if( aFill ) { fputs( "G36*\n", outputFile ); MoveTo( aCornerList[0] ); for( unsigned ii = 1; ii < aCornerList.size(); ii++ ) { LineTo( aCornerList[ii] ); } if( aFill ) { FinishTo( aCornerList[0] ); fputs( "G37*\n", outputFile ); } else if( aWidth > 0 ) { MoveTo( aCornerList[0] ); for( unsigned ii = 1; ii < aCornerList.size(); ii++ ) LineTo( aCornerList[ii] ); PenFinish(); } } Loading
common/common_plotHPGL_functions.cpp +2 −0 Original line number Diff line number Diff line Loading @@ -264,6 +264,8 @@ void HPGL_PLOTTER::PlotPoly( const std::vector<wxPoint>& aCornerList, if( aCornerList.size() <= 1 ) return; SetCurrentLineWidth( aWidth ); MoveTo( aCornerList[0] ); for( unsigned ii = 1; ii < aCornerList.size(); ii++ ) Loading
eeschema/dialogs/dialog_libedit_dimensions_base.fbp +1119 −1119 File changed.Preview size limit exceeded, changes collapsed. Show changes