MCPcopy Create free account
hub / github.com/PageBot/PageBot / point2D

Function point2D

Lib/pagebot/toolbox/units.py:86–98  ·  view source on GitHub ↗

Answers the 2D point from a 2D or 3D point. >>> point2D() # Default 2D origin (0pt, 0pt) >>> point2D(pt(20, -40)) (20pt, -40pt) >>> point2D(pt(20)) (20pt, 20pt) >>> point2D(mm(2,3,4,5,6)) (2mm, 3mm)

(p=None)

Source from the content-addressed store, hash-verified

84 return p
85
86def point2D(p=None):
87 """Answers the 2D point from a 2D or 3D point.
88
89 >>> point2D() # Default 2D origin
90 (0pt, 0pt)
91 >>> point2D(pt(20, -40))
92 (20pt, -40pt)
93 >>> point2D(pt(20))
94 (20pt, 20pt)
95 >>> point2D(mm(2,3,4,5,6))
96 (2mm, 3mm)
97 """
98 return point3D(p)[:2]
99
100def pointOffset(point, offset):
101 """Answers a new 3D point, shifted by offset.

Callers 15

textMethod · 0.90
textBoxMethod · 0.90
addPointMethod · 0.90
moveToMethod · 0.90
lineToMethod · 0.90
arcMethod · 0.90
arcToMethod · 0.90
traceImageMethod · 0.90
translateMethod · 0.90
rotateMethod · 0.90
scaleMethod · 0.90
skewMethod · 0.90

Calls 1

point3DFunction · 0.85

Tested by

no test coverage detected