MCPcopy Create free account
hub / github.com/FullControlXYZ/fullcontrol / XYZB_gcode

Method XYZB_gcode

lab/fullcontrol/multiaxis/gcode/XYZB/point.py:10–21  ·  view source on GitHub ↗

generate XYZBC gcode string to move from a point p to this point. return XYZB string

(self, self_systemXYZ, p)

Source from the content-addressed store, hash-verified

8 b: Optional[float] = None
9
10 def XYZB_gcode(self, self_systemXYZ, p) -> float:
11 'generate XYZBC gcode string to move from a point p to this point. return XYZB string'
12 s = ''
13 if self_systemXYZ.x != None and self_systemXYZ.x != p.x:
14 s += f'X{round(self_systemXYZ.x, 6):.6} '
15 if self_systemXYZ.y != None and self_systemXYZ.y != p.y:
16 s += f'Y{round(self_systemXYZ.y, 6):.6} '
17 if self_systemXYZ.z != None and self_systemXYZ.z != p.z:
18 s += f'Z{round(self_systemXYZ.z, 6):.6} '
19 if self_systemXYZ.b != None and self_systemXYZ.b != p.b:
20 s += f'B{round(self_systemXYZ.b, 6):.6f} '
21 return s if s != '' else None
22
23 def inverse_kinematics(self, state):
24 'calculate system XYZ for the current point XYZ (in part coordinates)'

Callers 1

gcodeMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected