# donkie/i3dshapestool architecture

> Architecture diagram of the GitHub repository donkie/i3dshapestool, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-24). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/donkie/i3dshapestool
- Repository: https://github.com/donkie/i3dshapestool

## Overview

I3DShapesTool is a command-line extractor and converter for GIANTS Engine `.i3d.shapes` files. The main workflow starts with a user supplying a file, then the CLI loads its encrypted entity container, decodes shape and spline parts, and exports geometry as Wavefront OBJ. The repository also includes I3D XML scene parsing and transform support, which the CLI references for scene-aware processing. The map follows documented capabilities and source-index references; unsampled implementation details are represented only where those references support a relationship.

Main entry points: [`I3DShapesTool/Program.cs`](https://github.com/donkie/i3dshapestool/blob/master/I3DShapesTool/Program.cs) (Extraction CLI), [`I3DShapesTool.Lib/Model/ShapesFile.cs`](https://github.com/donkie/i3dshapestool/blob/master/I3DShapesTool.Lib/Model/ShapesFile.cs) (Shapes File Model), [`I3DShapesTool.Lib/Container/ShapesFileReader.cs`](https://github.com/donkie/i3dshapestool/blob/master/I3DShapesTool.Lib/Container/ShapesFileReader.cs) (Container Reader), [`I3DShapesTool.Lib/Container/Cipher/CipherStream.cs`](https://github.com/donkie/i3dshapestool/blob/master/I3DShapesTool.Lib/Container/Cipher/CipherStream.cs) (Cipher Stream)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["Command-line"]
  node_program["Extraction CLI<br/>[Program.cs]"]
  node_options["CLI Options"]
end

subgraph group_container["File Container"]
  node_reader["Container Reader"]
  node_cipherstream["Cipher Stream<br/>[CipherStream.cs]"]
  node_cipher["I3D Cipher<br/>[I3DCipher.cs]"]
  node_entity["Raw Entities<br/>[Entity.cs]"]
end

subgraph group_model["Shape Model"]
  node_shapesfile["Shapes File Model<br/>[ShapesFile.cs]"]
  node_part["Part Decoder<br/>[I3DPart.cs]"]
  node_shape["Shape Geometry<br/>[I3DShape.cs]"]
  node_spline["Spline Data<br/>[Spline.cs]"]
end

subgraph group_export["Scene and Export"]
  node_xmlreader["I3D XML Reader<br/>[I3DXMLReader.cs]"]
  node_scene["I3D Scene Model<br/>[I3D.cs]"]
  node_transformgroup["Transform Groups<br/>[TransformGroup.cs]"]
  node_transform["3D Transform<br/>[Transform.cs]"]
  node_obj["Wavefront Exporter<br/>[WavefrontObj.cs]"]
end

node_user(("CLI User"))
node_destination["OBJ File"]

node_user -->|"supplies file"| node_program
node_program -->|"reads options"| node_options
node_program -->|"loads shapes"| node_shapesfile
node_shapesfile -->|"reads container"| node_reader
node_reader -->|"decrypts stream"| node_cipherstream
node_cipherstream -->|"uses cipher"| node_cipher
node_reader -->|"reads entities"| node_entity
node_shapesfile -->|"decodes parts"| node_part
node_shapesfile -->|"loads shape parts"| node_shape
node_shapesfile -->|"loads spline parts"| node_spline
node_program -->|"parses scene XML"| node_xmlreader
node_xmlreader -->|"builds hierarchy"| node_transformgroup
node_transformgroup -->|"computes transforms"| node_transform
node_program -->|"applies transforms"| node_transform
node_program -->|"exports geometry"| node_obj
node_obj -->|"writes OBJ"| node_destination

click node_program "https://github.com/donkie/i3dshapestool/blob/master/I3DShapesTool/Program.cs"
click node_options "https://github.com/donkie/i3dshapestool/blob/master/I3DShapesTool/Configuration/CommandLineOptions.cs"
click node_shapesfile "https://github.com/donkie/i3dshapestool/blob/master/I3DShapesTool.Lib/Model/ShapesFile.cs"
click node_reader "https://github.com/donkie/i3dshapestool/blob/master/I3DShapesTool.Lib/Container/ShapesFileReader.cs"
click node_cipherstream "https://github.com/donkie/i3dshapestool/blob/master/I3DShapesTool.Lib/Container/Cipher/CipherStream.cs"
click node_cipher "https://github.com/donkie/i3dshapestool/blob/master/I3DShapesTool.Lib/Container/Cipher/I3DCipher.cs"
click node_entity "https://github.com/donkie/i3dshapestool/blob/master/I3DShapesTool.Lib/Container/Entity.cs"
click node_part "https://github.com/donkie/i3dshapestool/blob/master/I3DShapesTool.Lib/Model/I3DPart.cs"
click node_shape "https://github.com/donkie/i3dshapestool/blob/master/I3DShapesTool.Lib/Model/I3DShape.cs"
click node_spline "https://github.com/donkie/i3dshapestool/blob/master/I3DShapesTool.Lib/Model/Spline.cs"
click node_xmlreader "https://github.com/donkie/i3dshapestool/blob/master/I3DShapesTool.Lib/Model/I3D/I3DXMLReader.cs"
click node_scene "https://github.com/donkie/i3dshapestool/blob/master/I3DShapesTool.Lib/Model/I3D/I3D.cs"
click node_transformgroup "https://github.com/donkie/i3dshapestool/blob/master/I3DShapesTool.Lib/Model/I3D/TransformGroup.cs"
click node_transform "https://github.com/donkie/i3dshapestool/blob/master/I3DShapesTool.Lib/Tools/Transform.cs"
click node_obj "https://github.com/donkie/i3dshapestool/blob/master/I3DShapesTool.Lib/Export/WavefrontObj.cs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_program,node_options,node_user toneBlue
class node_reader,node_cipherstream,node_cipher,node_entity toneAmber
class node_shapesfile,node_part,node_shape,node_spline toneMint
class node_xmlreader,node_scene,node_transformgroup,node_transform,node_obj toneRose
class node_destination toneIndigo
```

## Components

### Command-line

- [Extraction CLI](https://github.com/donkie/i3dshapestool/blob/master/I3DShapesTool/Program.cs): `I3DShapesTool/Program.cs`
- [CLI Options](https://github.com/donkie/i3dshapestool/blob/master/I3DShapesTool/Configuration/CommandLineOptions.cs): `I3DShapesTool/Configuration/CommandLineOptions.cs`

### File Container

- [Container Reader](https://github.com/donkie/i3dshapestool/blob/master/I3DShapesTool.Lib/Container/ShapesFileReader.cs): `I3DShapesTool.Lib/Container/ShapesFileReader.cs`
- [Cipher Stream](https://github.com/donkie/i3dshapestool/blob/master/I3DShapesTool.Lib/Container/Cipher/CipherStream.cs): `I3DShapesTool.Lib/Container/Cipher/CipherStream.cs`
- [I3D Cipher](https://github.com/donkie/i3dshapestool/blob/master/I3DShapesTool.Lib/Container/Cipher/I3DCipher.cs): `I3DShapesTool.Lib/Container/Cipher/I3DCipher.cs`
- [Raw Entities](https://github.com/donkie/i3dshapestool/blob/master/I3DShapesTool.Lib/Container/Entity.cs): `I3DShapesTool.Lib/Container/Entity.cs`

### Shape Model

- [Shapes File Model](https://github.com/donkie/i3dshapestool/blob/master/I3DShapesTool.Lib/Model/ShapesFile.cs): `I3DShapesTool.Lib/Model/ShapesFile.cs`
- [Part Decoder](https://github.com/donkie/i3dshapestool/blob/master/I3DShapesTool.Lib/Model/I3DPart.cs): `I3DShapesTool.Lib/Model/I3DPart.cs`
- [Shape Geometry](https://github.com/donkie/i3dshapestool/blob/master/I3DShapesTool.Lib/Model/I3DShape.cs): `I3DShapesTool.Lib/Model/I3DShape.cs`
- [Spline Data](https://github.com/donkie/i3dshapestool/blob/master/I3DShapesTool.Lib/Model/Spline.cs): `I3DShapesTool.Lib/Model/Spline.cs`

### Scene and Export

- [I3D XML Reader](https://github.com/donkie/i3dshapestool/blob/master/I3DShapesTool.Lib/Model/I3D/I3DXMLReader.cs): `I3DShapesTool.Lib/Model/I3D/I3DXMLReader.cs`
- [I3D Scene Model](https://github.com/donkie/i3dshapestool/blob/master/I3DShapesTool.Lib/Model/I3D/I3D.cs): `I3DShapesTool.Lib/Model/I3D/I3D.cs`
- [Transform Groups](https://github.com/donkie/i3dshapestool/blob/master/I3DShapesTool.Lib/Model/I3D/TransformGroup.cs): `I3DShapesTool.Lib/Model/I3D/TransformGroup.cs`
- [3D Transform](https://github.com/donkie/i3dshapestool/blob/master/I3DShapesTool.Lib/Tools/Transform.cs): `I3DShapesTool.Lib/Tools/Transform.cs`
- [Wavefront Exporter](https://github.com/donkie/i3dshapestool/blob/master/I3DShapesTool.Lib/Export/WavefrontObj.cs): `I3DShapesTool.Lib/Export/WavefrontObj.cs`

### Other components

- **CLI User**
- **OBJ File**

## Connections

- CLI User → Extraction CLI: supplies file
- Extraction CLI → CLI Options: reads options (evidence: `I3DShapesTool/Program.cs`)
- Extraction CLI → Shapes File Model: loads shapes (evidence: `I3DShapesTool/Program.cs`)
- Shapes File Model → Container Reader: reads container (evidence: `I3DShapesTool.Lib/Model/ShapesFile.cs`)
- Container Reader → Cipher Stream: decrypts stream (evidence: `I3DShapesTool.Lib/Container/ShapesFileReader.cs`)
- Cipher Stream → I3D Cipher: uses cipher (evidence: `I3DShapesTool.Lib/Container/Cipher/CipherStream.cs`)
- Container Reader → Raw Entities: reads entities (evidence: `I3DShapesTool.Lib/Container/ShapesFileReader.cs`)
- Shapes File Model → Part Decoder: decodes parts (evidence: `I3DShapesTool.Lib/Model/ShapesFile.cs`)
- Shapes File Model → Shape Geometry: loads shape parts (evidence: `I3DShapesTool.Lib/Model/ShapesFile.cs`)
- Shapes File Model → Spline Data: loads spline parts (evidence: `I3DShapesTool.Lib/Model/ShapesFile.cs`)
- Extraction CLI → I3D XML Reader: parses scene XML (evidence: `I3DShapesTool/Program.cs`)
- I3D XML Reader → Transform Groups: builds hierarchy (evidence: `I3DShapesTool.Lib/Model/I3D/I3DXMLReader.cs`)
- Transform Groups → 3D Transform: computes transforms (evidence: `I3DShapesTool.Lib/Model/I3D/TransformGroup.cs`)
- Extraction CLI → 3D Transform: applies transforms (evidence: `I3DShapesTool/Program.cs`)
- Extraction CLI → Wavefront Exporter: exports geometry (evidence: `I3DShapesTool/Program.cs`)
- Wavefront Exporter → OBJ File: writes OBJ
