lib-math · crate

kinogaki-math

Libraryenvironment

Kinogaki's vectors, points, matrices, quaternions and deterministic elementary functions.

Repository
lib-math (kinogaki/lib-math)
Folder
libs/lib-math/crates/math
Source
23 files, 5,513 lines
Tests
11 files, 2,034 lines
Depends on This crate Used by Kinogaki Studio's headless plugin API.kinogaki-studio-api kinogaki-math Studio's document: the scene, a tree of objects under one root, and the core network each object of a kind naming a context holds.kinogaki-document Kinogaki Studio's editor: the document and everything the window shows of it, as parts one frame borrows one by one.kinogaki-editor Geometry, curves and B-reps in the viewport, independent of any GPU API: the SDK's standard values as surface packets (over the SDK's display triangulation and shading normals, so Solid draws what Render renders), the one picker that answers rays and boxes ...kinogaki-geometry-view `ImagePipeline`: what renders become on screen and in files.kinogaki-image-pipeline L-systems for the Mesh context's L-System node.kinogaki-lsystem The Mesh plugin: polygon modelling, Maya's and Houdini's toolset on core's editing API (`plugins/mesh/PLAN.md` holds the inventory and its groups).kinogaki-mesh Studio's project files: a document as a Prism document.kinogaki-project Studio's scene: the document cooked object by object.kinogaki-scene lib-script's engine: a column (batch) interpreter in safe Rust.kinogaki-script-exec lib-script's column IR: typed SSA values (vectors as groups of scalar values) in structured regions; lowering from the checked program; uniform/varying analysis; optimisation; a verifier; and the fault table that maps instructions back to source spans.kinogaki-script-ir lib-script's function library.kinogaki-script-lib The plugin SDK's UI layer over lib-ui: the SDK's [`Ui`](studio_ui_api::Ui) and [`Painter`](studio_ui_api::Painter), its sheets and the host's services, implemented over lib-ui.kinogaki-sdk-ui Kinogaki Studio's core testkit: toy packages written against the SDK alone, so core is tested with no real plugin.kinogaki-testkit Kinogaki viewport core: what a 3D viewport shows, independent of any GPU API or UI toolkit.kinogaki-viewport-core Kinogaki's wgpu viewport renderer: pipelines, retained GPU buffers, offscreen multisampled targets and owned WGSL shaders.kinogaki-viewport-gpu Kinogaki viewport widgets for Kinogaki UI (lib-ui): one/four-view layout, camera navigation, the six-axis view cube, transform gizmo handles and point number labels.kinogaki-viewport-ui
depends onused by tests alonedependencies for tests alone are listed below, not drawn

What it is

Kinogaki's vectors, points, matrices, quaternions and deterministic elementary functions.

f64 is the default: Vec2, Vec3, Vec4, Mat3, Mat4, Quat, Point2, Point3, Affine3, Frame. The f32 types carry an f suffix (Vec3f, Mat4f) and exist for the GPU boundary; converting between them is always explicit (as_f32, as_f64).

Everything is plain IEEE arithmetic in a fixed order: no fused multiply-add, no reassociation, no SIMD that would change rounding. The vector, matrix and quaternion formulas are glam 0.30's (which Studio used before this crate), so results are bit-identical to it; trigonometry in those types is the platform's std, as glam's was.

units says what the numbers mean: LengthUnit, UpAxis and Units::conversion between two documents' units.

sdk (feature studio-sdk) converts to and from the Studio SDK's plain maths types.

elementary holds the CAD kernel's deterministic sin, cos, atan2, exp, ln, … : built only from + − × ÷ sqrt, identical bits on every OS, with documented error bounds.

Depends on

CrateRepositoryAsWhat it is
kinogaki-studio-apiSDKnormalKinogaki Studio's headless plugin API.

Third-party

CrateVersionLicenceFrozen inAsAlso used by
bytemuck1.25.2Zlib OR Apache-2.0 OR MITlib-ui/vendornormalkinogaki-composit-wgpu, kinogaki-geometry, kinogaki-geometry-view, kinogaki-image-pipeline, kinogaki-pixel, kinogaki-ui, kinogaki-ui-wgpu, kinogaki-viewport-api and 2 more

Used by

CrateRepositoryAsWhat it is
kinogaki-documentCore and the appnormalStudio's document: the scene, a tree of objects under one root, and the core network each object of a kind naming a context holds.
kinogaki-editorCore and the appnormalKinogaki Studio's editor: the document and everything the window shows of it, as parts one frame borrows one by one.
kinogaki-geometry-viewCore and the appnormalGeometry, curves and B-reps in the viewport, independent of any GPU API: the SDK's standard values as surface packets (over the SDK's display triangulation and shading normals, so Solid draws what Render renders), the one picker that answers rays and boxes ...
kinogaki-image-pipelineCore and the appnormalImagePipeline: what renders become on screen and in files.
kinogaki-lsystemMeshnormalL-systems for the Mesh context's L-System node.
kinogaki-meshMeshnormalThe Mesh plugin: polygon modelling, Maya's and Houdini's toolset on core's editing API (plugins/mesh/PLAN.md holds the inventory and its groups).
kinogaki-projectCore and the appnormalStudio's project files: a document as a Prism document.
kinogaki-sceneCore and the appnormalStudio's scene: the document cooked object by object.
kinogaki-script-execlib-scriptnormallib-script's engine: a column (batch) interpreter in safe Rust.
kinogaki-script-irlib-scriptnormallib-script's column IR: typed SSA values (vectors as groups of scalar values) in structured regions; lowering from the checked program; uniform/varying analysis; optimisation; a verifier; and the fault table that maps instructions back to source spans.
kinogaki-script-liblib-scriptnormallib-script's function library.
kinogaki-sdk-uiCore and the appnormalThe plugin SDK's UI layer over lib-ui: the SDK's Ui and Painter, its sheets and the host's services, implemented over lib-ui.
kinogaki-testkitCore and the appnormalKinogaki Studio's core testkit: toy packages written against the SDK alone, so core is tested with no real plugin.
kinogaki-viewport-corelib-viewportnormalKinogaki viewport core: what a 3D viewport shows, independent of any GPU API or UI toolkit.
kinogaki-viewport-gpulib-viewportnormalKinogaki's wgpu viewport renderer: pipelines, retained GPU buffers, offscreen multisampled targets and owned WGSL shaders.
kinogaki-viewport-uilib-viewportnormalKinogaki viewport widgets for Kinogaki UI (lib-ui): one/four-view layout, camera navigation, the six-axis view cube, transform gizmo handles and point number labels.

Modules

Public types and traits

At the crate root

Structs Affine3FrameMaskMat3Mat4Mat4fQuatUnits

Enums EulerOrderLengthUnitUpAxis

By module: 14 public types and traits in 6 modules

affine Affine3Frame

matrix Mat3Mat4Mat4f

noise BasisFractalPlan

quat EulerOrderQuat

units LengthUnitUnitsUpAxis

vector Mask

Besides these, 16 public functions at module level.