Пример #1
0
 def to_i2s_i3s(self, new_shapes, to_file):
     attributes = []
     for line in new_shapes:
         attributes.append(line.attributes()[0])
     with bk.Write(to_file) as f:
         f.write_header(self.header)
         f.write_lines(new_shapes, attributes)
Пример #2
0
 def from_i3s_to_i2s(self, new_shapes, to_file):
     attributes = []
     shapes = []
     for line in new_shapes:
         attributes.append(line.attributes()[0])
         coords = np.array(list(line.coords()))
         shapes.append(Polyline(coords[:, :2]))
     with bk.Write(to_file) as f:
         f.write_header(self.default_header)
         f.write_lines(shapes, attributes)
Пример #3
0
    def to_i3s(self, new_shapes, to_file, attribute_method):
        attributes = []
        for i, poly in enumerate(new_shapes):
            if attribute_method == '0':
                attributes.append(0)
            elif attribute_method == 'Iteration':
                attributes.append(i + 1)
            else:
                attribute_index = int(attribute_method.split(' - ')[0])
                attributes.append(poly.attributes()[attribute_index])

        with bk.Write(to_file) as f:
            f.write_header(self.i3s_header)
            f.write_lines(new_shapes, attributes)
Пример #4
0
 def to_xyz(self, new_shapes, to_file):
     with bk.Write(to_file) as f:
         f.write_points(new_shapes)
Пример #5
0
 def to_xyz(self, new_shapes, to_file):
     with bk.Write(to_file) as f:
         if WRITE_XYZ_HEADER:
             f.write_header(self.header)
         f.write_points(new_shapes)