Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
nat-a-cyborg committed Nov 27, 2023
1 parent 434524c commit 88e5fef
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ RUN apt-get update
RUN apt-get install bc
RUN apt-get clean && \
rm -rf /var/lib/apt/lists/*
RUN pip install applescript

WORKDIR /home

Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@ To view a full list of command-line options, run:
./run.sh -h
```

### Running directly

```
python3 /home/octahedroflake.py --iterations 6 --layer-height 0.2 --nozzle-diameter 0.4 --size-multiplier 1.377628
```

## File Descriptions

### [octahedroflake.py](https://github.com/nat-a-cyborg/octahedroflake/blob/main/octahedroflake.py)
Expand Down
6 changes: 3 additions & 3 deletions octahedroflake.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
import inspect
import math
import argparse
import platform
import applescript

import cadquery as cq
from cadquery import exporters

Expand Down Expand Up @@ -126,14 +129,11 @@ def cache_model(part, part_name, order=None):
report(f" 📥 {part_name}", order=order)

def save_comments(file_path, note):
import platform
if platform.system() == "Darwin": # Checks if the OS is macOS
note += f"\nNOZZLE_DIAMETER: {NOZZLE_DIAMETER}"
note += f"\nLAYER_HEIGHT: {LAYER_HEIGHT}"
note += f"\nFINAL_ORDER: {FINAL_ORDER}"
note += f"\nSIZE_MULTIPLER: {SIZE_MULTIPLER}"

import applescript
applescript.tell.app("Finder", f'set comment of (POSIX file "{file_path}" as alias) to "{note}" as Unicode text')

def output(result, *, name, path, stl=False, step=False, svg=False):
Expand Down

0 comments on commit 88e5fef

Please sign in to comment.