MCPcopy Create free account
hub / github.com/AstroPrint/AstroBox / Point

Class Point

src/ext/makerbot_driver/Gcode/Point.py:10–36  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8
9
10class Point(object):
11
12 def __init__(self):
13 self.X = None
14 self.Y = None
15 self.Z = None
16 self.A = None
17 self.B = None
18
19 def ToList(self):
20 return [self.X, self.Y, self.Z, self.A, self.B]
21
22 def SetPoint(self, codes):
23 """Given a set of codes with defined values, sets this point's
24 axes to those values.
25
26 @param dict codes: The codes that may or may not contain axes values
27 """
28 for axis in ['X', 'Y', 'Z', 'A', 'B']:
29 if axis in codes:
30 setattr(self, axis, codes[axis])
31
32 def copy(self):
33 copy_point = Point()
34 for axis in ['X', 'Y', 'Z', 'A', 'B']:
35 setattr(copy_point, axis, getattr(self, axis))
36 return copy_point

Callers 1

copyMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected