How tarydon/nori works
Purpose and Structure
Nori is a C# foundation for 2D/3D geometry and engineering applications: geometry, drawings, models, meshing, simulation, interchange formats, and OpenGL visualization. The main reusable library is Core/Nori.Core.csproj; solution-level composition is in Nori.slnx and Nori.proj.
Entry Points and Hosts
There is no single product executable. Consumers enter through the Core library or runnable shells/demos:
• Console demos: Demos/ConShell/Program.cs, Demos/BenchShell/Program.cs
• OpenGL demo: Demos/GLShell/Program.cs
• WPF interactive demo: Demos/WPFDemo/App.xaml, Demos/WPFDemo/MainWindow.xaml.cs
• Developer console: Tools/Console/Console.cs, Tools/Console/Commands.cs
Host adapters isolate windowing, input, dispatch, and OpenGL-context concerns from application/model code: Host/GLFW/Host.cs, Host/WPF/Host.cs, Host/WPF/OpenGL.cs.
Core Geometry and 2D Drawing
Core/Geom is the computational foundation: points/vectors/matrices, bounds, curves/polygons, collision, tessellation, convex hulls, and NURBS. Key paths are Core/Geom/Point.cs, Core/Geom/PolyOps.cs, and Core/Geom/FastTess2D.cs.
2D CAD-like drawing entities and operations sit above that layer in Core/Drawing, including drawing representation, snapping, stitching, dimensions, and line fonts: Core/Drawing/Ent2.cs, Core/Drawing/Dwg2.cs, Core/Drawing/DwgSnap.cs. The primary boundary is geometric primitives versus user-facing drawing/entity semantics.
3D Models, Meshes, and Sheet Metal
The 3D model layer represents curves, surfaces, and entities: Core/Model/Ent3.cs, Core/Model/E3Surface.cs, Core/Model/Model3.cs. Mesh construction and topology form a downstream discretized representation for rendering or engineering operations: Core/Mesh/Mesh.cs, Core/Mesh/MeshBuild.cs, Core/Mesh/CSMesher.cs.
Sheet-metal processing is a distinct model transformation pipeline: flexible/flat forms and bend data are processed by Core/Model/Tenkai/SheetMetalizer.cs and Core/Model/Tenkai/Unfolder.cs. Typical flow is imported or constructed geometry → model/surface entities → mesh or flattened sheet output.
File and Resource Boundaries
Core/IO owns parsing and serialization rather than exposing file formats directly to geometry code. Supported boundaries include DXF, STEP, STL, PNG, T3X, and custom stream formats: Core/IO/DXF/DXFReader.cs, Core/IO/STEP/STPReader.cs, Core/IO/STL.cs.
Runtime assets are repository-managed under Wad, including DXF fonts/ignore lists and OpenGL shaders: Wad/DXF/default.lfont, Wad/GL/Shader/Index.txt, Wad/AuManifest.txt. NORIROOT locates this repository/resource root.
Simulation and Spatial Queries
Simulation components build on geometric and mesh representations for mechanisms, collision, and broad-phase acceleration. Important components are Core/Sim/Mechanism.cs, Core/Sim/OBBTree.cs, and Core/Sim/OBBCollider.cs. This creates a control flow from modeled meshes/entities into bounding-volume construction and collision/kinematic evaluation.
Rendering Stack
Lux is the rendering/scene layer over OpenGL: Lux/Lux.cs, Lux/Scene/Scene.cs, Lux/Shader/Shader.cs. View-node adapters bridge domain objects to GPU/renderable scene nodes, e.g. Lux/VNodes/Ent2VN.cs, Lux/VNodes/Ent3VN.cs, and Lux/VNodes/MechanismVN.cs.
Rendering depends on an OpenGL runtime and platform host implementation—GLFW or WPF—not external network services. Shader source is loaded from Wad/GL/Shader; font rendering is represented by Lux/Font/FreeType.cs and bundled font assets.
Main entry points: Model3.cs 3D Model · Mechanism.cs Simulation · Lux.cs Lux renderer · Ent3VN.cs View-node adapters
Components 18
Core domain
Reusable geometry, modeling, engineering, and file boundaries.
- Nori Core · Main reusable foundation library.
Core/Nori.Core.csproj - Geometry kernel · Computational primitives, curves, polygons, and tessellation.
Core/Geom - 2D Drawing · CAD-like entities and drawing operations.
Core/Drawing - 3D Model · Curves, surfaces, and 3D entities.
Core/Model/Model3.cs - Mesh topology · Discretized mesh construction and topology.
Core/Mesh/MeshBuild.cs - Sheet metal · Bend processing and unfolding pipeline.
Core/Model/Tenkai/SheetMetalizer.cs - Format I/O · Parses and writes engineering interchange formats.
Core/IO - Simulation · Mechanisms, broad phase, and collision evaluation.
Core/Sim/Mechanism.cs - OBB acceleration · Bounding-volume trees and collision tests.
Core/Sim/OBBTree.cs
Rendering and hosts
Scene rendering, platform adapters, and runnable shells.
- Lux renderer · OpenGL scene and shader rendering layer.
Lux/Lux.cs - Scene graph · Renderable scene composition.
Lux/Scene/Scene.cs - View-node adapters · Converts drawing, model, and mechanism objects into render nodes.
Lux/VNodes/Ent3VN.cs - Platform hosts · Isolates windowing, input, dispatch, and GL contexts.
Host/GLFW/Host.cs - Console shells · Demo and developer console entry points.
Demos/ConShell/Program.cs - OpenGL demo
Demos/GLShell/Program.cs - WPF demo · Interactive WPF application entry point.
Demos/WPFDemo/App.xaml
Resources
Repository-managed runtime assets.
- Wad assets · Shaders, fonts, and format resources located through NORIROOT.
Wad - Shader sources
Wad/GL/Shader
Connections 21
- Nori Core → Geometry kernel: contains
- Geometry kernel → 2D Drawing: primitives for
- Geometry kernel → 3D Model: primitives for
- 3D Model → Mesh topology: discretizes to
- 3D Model → Sheet metal: processed by
- Format I/O → 2D Drawing: imports / exports
- Format I/O → 3D Model: imports / exports
- 3D Model → Simulation: drives
- Mesh topology → Simulation: supports
- Simulation → OBB acceleration: uses
- 2D Drawing → View-node adapters: adapted by
- 3D Model → View-node adapters: adapted by
- Simulation → View-node adapters: adapted by
- View-node adapters → Scene graph: populates
- Scene graph → Lux renderer: rendered by
- Lux renderer → Platform hosts: requires GL context
- Wad assets → Format I/O: provides fonts and lists
- Shader sources → Lux renderer: loaded by
- Console shells → Nori Core: consumes
- OpenGL demo → Lux renderer: runs
- WPF demo → Platform hosts: uses WPF host