lib-viewport · crate
kinogaki-viewport-core
Kinogaki viewport core: what a 3D viewport shows, independent of any GPU API or UI toolkit.
- Repository
- lib-viewport (kinogaki/lib-viewport)
- Folder
libs/lib-viewport/crates/core- Source
- 16 files, 4,768 lines
- Tests
- 2 files, 391 lines
What it is
Kinogaki viewport core: what a 3D viewport shows, independent of any GPU API or UI toolkit.
The packet contract (surface packets, line classes, point markers, element selections, overlay layers, draw updates and shading plans) is the SDK's kinogaki-viewport-api, re-exported here whole so kernels and renderers name one crate. On top of it:
PreviewUpdate: a live transform drag's patches and GPU motions over an uploaded packet (MotionMask,PartMotion,WeightedMotionwith itsPointWeights).Cameraorbit camera with perspective/orthographic projections, view rays, and the world's up axis and ground grid (Ground).pick: picking a packet's triangles (with barycentric coordinates), lines (by class and id) and points (by id).MergedSurface(several packets drawn as one) andPlainSurface.DisplayRanges: the curvature analysis display ranges.columns: a packet's columns read back as records, and an element's center from them.
kinogaki-viewport-gpu renders these with wgpu; kinogaki-viewport-ui provides the egui viewport widgets.
Depends on
| 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-geometry | SDK | normal | Kinogaki Studio's standard geometry values. |
kinogaki-math | lib-math | normal | Kinogaki's vectors, points, matrices, quaternions and deterministic elementary functions. |
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. |
Third-party
| Crate | Version | Licence | Frozen in | As | Also used by |
|---|---|---|---|---|---|
bytemuck | 1.25.2 | Zlib OR Apache-2.0 OR MIT | lib-ui/vendor | normal | kinogaki-composit-wgpu, kinogaki-geometry, kinogaki-geometry-view, kinogaki-image-pipeline, kinogaki-math, kinogaki-pixel, kinogaki-ui, kinogaki-ui-wgpu and 2 more |
Used by
| Crate | Repository | As | What it is |
|---|---|---|---|
kinogaki-editor | Core and the app | normal | Kinogaki Studio's editor: the document and everything the window shows of it, as parts one frame borrows one by one. |
kinogaki-geometry-view | Core and the app | normal | 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-image-pipeline | Core and the app | normal | ImagePipeline: what renders become on screen and in files. |
kinogaki-scene | Core and the app | normal | Studio's scene: the document cooked object by object. |
kinogaki-sdk-ui | Core and the app | normal | The 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-viewport-gpu | lib-viewport | normal | Kinogaki's wgpu viewport renderer: pipelines, retained GPU buffers, offscreen multisampled targets and owned WGSL shaders. |
kinogaki-viewport-ui | lib-viewport | normal | 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. |
Modules
analysis(private)Display ranges of the Curvature analysis: for each measure (mean, Gaussian, k1, k2, largest |k|) the 98th percentile of a packet's per-vertex principal curvatures, binned into 4096 buckets of the largest value as the reference application did.266 linescamera(private)no module doc434 linescolumnsA surface's columns read back as their records (positions and vertex records), and the center of one of its elements from them.130 linesmerged(private)Several packets shown as one surface (MergedSurface): an object made of several packets (a CAD object's bodies, one packet a body and copies of it at its instances) edited as one, so the edited surface's selection, hover, line highlights and picking work ...689 linespickPicking a packet's elements under the pointer: triangles with their barycentric coordinates, line segments by class and id with the segment's parameter, and point markers by id.584 linespick::made(private)Making a packet's picker.344 linespick::screen(private)Screen-box geometry for box selection: the box's half-spaces in object space, and whether a screen segment or triangle touches the box.71 linespick::seen(private)A box selection over what the GPU drew:Seenholds each pixel's nearest face and its depth over the box (drawn for the view, read back once a box is let go), andPicker::pick_box_seentakes the faces drawn there, with no ray per face.274 linespick::tree(private)The bounding-box tree a picker keeps over each kind of element: binned surface-area splits over the items' boxes, built in flat arrays; refit whole on the workers, or for a few items copying only the cells of nodes they reach; visited by the half-spaces of a ...429 linesplain(private)A packet made of plain arrays: what a domain library with no paged storage of its own hands the renderer (a CAD tessellation with its hull and CV lines, a test fixture).193 linespreview(private)Sparse, reversible preview patches over an uploaded packet: a transform drag rewrites only affected positions, vertices and triangles.179 linesray(private)Rays for picking and placement, in the space of the camera that made them.10 lines
Public types and traits
At the crate root
Structs CameraDisplayRangesGroundLensMergedSurfaceMotionMaskPartPartMotionPatchPlainSurfacePointWeightsPreviewUpdateRayWeightedMotion
Enums Up
Re-exported from other crates
From kinogaki_viewport_api *
By module: 21 public types and traits in 8 modules
analysis DisplayRanges
camera CameraGroundLensUp
merged MergedSurfacePart
pick PickerPickHitPickQueryPickTargetPickView
pick::seen Seen
plain PlainSurface
preview MotionMaskPartMotionPatchPointWeightsPreviewUpdateWeightedMotion
ray Ray
Besides these, 3 public functions at module level.
