bevy_symbios_shape
Bevy integration for symbios-shape — a CGA Shape Grammar engine for procedural architecture.
Converts grammar outputs (ShapeModel / Terminal nodes) into Bevy entity hierarchies with procedural or asset-based meshes.
Features
- Plugin:
BevySymbiosShapePluginregisters aShapeRegistryresource for mapping grammar IDs to Bevy assets. - Asset routing: Register GLTF scenes and materials by string ID; unregistered terminals fall back to procedural meshes.
- Procedural meshes:
build_profiled_meshgenerates geometry for tapered prisms, triangles, trapezoids, and arbitrary polygons based on the terminal'sFaceProfile. - Coordinate translation:
scope_to_transformhandles the f64→f32 downcast and corner-to-centroid offset betweensymbios-shapescopes and Bevy transforms. - Spawn extension:
commands.spawn_shape(...)derives a grammar and spawns the full terminal hierarchy in one call.
Quick start
use *;
use *;
use ;
Modules
| Module | Purpose |
|---|---|
mesh |
build_profiled_mesh / build_tapered_cuboid — procedural mesh generation |
registry |
ShapeRegistry — asset routing table (mesh IDs → scenes, material IDs → materials) |
spawner |
SpawnShapeExt — Commands extension trait for one-call grammar derivation + spawning |
transform |
scope_to_transform — f64 scope to f32 Bevy Transform with corner-to-centroid offset |
Asset registration
Register GLTF scenes and materials before spawning so the grammar can resolve them:
Terminals whose mesh_id is not registered get a procedural mesh colored by a stable hash of the ID.
Examples
License
MIT