convert a vector or a vertex to a 3-tuple: x,y,z
(v)
| 37 | |
| 38 | |
| 39 | def 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 | |
| 49 | class BaseTest(unittest.TestCase): |