|
@@ -723,14 +723,14 @@ class LineTable:
|
|
|
exists,point = self.cross_point(line1,line2)
|
|
|
if exists:
|
|
|
list_crosspoints.append(point)
|
|
|
- # from matplotlib import pyplot as plt
|
|
|
- # plt.figure()
|
|
|
- # for _line in l_lines:
|
|
|
- # x0,y0,x1,y1 = _line
|
|
|
- # plt.plot([x0,x1],[y0,y1])
|
|
|
- # for point in list_crosspoints:
|
|
|
- # plt.scatter(point.get("point")[0],point.get("point")[1])
|
|
|
- # plt.show()
|
|
|
+ from matplotlib import pyplot as plt
|
|
|
+ plt.figure()
|
|
|
+ for _line in l_lines:
|
|
|
+ x0,y0,x1,y1 = _line
|
|
|
+ plt.plot([x0,x1],[y0,y1])
|
|
|
+ for point in list_crosspoints:
|
|
|
+ plt.scatter(point.get("point")[0],point.get("point")[1])
|
|
|
+ plt.show()
|
|
|
|
|
|
# print(list_crosspoints)
|
|
|
# print("points num",len(list_crosspoints))
|
|
@@ -1139,11 +1139,14 @@ class LineTable:
|
|
|
for _line in _table:
|
|
|
for c_i in range(len(_line)):
|
|
|
_cell = _line[c_i]
|
|
|
+
|
|
|
if _cell.get("columnspan")>1:
|
|
|
_cospan = _cell.get("columnspan")
|
|
|
_cell["columnspan"] = 1
|
|
|
+ n_cell = {}
|
|
|
+ n_cell.update(_cell)
|
|
|
for i in range(1,_cospan):
|
|
|
- _line.insert(c_i,_cell)
|
|
|
+ _line.insert(c_i,n_cell)
|
|
|
for l_i in range(len(_table)):
|
|
|
_line = _table[l_i]
|
|
|
for c_i in range(len(_line)):
|
|
@@ -1151,10 +1154,23 @@ class LineTable:
|
|
|
if _cell.get("rowspan")>1:
|
|
|
_rospan = _cell.get("rowspan")
|
|
|
_cell["rowspan"] = 1
|
|
|
+ n_cell = {}
|
|
|
+ n_cell.update(_cell)
|
|
|
for i in range(1,_rospan):
|
|
|
if l_i+i<=len(_table)-1:
|
|
|
# print(len(_table),l_i+i)
|
|
|
- _table[l_i+i].insert(c_i,_cell)
|
|
|
+ _table[l_i+i].insert(c_i,n_cell)
|
|
|
+
|
|
|
+
|
|
|
+ print("=======")
|
|
|
+ for _line in _table:
|
|
|
+ for _cell in _line:
|
|
|
+ _text = _cell["text"][:2]+"_"+str(_cell["columnspan"])+"_"+str(_cell["rowspan"])
|
|
|
+ if _text=="":
|
|
|
+ _text = "=="
|
|
|
+ print(_text,end="\t")
|
|
|
+ print("\n")
|
|
|
+ print("===========")
|
|
|
|
|
|
if fixRect:
|
|
|
for _line in _table:
|
|
@@ -1223,12 +1239,15 @@ class LineTable:
|
|
|
|
|
|
|
|
|
|
|
|
- # print("=======")
|
|
|
- # for _line in _table:
|
|
|
- # for _cell in _line:
|
|
|
- # print(_cell,end="\t\t")
|
|
|
- # print("\n")
|
|
|
- # print("===========")
|
|
|
+ print("=======")
|
|
|
+ for _line in _table:
|
|
|
+ for _cell in _line:
|
|
|
+ _text = _cell["text"][:2]
|
|
|
+ if _text=="":
|
|
|
+ _text = "=="
|
|
|
+ print(_text,end="\t")
|
|
|
+ print("\n")
|
|
|
+ print("===========")
|
|
|
|
|
|
table_bbox = (_table[0][0].get("bbox")[0],
|
|
|
_table[0][0].get("bbox")[1],
|