SDK · crate
kinogaki-geometry
Kinogaki Studio's standard geometry values.
- Repository
- SDK (kinogaki/studio-sdk)
- Folder
sdk/crates/geometry- Source
- 82 files, 18,941 lines
- Tests
- 11 files, 2,986 lines
What it is
Kinogaki Studio's standard geometry values.
Studio defines each kind of geometry once, here, and every package works on the same values: kernels operate on them, formats read and write them, render engines draw them, and Studio displays, picks, tabulates and saves them. A kernel adds operations, never a type of its own for the same data.
| Value | What |
|---|---|
Geometry | polygons, polylines and curves over shared points: one Primitives table, each primitive of a Kind (Basis and closed), in any order, with Attributes; a primitive evaluates as a Curve |
Brep | boundary-representation bodies with exact geometry, free curves and datums (brep) |
Image | 2D tiled layers over a data and a display window: files, textures, Comp's boundaries, the canvas (image) |
Attributes | named Attribute columns (an AttributeType: Storage × width × Meaning, arrays) and groups (Elements) per Domain; Text is indexed; standard names |
Selection, Incidence | selected elements of one domain, with the active one; which elements of a value touch which (selection rules live in kinogaki-edit) |
Triangulation, ShadingNormals | how polygons are shown: the one display triangulation and shading rule every viewport, engine and kernel shares |
Detail, DisplayQuality | how fine geometry is made for a view or a render |
Tolerances | the project's modeling tolerances |
Vec3, Xform, Bounds, Ray, Projective | the one vector, placement (affine, column vectors), box, ray and view matrix every crate exchanges; Frame is an orthonormal frame |
Units, Time, Rate, Sampled | what a scene unit is; a moment on the tick grid and frames a second; a value across a frame's shutter |
parallel | the process's shared Workers: every parallel step runs on what the host installed |
Validated values. Every value's fields are private. It is made only through a constructor or builder that checks its rules (each type lists them) and refuses with an Error naming the element at fault, so code reading a value may rely on them: no invalid value can exist. An enum the SDK grows, whose values a reader meets without naming them all, is #[non_exhaustive] (its reader's wildcard says what it does with a variant added since); a closed set a match answers whole is exhaustive. ARCHITECTURE.md states the rule.
Shared and immutable. Arrays are Columns: shared cells that adopt a Vec without copying it. A value is never changed in place: an edit (with_moved, with_attributes, Attributes::with) makes a new value sharing every column and every cell it didn't touch, and checks only what it replaced. Geometry keep their primitives in one shared Arc<Primitives>, so moving points keeps the table, its edges and every cache built on it.
Product limits (limits): every element id fits a u32 (MAX_POINTS, MAX_PRIMITIVES, MAX_VERTICES: 2³² − 2 each) and names are at most 256 bytes. Every position component is finite and at most 1e100 in magnitude.
Caches derived from a standard value
A kernel or Studio may keep acceleration data (adjacency, half-edges, a triangulation, a BVH), but only as a cache derived from a standard value, never as the value itself:
- Keys. A cache is derived from one shared part of a value and is keyed by that part's identity: the
Primitivesfor adjacency, edges, half-edges, triangulation and triangle maps; the positionsColumnfor BVHs and bounds; an attribute'sColumnfor anything built from that attribute. - Where caches live. Use
Primitives::derivedandColumn::derived(a viewport packet keeps its ownDerivedslots, for what is made from it). A slot lives exactly as long as its part and is shared by every value that shares the part, so a points-only edit (with_positions) keeps every table cache. Never keep a cache in a global map keyed by address. - Readers. Only the crate that defines a cache's type reads it. A slot is never a channel between plugins.
- Never stored. A cache is never saved, compared or treated as the value. Dropping it may only cost time.
- Key lifetime.
Column::keyandptr_eqare valid while the part lives, within one session. UsePrimitives::fingerprintor a stamp for anything that outlives it. - Independent caches. Two kernels' caches over one part are two slots, and neither sees the other's.
The canonical Index (Primitives::index) is the one cache this crate defines over a table: every kernel and Studio share its edges and numbering instead of building their own.
Depends on
None.
Third-party
| Crate | Version | Licence | Frozen in | As | Also used by |
|---|---|---|---|---|---|
blake3 | 1.8.7 | CC0-1.0 OR Apache-2.0 OR Apache-2.0 WITH LLVM-exception | lib-ui/vendor | normal | kinogaki-core-package, kinogaki-geometry-view, kinogaki-network, kinogaki-scene |
bytemuck | 1.25.2 | Zlib OR Apache-2.0 OR MIT | lib-ui/vendor | normal | kinogaki-composit-wgpu, kinogaki-geometry-view, kinogaki-image-pipeline, kinogaki-math, kinogaki-pixel, kinogaki-ui, kinogaki-ui-wgpu, kinogaki-viewport-api and 2 more |
Used by
| Crate | Repository | As | What it is |
|---|---|---|---|
kinogaki-edit | SDK | normal | Kinogaki Studio's edit contracts: what core and the kernels agree on when a value is selected and changed. |
kinogaki-mtlx | SDK | normal | MaterialX 1.39 for Kinogaki Studio: the material layer every engine, format and core share, in our own implementation (MaterialX's C++ library is a reference and a test oracle, never a dependency). |
kinogaki-render-api | SDK | normal | Kinogaki's render interface: what a host (Studio) sends a render engine and what comes back, with no GPU or OS API. |
kinogaki-shared | Core and the app | normal | The crates Studio and its plugins share, built once as a Rust dylib. |
kinogaki-studio-api | SDK | normal | Kinogaki Studio's headless plugin API. |
kinogaki-studio-api-testing | SDK | normal | The SDK's test support (a dev-dependency only): assert_refused for admission tests, read_hostile for a format's tests of hostile files, format for its scratch folders and round trips, workers as a host installs them, with wgpu an ... |
kinogaki-value | SDK | normal | Kinogaki Studio's value model: the one way the SDK says what a value is and holds. |
kinogaki-viewport-api | SDK | normal | Kinogaki's viewport packet contract: what a data type hands Studio's viewport to draw, with no GPU or UI API. |
kinogaki-viewport-core | lib-viewport | normal | Kinogaki viewport core: what a 3D viewport shows, independent of any GPU API or UI toolkit. |
kinogaki-viewport-gpu | lib-viewport | normal | Kinogaki's wgpu viewport renderer: pipelines, retained GPU buffers, offscreen multisampled targets and owned WGSL shaders. |
Modules
across(private)across: the axes across a curve at each of its points, carried along it so they never flip or spin (rotation-minimizing frames): what a sweep of a profile and a tube of a curve place their rings on.115 linesattributes(private)The attribute model every standard value shares: named, typed columns per element domain (Attributeof anAttributeType), named sets of elements (Elements), and the table of both a value holds (Attributes).398 linesattributes::attribute(private)Attribute: one typed column of values, andTuple, the Rust types its values are read and adopted as.390 linesattributes::attribute::sealed(private)no module doc16 linesattributes::domain(private)Domain: which elements an attribute or group has one value for.65 linesattributes::ids(private)The stable-id rule: a value's standardidattribute names each element of its domain once.81 linesattributes::names(private)The standard attribute and group names, and the rule every name follows (check_name).200 linesattributes::text(private)Text: indexed text values, andTextBuilder, which writes them.254 linesattributes::types(private)AttributeType: an attribute's storage, width, meaning and whether each element holds an array.241 linesbounds(private)Bounds: the one axis-aligned box.84 linesbrepBrep: boundary-representation bodies with exact geometry, free curves and datums — the standard valuekinogaki.brep.432 linesbrep::body(private)Body: one B-rep body.204 linesbrep::builder(private)BrepBuilder: the one way to make aBody, and the structural half of its rules (the geometric half isconsistency).530 linesbrep::consistency(private)The geometric half of a body's rules: consistency at the points the data names (ends and joins), within P.248 linesbrep::eval(private)Evaluation: the point and first derivatives of every carrier, which is how the contract says what a value means ("the vertex is at the curve'st0", "material on the left").286 linesbrep::fingerprint(private)The fingerprints a selection keeps: whether component indices still mean the same elements.124 linesbrep::geometry(private)The carriers:Surfaces andCurves in space,PCurves in a face's chart, and theGeometrytables a body keeps them in.201 linesbrep::geometry::curves(private)The curve carriers in space and theCurveenum choosing among them.135 linesbrep::geometry::pcurves(private)The p-curves: curves in a face's chart(u, v), and thePCurveenum choosing among them.182 linesbrep::geometry::surfaces(private)The surface carriers: analytic surfaces, sweeps and offsets, and theSurfaceenum choosing among them.343 linesbrep::ids(private)Typed entity ids, andEntity: any one of them, as a refusal names it.107 linesbrep::names(private)Persistent names (Name): data any kernel makes, compares and saves.117 linesbrep::numbering(private)A B-rep value's one element numbering (Brep::count,Brep::element,Brep::id) and its fingerprint (Brep::fingerprint), which a selection made on it keeps.196 linesbrep::nurbs(private)Clamped NURBS curves (in space and in a chart) and tensor-product NURBS surfaces, with the one evaluation the contract is stated through.379 linesbrep::topology(private)The topology tables (BrepTopology) and their records, and the entities' persistent names (Names).461 linescolumn(private)Column<T>: the shared, immutable array every standard value keeps its values in, in shared fixed-size cells, so an edit copies the cells it touches and a kept run shares them.757 linescurve(private)Curve: one primitive of aGeometryread as the curve it is — its parameter domain, its spans and the one exact evaluation every display, engine and kernel shares.364 linesderived(private)Derived: the typed cache slots of one shared part of a value (a column, a topology) or of a viewport packet.62 linesdetail(private)Detail: how fine geometry is made for a view or a render; andDisplayQuality, how fine an interactive view makes it.133 linesdiagnostic(private)Diagnostic: what the user reads about a problem a cook, a reader or a check found: shown on its node, listed in the Console and underlined in a code field.122 lineselements(private)Elements: a set of the elements of one domain, the one shape a group and a selection both hold.403 lineserror(private)Error: why a call failed, as oneDiagnosticfor the user and theErrorKinda caller branches on.145 linesframe(private)Frame: an origin and right-handed orthonormal axes, checked, and the unit and finite checks it shares with the B-rep carriers.102 linesgeometry(private)Geometry: polygons, polylines and curves over shared points, with attributes — the standard valuekinogaki.core.geometry.279 linesimageImage: a 2D value of tiled layers, what files, render textures, Comp's boundaries and the 2D canvas exchange.647 linesimage::encoding(private)Encoding: what a layer's values mean, andColorTag: which colors.120 linesimage::held(private)HeldPixels: a layer's pixels the host holds instead of tiles.16 linesimage::metadataThe standard names of an image's metadata, its Detail attributes, beside whatever a file carries.12 linesimage::pyramid(private)Pyramid: smaller levels of an image's tiles, derived on demand.124 linesimage::sample(private)Sample: what one channel's value is stored as, and half floats.119 linesimage::sampler(private)Sampler: one layer of anImageread at points.281 linesimage::sampling(private)Sampling: how an image is read where a texture names it, past its edges (Wrap) and between its texels (Filter).42 linesimage::source(private)ImageSource: where an image's pixels come from, as the host's Image node names them: a file on disk (ImageFile::Path) or the file's original bytes kept in the project (EmbeddedFile), and how its colors read (ImageColor).353 linesincidence(private)Incidence: which elements of a value touch which, the one structure selection rules read (kinogaki-edit's conversions), implemented by every standard value with elements:GeometryandBrep.238 linesinstancing(private)placements: where copies or instances go on a value's points, from the standard instance attributes, as Houdini's Copy to Points and instancing place them.174 lineskept(private)Kept: results derived from a column together with other parts of a value (a positions column with the topology or attribute columns, a text's indices with its table), kept on that column for the last two sets of other parts.44 lineslimitsThe product limits: the largest values Studio and every kernel accept.47 linesparallelThe process's shared workers: every parallel step of a package and of this crate (validation, the topology index, triangulation, shading) runs on them.344 linespositions(private)The rule every value's positions follow: finite, each component at mostMAX_COORDINATEin magnitude, at mostMAX_POINTSof them.130 linesprimitives(private)Primitives: the one primitive table polygons, polylines and curves share — rows of point ids with aKindeach, in any order — and what is derived from it once: the canonicalIndexof edges and adjacency, the edge count, the polygons and the ...447 linesprimitives::changes(private)TableChange: which rows of a table differ from another's, at the cost of the cells the two don't share.117 linesprimitives::components(private)Components: the table's points by connected piece.117 linesprimitives::curves(private)CurveData: what curve primitives hold beside their points.72 linesprimitives::fingerprint(private)The table's fingerprint: BLAKE3 of the point and primitive counts and the digest of every block ofROWSrows (BLAKE3 of each row's length and corners, little-endian); a table that isn't all polygons hashes that again with its kinds and curve data.113 linesprimitives::index(private)The canonicalIndexof a primitive table: its edges and the adjacency between points, edges and primitives, the same for every kernel and for Studio's display.406 linesprimitives::index::block(private)A block of anIndex: every row ofPOINTSpoints, made from the corners on each point.303 linesprimitives::index::walk(private)Edge loops and rings: walks over anIndex, one edge to the next.180 linesprimitives::kind(private)KindandBasis: what a primitive is, in one byte.146 linesprimitives::validate(private)The primitive rules (Primitiveslists them): one rule per kind, the curve rules shared with the curves value.237 linesprimitives::writer(private)TableWriter: a new table made from a checked one.253 linessampled(private)Sampled: a value over a frame's shutter.299 linesselection(private)Selection: which elements of one domain of a standard value are selected — the standard component selection.192 linesshading(private)ShadingNormals: the one rule polygons are shaded by, everywhere.440 linesspline(private)The one B-spline evaluator every value shares: span search, de Boor's algorithm with the first derivative, and rational (homogeneous) points.178 linestime(private)Time: a moment on the one tick grid, andRate: frames a second.178 linestolerances(private)Tolerances: the project's modeling tolerances, the contract every exact body is built to (the project valuekinogaki.tolerances).136 linestriangulation(private)Geometry as triangles: the displayTriangulationevery viewport, render engine and kernel shares.365 linestriangulation::clip(private)Ear clipping of one polygon: the one clipper behind both the display and the strict triangulation.260 linesunits(private)Units: the one length unit and up axis.95 linesvec3(private)Vec3: the one 3D vector, andRay.211 linesvector(private)The few vector operations triangulation and shading need, on plain arrays.70 linesxform(private)Xform: the one placement, andProjective: a view's 4×4.236 linesnearestSpatial searches over a value: the nearest place on its triangles or the first hit along a ray, and the nearest points.488 lines
Public types and traits
At the crate root
Traits IncidenceTuple
Structs AcrossAttributeAttributesAttributeTypeBoundsColumnComponentsCurveCurveDataDerivedDiagnosticEdgeElementsErrorFrameGeometryIndexKindKnotsPrimitivesProjectiveRateRaySampledSelectionShadingNormalsSpanTableChangeTableWriterTextTextSpanTimeTolerancesTriangleTriangulationUnitsVec3WalkXform
Enums BasisDetailDisplayQualityDomainErrorKindMeaningSeverityStorageUpAxisValues
By module: 121 public types and traits in 55 modules
across Across
attributes Attributes
attributes::attribute AttributeTupleValues
attributes::domain Domain
attributes::text Text
attributes::types AttributeTypeMeaningStorage
bounds Bounds
brep BrepDatumDatumHintDatumKind
brep::body Body
brep::builder BrepBuilderCoedgeSpecEdgeSpecFaceSpec
brep::geometry Geometry
brep::geometry::curves CircleCurveEllipseLine
brep::geometry::pcurves Circle2Ellipse2Line2PCurve
brep::geometry::surfaces ConeCylinderExtrusionOffsetPlaneRevolutionSphereSurfaceTorus
brep::names NameNameNodeOperationId
brep::numbering Element
brep::nurbs NurbsCurveNurbsSurfaceSeamContinuity
brep::topology BodyKindBrepTopologyCoedgeCountsEdgeFaceLoopNamesSenseShellVertex
column Column
curve CurveSpan
derived Derived
detail DetailDisplayQuality
diagnostic DiagnosticSeverityTextSpan
elements Elements
error ErrorErrorKind
frame Frame
geometry Geometry
image FormatImageImageBuilderLayerRectTileWeakImage
image::encoding ColorTagEncoding
image::held HeldPixels
image::pyramid Pyramid
image::sample Sample
image::sampler SampleFilterSampler
image::sampling FilterSamplingWrap
image::source EmbeddedFileImageColorImageFileImageSource
incidence Incidence
nearest HitSpotsSurface
parallel Workers
primitives EdgePrimitives
primitives::changes TableChange
primitives::components Components
primitives::curves CurveDataKnots
primitives::index Index
primitives::index::walk Walk
primitives::kind BasisKind
primitives::writer TableWriter
sampled Sampled
selection Selection
shading ShadingNormals
time RateTime
tolerances Tolerances
triangulation TriangleTriangulation
units UnitsUpAxis
vec3 RayVec3
xform ProjectiveXform
Besides these, 5 public functions at module level.
