Commit f2f4cd53 authored by charras's avatar charras
Browse files

rework on zones (continued):try to fix a filling problem with kbool: cleanup code

parent 537d4861
Loading
Loading
Loading
Loading
+629 −60

File changed.

Preview size limit exceeded, changes collapsed.

+38 −17
Original line number Diff line number Diff line
@@ -4,6 +4,7 @@

#ifndef CLASS_DRAWSEGMENT_H
#define CLASS_DRAWSEGMENT_H
#include "polyline.h"

class DRAWSEGMENT : public BOARD_ITEM
{
@@ -116,6 +117,7 @@ public:
        return hypot( delta.x, delta.y );
    }


    /**
     * Function Move
     * move this object.
@@ -127,6 +129,7 @@ public:
        m_End   += aMoveVector;
    }


    /**
     * Function Rotate
     * Rotate this object.
@@ -142,10 +145,28 @@ public:
     */
    virtual void Flip( const wxPoint& aCentre );

    /** Function TransformShapeWithClearanceToPolygon
     * Convert the track shape to a closed polygon
     * Used in filling zones calculations
     * Circles and arcs are approximated by segments
     * @param aCornerBuffer = a buffer to store the polygon
     * @param aClearanceValue = the clearance around the pad
     * @param aCircleToSegmentsCount = the number of segments to approximate a circle
     * @param aCorrectionFactor = the correction to apply to circles radius to keep
     * clearance when the circle is approxiamted by segment bigger or equal
     * to the real clearance value (usually near from 1.0)
     */
    void         TransformShapeWithClearanceToPolygon(
        std::vector <CPolyPt>& aCornerBuffer,
        int                    aClearanceValue,
        int
                               aCircleToSegmentsCount,
        double                 aCorrectionFactor );

#if defined(DEBUG)
    void Show( int nestLevel, std::ostream& os );
#endif

#endif
};


+3 −2
Original line number Diff line number Diff line
@@ -5,6 +5,7 @@
class Pcb3D_GLCanvas;

#include "pad_shapes.h"
#include "polyline.h"

/* Default layers used for pads, according to the pad type.
 * this is default values only, they can be changed for a given pad
@@ -141,7 +142,7 @@ public:
        m_Pos = aPos;
    }

    /** function TransformPadWithClearanceToPolygon
    /** function TransformShapeWithClearanceToPolygon
     * Convert the pad shape to a closed polygon
     * Used in filling zones calculations
     * Circles and arcs are approximated by segments
@@ -152,7 +153,7 @@ public:
     * clearance when the circle is approxiamted by segment bigger or equal
     * to the real clearance value (usually near from 1.0)
    */
    void TransformPadWithClearanceToPolygon( std::vector <wxPoint>& aCornerBuffer,
    void TransformShapeWithClearanceToPolygon( std::vector <CPolyPt>& aCornerBuffer,
            int aClearanceValue, int aCircleToSegmentsCount, double aCorrectionFactor );

     /**
+18 −0
Original line number Diff line number Diff line
@@ -5,6 +5,7 @@
#define CLASS_PCB_TEXT_H

#include "base_struct.h"
#include "polyline.h"

class TEXTE_PCB : public BOARD_ITEM, public EDA_TextStruct
{
@@ -110,6 +111,23 @@ public:
        return wxT("PTEXT");
    }

    /** Function TransformShapeWithClearanceToPolygon
     * Convert the track shape to a closed polygon
     * Used in filling zones calculations
     * Circles and arcs are approximated by segments
     * @param aCornerBuffer = a buffer to store the polygon
     * @param aClearanceValue = the clearance around the pad
     * @param aCircleToSegmentsCount = the number of segments to approximate a circle
     * @param aCorrectionFactor = the correction to apply to circles radius to keep
     * clearance when the circle is approximated by segment bigger or equal
     * to the real clearance value (usually near from 1.0)
     */
    void TransformShapeWithClearanceToPolygon(
        std::vector <CPolyPt>& aCornerBuffer,
        int                    aClearanceValue,
        int                    aCircleToSegmentsCount,
        double                 aCorrectionFactor );

#if defined(DEBUG)
    /**
     * Function Show
+3 −2
Original line number Diff line number Diff line
@@ -6,6 +6,7 @@
#define CLASS_TRACK_H

#include "base_struct.h"
#include "polyline.h"


// Via attributes (m_Shape parmeter)
@@ -148,7 +149,7 @@ public:
    /* divers */
    int Shape() const { return m_Shape & 0xFF; }

    /** Function TransformTrackWithClearanceToPolygon
    /** Function TransformShapeWithClearanceToPolygon
     * Convert the track shape to a closed polygon
     * Used in filling zones calculations
     * Circles (vias) and arcs (ends of tracks) are approximated by segments
@@ -159,7 +160,7 @@ public:
     * clearance when the circle is approxiamted by segment bigger or equal
     * to the real clearance value (usually near from 1.0)
     */
    void TransformTrackWithClearanceToPolygon( std::vector <wxPoint>& aCornerBuffer,
    void TransformShapeWithClearanceToPolygon( std::vector <CPolyPt>& aCornerBuffer,
                                               int                    aClearanceValue,
                                               int                    aCircleToSegmentsCount,
                                               double                 aCorrectionFactor );
Loading