Machine¶
-
class
hotwing_core.machine.
Machine
(width, kerf=0.075, profile_points=200, cutting_strategy_name='default', gcode_formatter_name='default', units='inches', feedrate=None)[source]¶ The Machine class is a representation of a foam cutting machine and goes through the series of cuts required to create a complete cutting path.
The machine takes a Profile object and generates the code to cut that profile.
Gcode generation gets delegated to the cutting_strategy.
Parameters: - width (Float) – length of the machine’s hotwire cutter
- kerf (Float) – Allowance for the hotwire’s cutter. This includes the radius of the wire plus any additional allowance for melted foam from direct or radiant heat.
- profile_points (Int) – Number of points used when interpolating profiles. This is the number for each (top and bottom) surface of a Profile.
- cutting_strategy_name –
- gcode_formatter_name –
- units –
- feedrate –
Variables: - width – width
- kerf – kerf
- profile_points – profile_points
- cutting_strategy_name – cutting_strategy_name
- gcode_formatter_name – gcode_formatter_name
- units – units “inches” or “millimeters”
- feedrate – feedrate on the side of the largest rib
-
calculate_move
(c1, c2)[source]¶ Create the XYUV positions for the machine in order to intersect two Coordinates.
Parameters: - c1 (Coordinate) –
- c2 (Coordinate) –
Returns: {“x”:1.1,”y”:1.1,”u”:1.1,”v”:1.1}
Return type: Dict
-
generate_gcode
(safe_height=5, foam_height=2, normalize=True)[source]¶ Generate the gcode to cut the panel. You must have a panel loaded into the machine, otherwise it cannot cut.
Parameters: - safe_height (Float) – The height where the machine can move freely without hitting anything. Make sure this value is greater than the height of your foam block.
- normalize (Boolean) – When generating the machine path, the x and y values may be < 0. Setting this to True translates the values so that all x and y values are >= 0.
Returns: Gcode commands separated by newlines.
Return type: String
-
load_panel
(panel, left_offset=None)[source]¶ Load a Panel object into the machine.
Parameters: - panel (Panel) – panel to use
- left_offset (Float) – How far from the left hotwire post to place the panel. If the panel is 24 inches and the machine is 30 inches, a value of 3 ([30-24]/2) will place the panel centered between the CNC’s cutting posts.
Returns: None