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

Function rect_to_edges

src/table.py:900–937  ·  view source on GitHub ↗
(rect)

Source from the content-addressed store, hash-verified

898
899
900def rect_to_edges(rect) -> list:
901 top, bottom, left, right = [dict(rect) for x in range(4)]
902 top.update(
903 {
904 "object_type": "rect_edge",
905 "height": 0,
906 "y0": rect["y1"],
907 "bottom": rect["top"],
908 "orientation": "h",
909 }
910 )
911 bottom.update(
912 {
913 "object_type": "rect_edge",
914 "height": 0,
915 "y1": rect["y0"],
916 "top": rect["top"] + rect["height"],
917 "doctop": rect["doctop"] + rect["height"],
918 "orientation": "h",
919 }
920 )
921 left.update(
922 {
923 "object_type": "rect_edge",
924 "width": 0,
925 "x1": rect["x0"],
926 "orientation": "v",
927 }
928 )
929 right.update(
930 {
931 "object_type": "rect_edge",
932 "width": 0,
933 "x0": rect["x1"],
934 "orientation": "v",
935 }
936 )
937 return [top, bottom, left, right]
938
939
940def curve_to_edges(curve) -> list:

Callers

nothing calls this directly

Calls 1

updateMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…