Commit 90a6daa7 authored by jean-pierre charras's avatar jean-pierre charras
Browse files

Cleanup math_for_graphic code

parent dfdd2cfd
Loading
Loading
Loading
Loading
+6 −8
Original line number Diff line number Diff line
@@ -387,8 +387,8 @@ bool BOARD::TestAreaIntersections( ZONE_CONTAINER* area_to_test )
                            yf2 = poly2->GetY( is2 );
                        }

                        int n_int = FindSegmentIntersections( xi1, yi1, xf1, yf1, STRAIGHT,
                                                              xi2, yi2, xf2, yf2, STRAIGHT );
                        int n_int = FindSegmentIntersections( xi1, yi1, xf1, yf1,
                                                              xi2, yi2, xf2, yf2 );
                        if( n_int )
                            return true;
                    }
@@ -498,8 +498,8 @@ int BOARD::TestAreaIntersection( ZONE_CONTAINER* area_ref, ZONE_CONTAINER* area_
                        yf2 = poly2->GetY( is2 );
                    }

                    int n_int = FindSegmentIntersections( xi1, yi1, xf1, yf1, STRAIGHT,
                                                          xi2, yi2, xf2, yf2, STRAIGHT );
                    int n_int = FindSegmentIntersections( xi1, yi1, xf1, yf1,
                                                          xi2, yi2, xf2, yf2 );
                    if( n_int )
                    {
                        bInt = true;
@@ -844,10 +844,8 @@ int BOARD::Test_Drc_Areas_Outlines_To_Areas_Outlines( ZONE_CONTAINER* aArea_To_E
                            int x, y;

                            int d = GetClearanceBetweenSegments( bx1, by1, bx2, by2,
                                                                 STRAIGHT,
                                                                 0,
                                                                 ax1, ay1, ax2, ay2,
                                                                 STRAIGHT,
                                                                 0,
                                                                 zone2zoneClearance,
                                                                 &x, &y );
@@ -987,9 +985,9 @@ bool DRC::doEdgeZoneDrc( ZONE_CONTAINER* aArea, int aCornerIndex )
                }

                int x, y;   // variables containing the intersecting point coordinates
                int d = GetClearanceBetweenSegments( bx1, by1, bx2, by2, STRAIGHT,
                int d = GetClearanceBetweenSegments( bx1, by1, bx2, by2,
                                                     0,
                                                     ax1, ay1, ax2, ay2, STRAIGHT,
                                                     ax1, ay1, ax2, ay2,
                                                     0,
                                                     zone_clearance,
                                                     &x, &y );
+3 −7
Original line number Diff line number Diff line
@@ -1112,7 +1112,6 @@ void CPolyLine::Hatch()
                                                  m_CornersList[ic].x, m_CornersList[ic].y,
                                                  m_CornersList[i_start_contour].x,
                                                  m_CornersList[i_start_contour].y,
                                                  STRAIGHT,
                                                  &x, &y, &x2, &y2 );
                i_start_contour = ic + 1;
            }
@@ -1121,7 +1120,6 @@ void CPolyLine::Hatch()
                ok = FindLineSegmentIntersection( a, slope,
                                                  m_CornersList[ic].x, m_CornersList[ic].y,
                                                  m_CornersList[ic + 1].x, m_CornersList[ic + 1].y,
                                                  STRAIGHT,
                                                  &x, &y, &x2, &y2 );
            }

@@ -1387,9 +1385,9 @@ int CPolyLine::Distance( wxPoint aStart, wxPoint aEnd, int aWidth )
                by2 = GetY( ic2 + 1 );
            }

            int d = GetClearanceBetweenSegments( bx1, by1, bx2, by2, STRAIGHT, 0,
            int d = GetClearanceBetweenSegments( bx1, by1, bx2, by2, 0,
                                                 aStart.x, aStart.y, aEnd.x, aEnd.y,
                                                 STRAIGHT, aWidth,
                                                 aWidth,
                                                 1,    // min clearance, should be > 0
                                                 NULL, NULL );

@@ -1689,9 +1687,7 @@ bool CPolyLine::IsPolygonSelfIntersecting()
                            int x2f    = GetX( is2_next );
                            int y2f    = GetY( is2_next );
                            int ret    = FindSegmentIntersections( x1i, y1i, x1f, y1f,
                                                                   STRAIGHT,
                                                                   x2i, y2i, x2f, y2f,
                                                                   STRAIGHT );
                                                                   x2i, y2i, x2f, y2f );
                            if( ret )
                            {
                                // intersection between non-adjacent sides