adventOfCode/challenges/2021/22-reactorReboot
2021-12-22 21:13:48 +00:00
..
py Add 2021-22 in Python (part one only) 2021-12-22 19:10:53 +00:00
blender-part-2.png Add 2021-22 in... OpenSCAD and Blender?! 2021-12-22 21:04:03 +00:00
info.json Add 2021-22 in Python (part one only) 2021-12-22 19:10:53 +00:00
openscad-generate.py Tidy up openscad-generate.py 2021-12-22 21:13:48 +00:00
openscad-part-2.png Add 2021-22 in... OpenSCAD and Blender?! 2021-12-22 21:04:03 +00:00
part.1.scad Tidy up openscad-generate.py 2021-12-22 21:13:48 +00:00
part.2.scad Tidy up openscad-generate.py 2021-12-22 21:13:48 +00:00
README.md Add 2021-22 in... OpenSCAD and Blender?! 2021-12-22 21:04:03 +00:00

Day 22: Reactor Reboot

Today's solution is a little weird...

I solved part one using the easy, store every point method. However, for part two, I didn't want to go to the trouble of writing code to work out the intersections of all the cubes. Instead, I chose to do the following:

  • Wrote some Python code (openscad-generate.py) to generate some OpenSCAD code based on the challenge input
    • This made liberal use of nested union(), difference(), translate() and cube() functions
  • Ran this code in OpenSCAD and exported the resultant model as an STL
  • Imported this STL file into Blender and used the 3D-Print Toolbox addon to calculate the total volume of the object
  • Typed this number into the AoC website
  • Obtained the 2nd star ★ :D

openscad

blender