MCPcopy Create free account
hub / github.com/JoshuaPostel/texaform / cut_shape

Method cut_shape

python/lazer_cutter.py:77–97  ·  view source on GitHub ↗
(self, props: ShapeProperties)

Source from the content-addressed store, hash-verified

75
76 # not packing shapes for now
77 def cut_shape(self, props: ShapeProperties):
78 self.power_off()
79 self.desired_shape = props.shape
80 self.remaining_to_cut = self.desired_shape.outline()
81 print(self.remaining_to_cut.points)
82
83 # TODO check if material in buffer in
84 self.send(f"LOAD {props.material}")
85 while len(self.remaining_to_cut.points) > 0:
86 self.remaining_to_cut
87 target = self.closest_uncut()
88 if self.cutter_position.taxi_distance(target) > 1:
89 self.power_off()
90 self.goto(target)
91 self.power_on()
92 self.remaining_to_cut.points.remove(target)
93
94 self.power_off()
95 pick_location = next(iter(self.desired_shape.points))
96 self.goto(pick_location)
97 self.send(f"PICK {props.name}")
98
99
100if __name__ == "__main__":

Callers 1

make_shapeFunction · 0.80

Calls 7

power_offMethod · 0.95
closest_uncutMethod · 0.95
gotoMethod · 0.95
power_onMethod · 0.95
outlineMethod · 0.80
taxi_distanceMethod · 0.80
sendMethod · 0.45

Tested by

no test coverage detected