Class ConvexClip


  • public class ConvexClip
    extends java.lang.Object
    • Field Detail

      • inters

        public cVertexList inters
        Vertex List of the final intersection with the result of the computation
    • Constructor Detail

      • ConvexClip

        public ConvexClip()
    • Method Detail

      • Start

        public void Start​(cVertexList list1,
                          cVertexList list2)
        Parameters:
        list1 - first polygon for the intersection
        list2 - second polygon for the intersection
        Throws:
        java.lang.RuntimeException - if one of the two polygons is not convex
      • AreaSign

        public static int AreaSign​(Point2D a,
                                   Point2D b,
                                   Point2D c)
        Computes the sign of the area of the triangle a,b,c
        Parameters:
        a -
        b -
        c -
        Returns:
        returns sign of the are {0,1,-1}
      • intersect

        public InfoPoint intersect​(Point2D a,
                                   Point2D b,
                                   Point2D c,
                                   Point2D d)
        computes the intersection of the egdes between ab and cd
        Parameters:
        a -
        b -
        c -
        d -
        Returns:
        Infopoint with the flag of the intersection type and the point of the intersection