(self, props: ShapeProperties)
| 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 | |
| 100 | if __name__ == "__main__": |
no test coverage detected