Skip to main content

brep_render/
lib.rs

1//! brep-render — the Rust rendering engine that replaced the retired viewer.
2//!
3//! Slice 1 (requirements doc §11 R40(1)/R41): engine core + solid/face/edge
4//! display fed by the kernel feature pipeline, with native headless artifact
5//! rendering for the test suite.
6//!
7//! Layering (the dual-target requirement — web AND desktop from one codebase):
8//!
9//! - [`scene`]: the renderer-agnostic scene store ([`scene::RenderScene`]),
10//!   keyed by kernel names. No GPU, no window, no renderer assumptions.
11//! - [`pipeline`]: history request JSON → `execute_history` (in-process kernel
12//!   call) → scene population via the kernel's native display accessors.
13//! - [`camera`]: pure-math cameras (orthographic artifact framing, orbit).
14//! - [`render`]: the wgpu core — `SceneRenderer::render_to_view(scene, camera,
15//!   view, size)` draws into ANY `wgpu::TextureView`. It never owns a window or
16//!   canvas; presentation shells are thin:
17//!   * headless: render-to-texture → readback → PNG (`render_to_png`),
18//!     used by the `brep-render-artifact` binary and the test suite;
19//!   * desktop: `brep-render-desktop` (feature `desktop`) wraps a winit window
20//!     + surface around the same core;
21//!   * web (later slice): a wasm canvas surface around the same core.
22//! - [`color`]: the name-hashed stable solid colors (byte-compatible with the
23//!   previous artifact renderer's `solidColor`) + sRGB helpers.
24
25// Re-export the kernel crate so downstream shells (e.g. `brep-app`'s wasm
26// `WorkerRunner`) can name the run-boundary types the `runner::HistoryRunner`
27// trait exposes (`brep_kernel::HistoryRequest`, …) WITHOUT taking their own
28// direct path dependency — which would have to mirror this crate's kernel
29// feature split (`default-features = false` / native `parallel`) or feature
30// unification bites. One canonical instance, reached as `brep_render::brep_kernel`.
31pub use brep_kernel;
32
33pub mod camera;
34pub mod color;
35pub mod controls;
36pub mod engine_state;
37pub mod feature_dimensions;
38pub mod features;
39pub mod history;
40pub mod metadata;
41pub mod pick;
42pub mod pipeline;
43pub mod render;
44pub mod runner;
45pub mod scene;
46pub mod sketch;
47pub mod style;
48pub mod visibility;
49pub mod view;
50pub mod widgets;
51
52// The wasm-bindgen browser API (attach/resize/events/camera/pick/scene-feed/
53// settings/world→screen) — the R3 seam the host UI programs against. wasm only;
54// its GPU wrapper needs a canvas/WebGPU context.
55#[cfg(target_arch = "wasm32")]
56pub mod engine;