Skip to content

Commit

Permalink
Dev (#6)
Browse files Browse the repository at this point in the history
* [BUG] fixed issue with topsurfacing if tool never retracts
[BUG] fixed issue if additive file was greater than 100 layers
[FEATURE] confirmed lead-in vertical radii are allowable

* [UPDATE] readme
  • Loading branch information
AndyEveritt authored Mar 17, 2020
1 parent aa3bad9 commit e065852
Show file tree
Hide file tree
Showing 7 changed files with 37,051 additions and 2,296 deletions.
40 changes: 0 additions & 40 deletions .github/workflows/pythonpackage.yml

This file was deleted.

2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
.vscode
*tmp.gcode
*tmp.nc
*.stl

# Byte-compiled / optimized / DLL files
__pycache__/
Expand Down
15 changes: 9 additions & 6 deletions ASMBL_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def get_name(self, gcode):
return gcode.split(',')[0][2:]

def get_layer_height(self, gcode):
return float(gcode.split('\n')[0][15:])
return float(gcode.split('\n')[0].split('Z = ')[-1])


class CamGcodeLine:
Expand Down Expand Up @@ -160,12 +160,15 @@ def split_cam_operations(self, gcode_sub):
line_heights = np.array([line.layer_height for line in lines])
local_peaks = find_peaks(line_heights)[0]

operations[i].append(lines[0: local_peaks[0]+1])
if len(local_peaks) > 0:
operations[i].append(lines[0: local_peaks[0]+1])

for index, peak in enumerate(local_peaks[:-1]):
operations[i].append(lines[local_peaks[index]: local_peaks[index+1]+1])
for index, peak in enumerate(local_peaks[:-1]):
operations[i].append(lines[local_peaks[index]: local_peaks[index+1]+1])

operations[i].append(lines[local_peaks[-1]:])
operations[i].append(lines[local_peaks[-1]:])
else:
operations[i].append(lines)

self.order_cam_operations_by_layer(operations)

Expand Down Expand Up @@ -233,7 +236,7 @@ def create_output_file(self, gcode):
file_path = "output/" + self.config['OutputSettings']['filename'] + ".gcode"

os.makedirs(os.path.dirname(file_path), exist_ok=True)

with open(file_path, "w") as f:
f.write(gcode)

Expand Down
Binary file modified CAD/Box.stl
Binary file not shown.
31 changes: 21 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,8 @@ It takes 2 input files:

These files require specific setup for this program to work

Download the latest release for the `ASMBL.exe`, an example `config.json`, and the Simply3d factory file.

# Installation

```bash
git clone {repo address}
python3 -m venv env
pip install -r requirements.txt
```

# How to Setup

Expand Down Expand Up @@ -128,7 +122,7 @@ Multiple surfaces at different heights can be selected with the same process. Th
* Select the boundry contours for the sides you would like to cut (everything in the boundry will be cut)
* You can specify an out and inner boundary to only cut a certain region
* `Heights`
* Set the `Clearance Height`, `Retract Height`, and `Feed Height` equal
* Set the `Clearance Height` and `Retract Height` equal
* These must be equal for all processes
* Set the `Top Height` and `Bottom Height` appropriately for the desired process
* ie top and bottom of the surface
Expand All @@ -146,6 +140,8 @@ Multiple surfaces at different heights can be selected with the same process. Th

3D Contour can be used for most none flat surfaces that have nothing above them. They are good for quickly CAM'ing a large number of faces.

None flat surfaces that have something above them can be CAM'd with some Fusion 360 magic. But this can be an involved process depending on the geometry.

<img src="docs/images/3d_contour_1.png" width="480">

The machining boundary can be used to restrict which faces are machined. Here the centre sloped surface is diselected but everything within the inner centre hole is machined.
Expand Down Expand Up @@ -207,9 +203,9 @@ Arg (long) | Arg (short) | Default | Usage

## Run

To run the program, ensure the python virtual environment is enabled, then use `python main.py`
To run the program, ensure the `config.json` is configured correctly, then run the `ASMBL.exe`

The program will output the file with a name according the the config settings in the `output` folder.
The program will output the file with a name according the the config settings in the `output` folder. (An output folder will be created in the same directory if one does not exist)

>**Always preview the generated gcode in Simplify3D before attempting to print it**
Expand All @@ -218,3 +214,18 @@ Set the coloring to `Active Toolhead` and enable `Travel moves` to ensure the pa
The subtractive processes are displayed as travel moves, scroll through the layers to check the subtractive processes have been added at the correct point in the print (defined in `config.json`)

<img src="docs/images/simplify3d_preview.png" width="480">


# Setting up the code for modification

```bash
git clone {repo address}
python3 -m venv env
pip install -r requirements.txt
```

To run the program, ensure the python virtual environment is enabled, then use `python main.py`

## Compiling source code

Run `pyinstaller --onefile main.py` to create the compiled `.exe` in the `dist` folder
4 changes: 2 additions & 2 deletions config.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"InputFiles": {
"additive_gcode": "gcode/Spinner_Demo/Spinner_Demo_MM.gcode",
"subtractive_gcode": "gcode/Spinner_Demo/Spinner_Demo.nc"
"additive_gcode": "gcode/box/box.gcode",
"subtractive_gcode": "gcode/box/tmp.nc"
},
"Printer": {
"bed_centre_x": 150,
Expand Down
Loading

0 comments on commit e065852

Please sign in to comment.