Skip to content

Commit e065852

Browse files
authored
Dev (#6)
* [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
1 parent aa3bad9 commit e065852

File tree

7 files changed

+37051
-2296
lines changed

7 files changed

+37051
-2296
lines changed

.github/workflows/pythonpackage.yml

Lines changed: 0 additions & 40 deletions
This file was deleted.

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
.vscode
22
*tmp.gcode
3+
*tmp.nc
4+
*.stl
35

46
# Byte-compiled / optimized / DLL files
57
__pycache__/

ASMBL_parser.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ def get_name(self, gcode):
2828
return gcode.split(',')[0][2:]
2929

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

3333

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

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

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

168-
operations[i].append(lines[local_peaks[-1]:])
169+
operations[i].append(lines[local_peaks[-1]:])
170+
else:
171+
operations[i].append(lines)
169172

170173
self.order_cam_operations_by_layer(operations)
171174

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

235238
os.makedirs(os.path.dirname(file_path), exist_ok=True)
236-
239+
237240
with open(file_path, "w") as f:
238241
f.write(gcode)
239242

CAD/Box.stl

22.5 KB
Binary file not shown.

README.md

Lines changed: 21 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,8 @@ It takes 2 input files:
88

99
These files require specific setup for this program to work
1010

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

12-
# Installation
13-
14-
```bash
15-
git clone {repo address}
16-
python3 -m venv env
17-
pip install -r requirements.txt
18-
```
1913

2014
# How to Setup
2115

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

147141
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.
148142

143+
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.
144+
149145
<img src="docs/images/3d_contour_1.png" width="480">
150146

151147
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.
@@ -207,9 +203,9 @@ Arg (long) | Arg (short) | Default | Usage
207203

208204
## Run
209205

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

212-
The program will output the file with a name according the the config settings in the `output` folder.
208+
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)
213209

214210
>**Always preview the generated gcode in Simplify3D before attempting to print it**
215211
@@ -218,3 +214,18 @@ Set the coloring to `Active Toolhead` and enable `Travel moves` to ensure the pa
218214
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`)
219215

220216
<img src="docs/images/simplify3d_preview.png" width="480">
217+
218+
219+
# Setting up the code for modification
220+
221+
```bash
222+
git clone {repo address}
223+
python3 -m venv env
224+
pip install -r requirements.txt
225+
```
226+
227+
To run the program, ensure the python virtual environment is enabled, then use `python main.py`
228+
229+
## Compiling source code
230+
231+
Run `pyinstaller --onefile main.py` to create the compiled `.exe` in the `dist` folder

config.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"InputFiles": {
3-
"additive_gcode": "gcode/Spinner_Demo/Spinner_Demo_MM.gcode",
4-
"subtractive_gcode": "gcode/Spinner_Demo/Spinner_Demo.nc"
3+
"additive_gcode": "gcode/box/box.gcode",
4+
"subtractive_gcode": "gcode/box/tmp.nc"
55
},
66
"Printer": {
77
"bed_centre_x": 150,

0 commit comments

Comments
 (0)