示例#1
0
    def end_join(self, other, k):
        fault_polyline = self.getPolyline(k)

        if isinstance(other, Fault):
            other_polyline = other.getPolyline(k)
        else:
            other_polyline = other

        return GeometryTools.joinPolylines(fault_polyline, other_polyline)
示例#2
0
文件: fault.py 项目: OPM/ResInsight
    def end_join(self, other, k):
        fault_polyline = self.getPolyline(k)

        if isinstance(other, Fault):
            other_polyline = other.getPolyline(k)
        else:
            other_polyline = other

        return GeometryTools.joinPolylines(fault_polyline, other_polyline)
示例#3
0
    def test_join__polylines(self):
        l1 = Polyline(init_points=[(0, 1), (1, 1)])
        l2 = CPolyline(init_points=[(2, -1), (2, 0)])
        l3 = CPolyline(init_points=[(2, 2), (2, 3)])
        l4 = Polyline()
        l5 = CPolyline(init_points=[(0.5, 0), (0.5, 2)])

        with self.assertRaises(ValueError):
            GeometryTools.joinPolylines(l1, l4)

        with self.assertRaises(ValueError):
            GeometryTools.joinPolylines(l4, l1)

        self.assertIsNone(GeometryTools.joinPolylines(l1, l5))

        self.assertEqual(GeometryTools.joinPolylines(l1, l2), [(1, 1), (2, 0)])
示例#4
0
    def test_join__polylines(self):
        l1 = Polyline( init_points = [(0,1) , (1,1)])
        l2 = CPolyline( init_points = [(2,-1) , (2,0)])
        l3 = CPolyline( init_points = [(2,2) , (2,3)])
        l4 = Polyline( )
        l5 = CPolyline( init_points = [(0.5,0),(0.5,2)] )

        with self.assertRaises( ValueError ):
            GeometryTools.joinPolylines( l1 , l4 )

        with self.assertRaises( ValueError ):
            GeometryTools.joinPolylines( l4 , l1 )
        
        self.assertIsNone( GeometryTools.joinPolylines( l1 , l5 ))
            
        self.assertEqual( GeometryTools.joinPolylines( l1 , l2 ) , [(1,1) , (2,0)] )