This repository contains a Python script to generate Sphere blueprints for Dyson Sphere Program. The script implements several operators from Conway Polyhedral Notation to create customizable polyhedra and outputs blueprints in a format that the game can understand. Example outputs are provided as 240.txt, 320.txt, and 1280.txt.
- Python 3.x
- Clone the repository to your local machine:
git clone https://github.com/Cosmin1490/DysonSphereProgram-BlueprintGenerator.git- Change into the newly created directory:
cd DysonSphereProgram-BlueprintGenerator/- Install the required packages with pip:
pip install -r requirements.txt- Run the script:
python3 script.pyThe script will print out a blueprint.
You can customize the generated blueprint by modifying the parameters in the script.py file. The relevant section of the code is as follows:
icosahedron = Polyhedron.create_icosahedron()
icosahedron.coxeter_operator()
icosahedron.coxeter_operator()
icosahedron.dual_operator()This code generates an icosahedron and applies Conway Polyhedral Notation operations to create a new polyhedron. The result can be visualized here.
To change the base polyhedron, replace Polyhedron.create_icosahedron() with the appropriate method for the desired polyhedron.
To apply a different Conway operation, call the corresponding method on the polyhedron object.
For example, to create a dodecahedron:
polyhedron = Polyhedron.create_icosahedron()
polyhedron.dual_operator()Additional Changes:
Polyhedron class supports the obj format exported from Polyhedronisme. This functionality can be used like so:
with open(filepath, "r") as file:
file_content = file.read()
polyhedron = Polyhedron.create_from_polyhedronisme_obj_file(file_content)The main entry point of the project is script.py.
BinaryWriter: A class for writing binary dataDysonFrame: A class for representing a frame in the blueprintDysonNode: A class for representing a node in the blueprintDysonShell: A class for representing a shell in the blueprintDysonSphereLayer: A class for representing a layer in the blueprintPolyhedron: A class for creating and manipulating polyhedra
If you'd like to contribute to this project, feel free to fork the repository and submit a pull request. I welcome any improvements or bug fixes. Please read Contributing Guidelines for information on how to report bugs, request features, submit pull requests, and more
This project is licensed under the GNU General Public License v3.0. See the LICENSE file for more information.