MCPcopy
hub / github.com/CadQuery/cadquery / toTuple

Function toTuple

tests/__init__.py:39–46  ·  view source on GitHub ↗

convert a vector or a vertex to a 3-tuple: x,y,z

(v)

Source from the content-addressed store, hash-verified

37
38
39def toTuple(v):
40 """convert a vector or a vertex to a 3-tuple: x,y,z"""
41 if type(v) == gp_Vec:
42 return (v.X(), v.Y(), v.Z())
43 elif type(v) == Vector:
44 return v.toTuple()
45 else:
46 raise RuntimeError("dont know how to convert type %s to tuple" % str(type(v)))
47
48
49class BaseTest(unittest.TestCase):

Callers 2

testXYPlaneOriginsMethod · 0.90
testXZPlaneOriginsMethod · 0.90

Calls 1

toTupleMethod · 0.45

Tested by 2

testXYPlaneOriginsMethod · 0.72
testXZPlaneOriginsMethod · 0.72