Skip to content

Commit

Permalink
Experiment with dimensions in readme
Browse files Browse the repository at this point in the history
  • Loading branch information
scottbez1 committed Jun 13, 2024
1 parent 8a89491 commit 2ea648f
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
24 changes: 12 additions & 12 deletions .github/workflows/3d.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,18 +87,18 @@ jobs:
cp 3d/build/laser_parts/combined_panel_dimensions.svg 3d/build/outputs/3d_laser_vector-40-elecrow-3mm-acrylic_1x_dimensions.svg
cp 3d/build/laser_parts/elecrow.zip 3d/build/outputs/3d_laser_vector-40-elecrow-3mm-acrylic_1x.zip
- name: Generate animated gif
run: |
xvfb-run --auto-servernum --server-args "-screen 0 1024x768x24" python3 -u 3d/scripts/generate_gif.py
cp 3d/build/animation/animation.gif 3d/build/outputs/3d_animation.gif
cp 3d/build/animation/all_flaps.gif 3d/build/outputs/all_flaps.gif
- name: Generate STLs for web viewer
run: |
python -u 3d/scripts/generate_stl.py
cp -r 3d/build/colored_stl 3d/build/outputs/3d_colored_stl
gzip 3d/build/outputs/3d_colored_stl/*.stl
# FIXME
# - name: Generate animated gif
# run: |
# xvfb-run --auto-servernum --server-args "-screen 0 1024x768x24" python3 -u 3d/scripts/generate_gif.py
# cp 3d/build/animation/animation.gif 3d/build/outputs/3d_animation.gif
# cp 3d/build/animation/all_flaps.gif 3d/build/outputs/all_flaps.gif

# - name: Generate STLs for web viewer
# run: |
# python -u 3d/scripts/generate_stl.py
# cp -r 3d/build/colored_stl 3d/build/outputs/3d_colored_stl
# gzip 3d/build/outputs/3d_colored_stl/*.stl

- name: Archive artifacts
uses: actions/upload-artifact@v2
Expand Down
2 changes: 1 addition & 1 deletion 3d/scripts/generate_2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
logging.info(f'\n\n\nDone rendering to SVG: {svg_output}')

if args.calculate_dimensions:
DIMENSION_SVG_TEMPLATE = '<svg height="40" width="1280" xmlns="http://www.w3.org/2000/svg"><text x="4" y="32" fill="black" style="font-style:normal;font-variant:normal;font-weight:normal;font-size:28;line-height:1.25;font-family:sans-serif;">DIMENSIONS_PLACEHOLDER</text></svg>'
DIMENSION_SVG_TEMPLATE = '<svg height="40" width="1200" xmlns="http://www.w3.org/2000/svg" style="background-color:red;"><text x="4" y="32" fill="black" style="font-style:normal;font-variant:normal;font-weight:normal;font-size:28pt;font-family:sans-serif;">DIMENSIONS_PLACEHOLDER</text></svg>'
module_dimensions_file = os.path.join(laser_parts_directory, os.path.splitext(os.path.basename(svg_output))[0] + '_module_dimensions.svg')
with open(module_dimensions_file, 'w') as f:
f.write(DIMENSION_SVG_TEMPLATE.replace('DIMENSIONS_PLACEHOLDER', f'{output_data["enclosure_width"]}mm width, {output_data["enclosure_height"]}mm height, {output_data["enclosure_length"]}mm depth'))
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,11 +114,11 @@ The v0.7 stable release artifacts can be found at the [v0.7 tagged release](http
### Beta v2 (52-flap modules)
![2d laser cut rendering](https://s3.amazonaws.com/splitflap-artifacts/fontExploration/3d/3d_laser_raster-52.png)

Module dimensions: <img height="1em" src="https://s3.amazonaws.com/splitflap-artifacts/fontExploration/3d/3d_laser_vector-52-module_dimensions.svg" />
Module dimensions: <img height="32" src="https://s3.amazonaws.com/splitflap-artifacts/fontExploration/3d/3d_laser_vector-52-module_dimensions.svg" />

Latest auto-generated (untested!) artifacts<sup>:warning:</sup>:
* For Ponoko 3mm MDF ([svg](https://s3.amazonaws.com/splitflap-artifacts/fontExploration/3d/3d_laser_vector-52-ponoko-3mm-mdf_1x.svg)) <img height="1em" src="https://s3.amazonaws.com/splitflap-artifacts/fontExploration/3d/3d_laser_vector-52-ponoko-3mm-mdf_1x_dimensions.svg" />
* For Ponoko 3mm acrylic ([svg](https://s3.amazonaws.com/splitflap-artifacts/fontExploration/3d/3d_laser_vector-52-ponoko-3mm-acrylic_1x.svg)) <img height="1em" src="https://s3.amazonaws.com/splitflap-artifacts/fontExploration/3d/3d_laser_vector-52-ponoko-3mm-acrylic_1x_dimensions.svg" />
* For Ponoko 3mm MDF ([svg](https://s3.amazonaws.com/splitflap-artifacts/fontExploration/3d/3d_laser_vector-52-ponoko-3mm-mdf_1x.svg)) <img height="32" src="https://s3.amazonaws.com/splitflap-artifacts/fontExploration/3d/3d_laser_vector-52-ponoko-3mm-mdf_1x_dimensions.svg" />
* For Ponoko 3mm acrylic ([svg](https://s3.amazonaws.com/splitflap-artifacts/fontExploration/3d/3d_laser_vector-52-ponoko-3mm-acrylic_1x.svg)) <img height="32" src="https://s3.amazonaws.com/splitflap-artifacts/fontExploration/3d/3d_laser_vector-52-ponoko-3mm-acrylic_1x_dimensions.svg" />
* For generic material (0.18mm kerf correction) ([svg](https://s3.amazonaws.com/splitflap-artifacts/fontExploration/3d/3d_laser_vector-52.svg))
* For Elecrow 3mm Wood ([zipped pdf](https://s3.amazonaws.com/splitflap-artifacts/fontExploration/3d/3d_laser_vector-52-elecrow-3mm-wood_1x.zip))
* For Elecrow 3mm Acrylic ([zipped pdf](https://s3.amazonaws.com/splitflap-artifacts/fontExploration/3d/3d_laser_vector-52-elecrow-3mm-acrylic_1x.zip))
Expand All @@ -128,7 +128,7 @@ Latest auto-generated (untested!) artifacts<sup>:warning:</sup>:
### Beta v2 (40-flap modules)
![2d laser cut rendering](https://s3.amazonaws.com/splitflap-artifacts/fontExploration/3d/3d_laser_raster-40.png)

Module dimensions: <img height="1em" src="https://s3.amazonaws.com/splitflap-artifacts/fontExploration/3d/3d_laser_vector-40-module_dimensions.svg" />
Module dimensions: <img height="32" src="https://s3.amazonaws.com/splitflap-artifacts/fontExploration/3d/3d_laser_vector-40-module_dimensions.svg" />

Latest auto-generated (untested!) artifacts<sup>:warning:</sup>:
* For Ponoko 3mm MDF ([svg](https://s3.amazonaws.com/splitflap-artifacts/fontExploration/3d/3d_laser_vector-40-ponoko-3mm-mdf_1x.svg))
Expand Down

0 comments on commit 2ea648f

Please sign in to comment.