Skip to content

CasperH2O/3DMarbleMazeGenerator

Repository files navigation

3D marble puzzle obstacle track generator

Software application, written in Python to generate 3D printable design files (STL) of a marble obstacle track. Inspired by puzzle balls from Perplexus, Playtastic, Intrism, Magical Intellect and Sharper Image.

Path Visualization 3D Image Physical Result

Path Visualization 2 3D Image 2 Physical Result 2

Usage

For practicality, the application can be run in separate parts. A puzzle generation with paths and plot visualization and a 3D solid modeller that generates a puzzle and then creates and visualizes the 3D model for export. Both rely on the parameters set in the config.py file

The config.py file contains parameters that can be adjusted for type, size and shape of enclosure, path types, theme colors and more.

Puzzle generation

The puzzle route, for paths, curve types and node grid can be generated and visualized separately. To generate a puzzle, based on settings in the config.py file and open a visualization (Plotly-generated HTML file) in your browser, run:

generate_puzzle.py

Results in an HTML file which opens in the browser to showcase the enclosure shape, node grid, paths and path curve types divided by segments:

Path Visualization Large

Model assembly

The 3D shape objects and physical enclosure are generated and visualized through the model assembly script. A puzzle is generated from which the printable shapes are created by running:

python -m model_assembly

Results in a 3D model made out of separate solid bodies for the enclosure, path, path accent, support material and a marble path indicator:

3D Large

Path Profile Overview

For quick visualization and debugging, all the path profiles, also called path cross sections can be 3D modelled by running:

path_profiles_overview.py

This results in an overview with all path profiles, including their path accent color and support material swept along a straight line. A red color color is used to indicate the path does not have any adjustments yet in the configuration:

Path Profiles Overview

Obstacles

Obstacled can be randomly or manually selected and placed (xyz and orientation) in the puzzle. The obstacles feature as start and end node that can be connected with paths. Through the usage of a node grid, collisions and occupancy can be handled.

For quick visualization and debugging, all the obstacles currently in the obstacle catalogue can be 3D modelled by running:

obstacle_overview.py

This results in the following overview:

Obstacle Overview

Individual obstacles can be both plotted and 3D modelled by running their individual obstacle files in /obstacles/catalogue for example, spiral.py can be run by:

python -m obstacles.catalogue.spiral

This results in a 3D model, including the occupied and overlap nodes:

Obstacle Spiral 3D

This also results in a plot, with a sampled path, occupied and overlap nodes:

Obstacle Spiral plot

Browser based configurator

A puzzle can be created in the browser and previewed. Allows for quick iteration through different seed values, amount of waypoints and enclosures.

Can be run and opens in the browser automatically with:

streamlit run .\designer_app.py

Browser Based Generator

Requirements

Python 3.11 requirements.txt is availible for dependencies

For the 3D model visualization, the Visual Studio Code extension OCP CAD Viewer or it's standalone mode is required.

References

About

Application to generate a marble dexterity puzzle 3D printable design files.

Resources

Stars

Watchers

Forks

Contributors

Languages