# aniketrajnish/3d-shapes-dataset-generator architecture

> Architecture diagram of the GitHub repository aniketrajnish/3d-shapes-dataset-generator, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/aniketrajnish/3d-shapes-dataset-generator
- Repository: https://github.com/aniketrajnish/3d-shapes-dataset-generator

## Overview

##### Main Components
- User Interface & Experience:
– The UI elements are managed via the “Menu” assets in Assets/Menu (including animations, UI scripts, audio, images, fonts, and prefabs).

- Core Rendering Engine:
– The project relies on a raymarching renderer (see Assets/Scripts/RaymarchRenderer.cs and Raymarcher.cs) that is built on an open source Raymarching Engine.

- Dataset Generation Subsystem:

- Screenshot & Data Export Utility:
– Found within the Assets/ScreenshotUtility folder, this part manages capturing the rendered images (screenshots) and exporting data (including CSV files that log parameter values and seed details) to the designated dataset folder.

- Configuration & Project Settings:
– The Unity ProjectSettings and Package files (e.g., manifest.json, ProjectSettings/*.asset) indicate how the runtime environment and dependencies are set up.
– They also reflect important engine-level configurations for input, graphics, quality, etc.

##### Relationships and Interactions
- The UI (Menu) accepts user inputs and sets parameters which are fed into the data generation pipeline.
- The Dataset Generation Subsystem leverages these parameters to drive procedural generation by triggering:
- Once the scene is rendered, the Screenshot Utility captures the image output.
- Finally, the processed images and metadata are stored in the output directory (as mentioned in the README under the “Datasets” section).

##### Architectural Patterns & Design Principles
- Modular design: Each major function (UI, rendering, dataset management, image export) is organized into separate directories and assets for easier maintenance.
- Separation of concerns: The project clearly divides responsibilities (front-end interaction vs. back-end rendering logic vs. data management).
- Leverages Unity’s component-based architecture: Scripts (e.g., MenuScript.cs, SceneViewFilter.cs) act as components attached to GameObjects enabling a dynamic and scalable design.
- Reuse of third-party libraries and utilities (e.g., TextMesh Pro for UI text, and external plugins like AnotherFileBrowser) to extend functionality.

##### Relevant Technologies, Frameworks, & Libraries
- Unity Engine (version 2020.3.30f1 or later).
- C# scripting for custom behaviors.
- Shader programming (using .shader and .cginc files) for raymarching and rendering effects.
- External dependencies include the open source Raymarching Engine which the tool builds upon.
- Standard Unity packages and assembly definitions (*.asmdef for Editor scripts).

## Diagram (Mermaid)

```mermaid
graph TD
    UI["UI/Menu System"]:::ui
    PD["Procedural Dataset Generation"]:::proc

    subgraph "Core Rendering Engine"
        R["Raymarch Renderer"]:::engine
        S["Shaders"]:::engine
    end

    SS["Screenshot & Data Export Utility"]:::utility
    OUT["Output (Images & CSV)"]:::output

    subgraph "Configuration & Environment Setup"
        CP["Project Settings"]:::config
        PK["Packages"]:::config
    end

    UI -->|"sets_params"| PD
    PD -->|"triggers_rendering"| R
    PD -->|"triggers_rendering"| S
    CP -->|"setup"| R
    CP -->|"setup"| S
    PK -->|"setup"| R
    PK -->|"setup"| S
    R -->|"renders_scene"| SS
    S -->|"applies_visuals"| SS
    SS -->|"exports_data"| OUT

    click UI "https://github.com/aniketrajnish/3d-shapes-dataset-generator/tree/main/src/3D Shapes Dataset Generator/Assets/Menu"
    click PD "https://github.com/aniketrajnish/3d-shapes-dataset-generator/blob/main/src/3D Shapes Dataset Generator/Assets/Scripts/ShapeBatch.cs"
    click R "https://github.com/aniketrajnish/3d-shapes-dataset-generator/blob/main/src/3D Shapes Dataset Generator/Assets/Scripts/RaymarchRenderer.cs"
    click S "https://github.com/aniketrajnish/3d-shapes-dataset-generator/tree/main/src/3D Shapes Dataset Generator/Assets/Shaders"
    click SS "https://github.com/aniketrajnish/3d-shapes-dataset-generator/tree/main/src/3D Shapes Dataset Generator/Assets/ScreenshotUtility"
    click CP "https://github.com/aniketrajnish/3d-shapes-dataset-generator/tree/main/src/3D Shapes Dataset Generator/ProjectSettings"
    click PK "https://github.com/aniketrajnish/3d-shapes-dataset-generator/tree/main/src/3D Shapes Dataset Generator/Packages"

    classDef ui fill:#f8ccff,stroke:#8a2be2,stroke-width:2px;
    classDef proc fill:#ccffcc,stroke:#228b22,stroke-width:2px;
    classDef engine fill:#ffd700,stroke:#d4af37,stroke-width:2px;
    classDef utility fill:#87cefa,stroke:#4682b4,stroke-width:2px;
    classDef output fill:#e6e6fa,stroke:#9370db,stroke-width:2px;
    classDef config fill:#ffcccb,stroke:#f08080,stroke-width:2px;
```
