optic-core
Shared types, geometry, errors, and utilities for the Optic engine.
Reused by every other Optic crate. Defines the common vocabulary: coordinates, sizes, clip distances, draw modes, image formats, ANSI console colours, logging macros, and error types.
Key types
| Type | Description |
|---|---|
Size2D / Size3D |
Integer width/height/depth |
Coord2D / CoordOffset |
Floating-point coordinates and deltas |
ClipDist |
Near/far clip planes |
CamProj |
Perspective vs orthographic |
OpticError / OpticResult |
Error type with string messages |
ANSI |
Terminal colour wrappers |
[DrawMode], [ImgFormat], [PolyMode], [Cull], [ImgFilter], [ImgWrap] |
Rendering enums |
[Log] |
Console logging macros |
use ;
let size = from;
let pos = from;