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

Function point2S

Lib/pagebot/toolbox/units.py:129–141  ·  view source on GitHub ↗

Answers the point as string of units. Ignores the `z`-value if it renders to 0. >>> point2S(pt(22.4, 33.5, 44.6)) '22.4pt 33.5pt 44.6pt' >>> point2S(pt(33.6, 44.7)) '33.6pt 44.7pt'

(p)

Source from the content-addressed store, hash-verified

127 return point[0] + offset[0], point[1] + offset[1], point[2] + offset[2]
128
129def point2S(p):
130 """Answers the point as string of units. Ignores the `z`-value if it
131 renders to 0.
132
133 >>> point2S(pt(22.4, 33.5, 44.6))
134 '22.4pt 33.5pt 44.6pt'
135 >>> point2S(pt(33.6, 44.7))
136 '33.6pt 44.7pt'
137 """
138 x, y, z = point3D(p)
139 if z.rv:
140 return '%s %s %s' % (x, y, z)
141 return '%s %s' % (x, y)
142
143def point2roundedS(p):
144 """Answers the point as string of rounded units. Ignores the `z`-value if

Callers

nothing calls this directly

Calls 1

point3DFunction · 0.85

Tested by

no test coverage detected