116 Generates infill pattern image for later use |
118 Generates infill pattern image for later use |
117 """ |
119 """ |
118 b1x, b1y = self.bb1.coord() |
120 b1x, b1y = self.bb1.coord() |
119 b2x, b2y = self.bb2.coord() |
121 b2x, b2y = self.bb2.coord() |
120 page = box(b1x, b1y, b2x, b2y) |
122 page = box(b1x, b1y, b2x, b2y) |
121 # TODO: Infill spacing needs to be calculated with proper scaling and gcode MM dimensions |
123 # TODO: Infill spacing needs to be calculated with proper scaling and gcode MM dimensions, when set to 0 (auto) |
122 # TODO: Make infill angle 0, 45 or 90 degrees configurable to options parser (0° = X, 90° = Y, 45° = X and Y but half the speed/accel needed!) |
124 # Make infill angle 0, 45 or 90 degrees configurable to options parser (0° = X, 90° = Y, 45° = X and Y but half the speed/accel needed!) |
123 self.infill = hatchbox(page, 0, 2) |
125 self.infill = hatchbox(page, self.options.infill_angle, self.options.infill_spacing) |
124 |
126 |
125 def normalize(self, coord): |
127 def normalize(self, coord): |
126 """ |
128 """ |
127 Normalize X / Y Axis of coordinates |
129 Normalize X / Y Axis of coordinates |
128 At the moment only Y gets flipped to match Reprap coordinate system (0,0 is bottom left instead top left on SVG) |
130 At the moment only Y gets flipped to match Reprap coordinate system (0,0 is bottom left instead top left on SVG) |
297 dest="travel_speed", type="float", default=130, |
299 dest="travel_speed", type="float", default=130, |
298 help="travel speed mm/sec (default 130)") |
300 help="travel speed mm/sec (default 130)") |
299 parser.add_option("-o", "--outline", action="store_true", |
301 parser.add_option("-o", "--outline", action="store_true", |
300 dest="outline", default=False, |
302 dest="outline", default=False, |
301 help="no infill, only outlines") |
303 help="no infill, only outlines") |
|
304 parser.add_option("", "--infill-angle", |
|
305 dest="infill_angle", type="int", default=45, |
|
306 help="infill angle: 0 = X, 90 = Y (default 45)") |
|
307 parser.add_option("", "--infill-spacing", |
|
308 dest="infill_spacing", type="float", default=1.5, |
|
309 help="infill spacing in SVG units (default 1.5)") |
302 return parser.parse_args() |
310 return parser.parse_args() |
303 |
311 |
304 if __name__ == "__main__": |
312 if __name__ == "__main__": |
305 (OPTIONS, ARGS) = init_options() |
313 (OPTIONS, ARGS) = init_options() |
306 if not OPTIONS.filename: |
314 if not OPTIONS.filename: |