# consciousnesscraft/nurbs-curve architecture

> Architecture diagram of the GitHub repository consciousnesscraft/nurbs-curve, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-05-21). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/consciousnesscraft/nurbs-curve
- Repository: https://github.com/consciousnesscraft/nurbs-curve

## Overview

##### Project type and purpose
- This is a desktop C++ visualization tool (an open-source graphics demo) that computes and renders a Non-Uniform Rational B-Spline (NURBS) curve.
- It reads control points, knot vectors, and weights, computes the curve geometry (plus Frenet frames, osculating circles, curvature radius, balayage surface), and displays everything in an interactive OpenGL window.

##### File structure
- Top-level files only:
- Makefile – build script invoking g++/clang++ and linking graphics libraries
- main.cpp – monolithic source file containing:
· Core NURBS computation routines (basis functions, curve evaluation)
· Data model for control points, weights, knot vectors
· Input/event handling (keyboard controls: v, b, +, –, n, c)
· View-mode toggles and state machine

##### README for additional insights
- Dependencies: C++ compiler, OpenGL (plus a windowing toolkit like GLUT/GLFW), Make

##### Diagramming recommendations
– Group all internal modules in an “NURBS-CURVE App” container
– Position the build system off to the side, feeding into the App container

##### Essential elements to capture
– Clear module boundaries and responsibilities

## Diagram (Mermaid)

```mermaid
flowchart TB
    subgraph "NURBS-CURVE App"
        UI["User Interface / Input Handler"]:::internal
        Comp["NURBS Computation Module"]:::internal
        Rend["Graphics Renderer"]:::internal
        Orch["Application Orchestrator"]:::internal
    end

    OpenGL["OpenGL / GLUT/GLFW"]:::external
    BuildSystem["Build System (Makefile)"]:::external

    UI -.->|"key events"| Orch
    Orch -->|"curve params"| Comp
    Comp -->|"curve data"| Orch
    Orch -->|"geometry data"| Rend
    Rend -->|"draw calls"| OpenGL
    BuildSystem -.->|"compile/link"| Orch

    click UI "https://github.com/consciousnesscraft/nurbs-curve/blob/main/main.cpp"
    click Comp "https://github.com/consciousnesscraft/nurbs-curve/blob/main/main.cpp"
    click Rend "https://github.com/consciousnesscraft/nurbs-curve/blob/main/main.cpp"
    click Orch "https://github.com/consciousnesscraft/nurbs-curve/blob/main/main.cpp"
    click BuildSystem "https://github.com/consciousnesscraft/nurbs-curve/tree/main/Makefile"

    classDef internal fill:#AED6F1,stroke:#1F618D,color:#1F618D,stroke-width:2px;
    classDef external fill:#A9DFBF,stroke:#1E8449,color:#1E8449,stroke-width:2px;
```
