@@ -39,6 +39,11 @@ def __init__(self, period=None, *args, **kwargs):
39
39
self .ucell_info_list = None
40
40
self .period = period
41
41
42
+ self .film_layer = None
43
+
44
+ def film (self ):
45
+ return []
46
+
42
47
@staticmethod
43
48
def rectangle_no_approximation (cx , cy , lx , ly , base ):
44
49
@@ -546,8 +551,6 @@ def ellipse(self, cx, cy, lx, ly, n_index, angle=0, n_split_w=2, n_split_h=2, an
546
551
right_array .append (points_contour_rot [:, y_highest_index ])
547
552
elif left_y < right_y :
548
553
left_array .append (points_contour_rot [:, y_highest_index ])
549
- else :
550
- raise ValueError # TODO
551
554
552
555
for i in range (points_contour_rot .shape [1 ]// 2 ):
553
556
left_array .append (points_contour_rot [:, (y_highest_index + i + 1 ) % points_contour_rot .shape [1 ]])
@@ -690,9 +693,9 @@ def vector(self, layer_info, x64=True):
690
693
col_list .insert (index , bottom_right [1 ])
691
694
692
695
if not row_list or row_list [- 1 ] != self .period [1 ]:
693
- row_list .append (self .period [1 ].reshape (1 ))
696
+ row_list .append (self .period [1 ].reshape (1 ). type ( datatype ) )
694
697
if not col_list or col_list [- 1 ] != self .period [0 ]:
695
- col_list .append (self .period [0 ].reshape (1 ))
698
+ col_list .append (self .period [0 ].reshape (1 ). type ( datatype ) )
696
699
697
700
if row_list and row_list [0 ] == 0 :
698
701
row_list = row_list [1 :]
@@ -727,10 +730,13 @@ def vector(self, layer_info, x64=True):
727
730
728
731
def draw (self , layer_info_list ):
729
732
ucell_info_list = []
733
+ self .film_layer = torch .zeros (len (layer_info_list ))
730
734
731
- for layer_info in layer_info_list :
735
+ for i , layer_info in enumerate ( layer_info_list ) :
732
736
ucell_layer , x_list , y_list = self .vector (layer_info )
733
737
ucell_info_list .append ([ucell_layer , x_list , y_list ])
738
+ if len (x_list ) == len (y_list ) == 1 :
739
+ self .film_layer [i ] = 1
734
740
self .ucell_info_list = ucell_info_list
735
741
return ucell_info_list
736
742
0 commit comments