MCPcopy Create free account
hub / github.com/pymupdf/PyMuPDF / edge_connects

Function edge_connects

src/table.py:1364–1381  ·  view source on GitHub ↗
(p1, p2)

Source from the content-addressed store, hash-verified

1362 """
1363
1364 def edge_connects(p1, p2) -> bool:
1365 def edges_to_set(edges):
1366 return set(map(obj_to_bbox, edges))
1367
1368 if p1[0] == p2[0]:
1369 common = edges_to_set(intersections[p1]["v"]).intersection(
1370 edges_to_set(intersections[p2]["v"])
1371 )
1372 if len(common):
1373 return True
1374
1375 if p1[1] == p2[1]:
1376 common = edges_to_set(intersections[p1]["h"]).intersection(
1377 edges_to_set(intersections[p2]["h"])
1378 )
1379 if len(common):
1380 return True
1381 return False
1382
1383 points = list(sorted(intersections.keys()))
1384 n_points = len(points)

Callers 1

find_smallest_cellFunction · 0.85

Calls 1

edges_to_setFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…