{{description>Reference for all data types used in the Curvy Generator: what they carry, how they relate to each other, and how to create your own.}} ====== Data Types ====== Every module in the Curvy Generator exchanges data through its slots. This page describes all the data types those slots can carry. ===== Type Hierarchy ===== Types can inherit from each other. A slot that accepts a [[#Shape]] will also accept a [[#Path]], because Path extends Shape (it carries everything Shape does, plus more). This lets you connect modules flexibly without needing exact type matches. Inheritance tree:
Root
├── Shape
│   └── Path
│       └── Volume
├── Bounds
│   ├── GameObject
│   └── VMesh
├── VSubMesh
└── Spots
===== Type Reference ===== Short descriptions of each type, from a user perspective. ==== Shape ==== A 2D outline made of sample points. Used for example as the cross-section in extrusions. Carries: * **Positions** - the 2D points of the outline (on the X/Y plane only) * **Normals** - the outward direction at each point * **Material and UV settings** - what points belong to which material, and what UV to apply Shape must lie strictly on the X/Y plane. ==== Path ==== //Extends [[#Shape]]// A 3D curve made of sample points. Used for example as the spine along which shapes are extruded or objects are placed. Carries everything Shape carries, plus: * **Directions** - the forward tangent at each point (where the path is heading) ==== Volume ==== //Extends [[#Path]] → [[#Shape]]// The result of extruding a Shape along a Path. Contains the full 3D surface data needed to build a mesh. Carries everything Path carries, plus: * **Vertices** - 3D positions of the surface points * **Vertex normals** - surface normals * **Cross distances** - relative positions of each point along the cross-section ==== Bounds ==== A bounding box. Used to know the size of a mesh or GameObject, so other modules (like [[.:modules:volumespots|Volume Spots]]) can place objects without overlap. Carries: * **Bounds** - a Unity [[https://docs.unity3d.com/ScriptReference/Bounds.html|Bounds]] value (center + size) ==== GameObject ==== //Extends [[#Bounds]]// A reference to a Unity GameObject or Prefab, along with an optional local TRS offset. Carries everything Bounds carries, plus: * **Object** - the GameObject reference * **Translate, Rotate, Scale** - optional offset applied when placing the object ==== VMesh ==== //Extends [[#Bounds]]// Mesh data ready to be turned into a Unity Mesh. One VMesh can contain multiple submeshes (one per material). Carries everything Bounds carries, plus: * **Vertices** - 3D positions * **UV, UV2** - texture coordinates * **Normals** - surface normals * **Tangents** - surface tangents * **Sub-meshes** - list of [[#VSubMesh]] entries, one per material ==== VSubMesh ==== One submesh within a [[#VMesh]]. Each submesh is associated to one material slot on the final Unity mesh. Carries: * **Triangles** - vertex index triplets defining the mesh faces * **Material** - the Unity material to apply ==== Spots ==== A list of placement points. Each spot tells a module where to place an object and which object from the input array to use. Carries, per spot: * **Index** - which item from the input list to place (0 = first, 1 = second, …) * **Position** - where to place it * **Rotation** - which way it faces * **Scale** - how big it is