Layer split stage 1: the B-rep record, native body file and Vec/Plane come from solidcore-record (#11496)
* Kernel: the B-rep record and the native body file come from solidcore-record SolidCraft's portable B-rep record (`solidcraft_geom::brep`: brep.rs, topology, history, envelope, part, curve2) and the native body file (`solidcraft_kernel::native`: the tagged binary codec and the container) move to solidcore's `solidcore-record` crate: geometry as data, with structural validation and no maths (solidcore's docs/layers.md, stage 1). Every caller uses `solidcore_record::brep` and `solidcore_record::native`; the old copies are deleted. What computes from coordinates stays with the kernel, in geom's `brep`: - `brep::check`: the record's geometric checks (orthonormal frames, non-degenerate planes, unit revolution axes, non-singular placements). `check::validate` and `check::validate_built` are the record's validation and these together, and every caller of `Brep::validate` uses them, so what is accepted is unchanged; - `brep::label`: a surface's natural ranges (a cone's apex), `curve_interval`, `edge_curve_interval` and `form_turns`; - `brep::pcurve::eval`: a pcurve's point; - `geometry::check`, `placement::moved` and `split_edges` become functions on the record. The kernel's native module keeps the conversion between a body and its saved record (metadata.rs) and checks the decoded record's geometry. `native/analytic.rs`, which no module declared, is deleted. solidcore-record is pinned to its rev on solidcore's `layer-record` branch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NvoxKMbMFSQU8tzRtoJhtT * Geometry: Vec2, Vec3, Plane and the profile types come from solidcore-record The plain data of vectors and points, sketch planes and planar profiles (`Seg2`, `Loop2`, `Region2`) moves to `solidcore-record`, with its constants and component-wise operators only (owner decision, solidcore layer split). Their geometry stays in geom as traits: `Vec2Geom`, `Vec3Geom`, `PlaneGeom`, `Seg2Geom`, `Loop2Geom`, `Region2Geom`, `Seg2ArcFit`, `Loop2ArcFit` and `Region2ArcFit`, in scope with `use solidcraft_geom::prelude::*`. Every caller names the types from `solidcore_record`; geom no longer defines or re-exports them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NvoxKMbMFSQU8tzRtoJhtT * Kernel: pin solidcore-record to solidcore main f5e8e9a29 solidcore-record is merged on solidcore main (tangency-labs/solidcore#2519); its crate there is identical to the rev pinned before but for its clippy configuration. The lock is regenerated against the merged rev. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NvoxKMbMFSQU8tzRtoJhtT --------- Co-authored-by: jyviko <2501648+jyviko@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -7,11 +7,12 @@
|
||||
//! renderer that drew it (`gpu`, `gpu-software` or `cpu`); `hardware` and `software` fail with an
|
||||
//! error that names the policy.
|
||||
|
||||
use solidcraft_geom::prelude::*;
|
||||
use std::collections::HashMap;
|
||||
use std::sync::atomic::{AtomicBool, Ordering};
|
||||
use std::sync::{Arc, Mutex};
|
||||
|
||||
use solidcraft_geom::Vec3;
|
||||
use solidcore_record::Vec3;
|
||||
use solidcraft_render::hatch::Hatch;
|
||||
use solidcraft_render::{AnalysisMode, Camera, Rgb, SECTION_CAP, Scene, SceneMesh};
|
||||
use wgpu::util::DeviceExt;
|
||||
|
||||
@@ -13,9 +13,9 @@
|
||||
#![deny(clippy::unwrap_used, clippy::expect_used, clippy::panic, clippy::unimplemented, clippy::todo, clippy::unreachable)]
|
||||
#![forbid(unsafe_code)]
|
||||
|
||||
use solidcore_record::Vec3;
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
use solidcraft_geom::Mesh;
|
||||
use solidcraft_geom::Vec3;
|
||||
use solidcraft_geom::tess::{EvalCurve, EvalSurface, TessPlan};
|
||||
use wgpu::util::DeviceExt;
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
use super::super::{Executor, JobOptions, Task, open_headless};
|
||||
use super::*;
|
||||
use solidcraft_geom::{Mesh, Vec3};
|
||||
use solidcore_record::Vec3;
|
||||
use solidcraft_geom::Mesh;
|
||||
use solidcraft_render::{
|
||||
Camera, ProductMesh, ProductScene, StandardView,
|
||||
job::{CancelToken, ImageRequest, ImageWork, TaskPoll},
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
//! only a candidate; parent convexity and child vertices are checked against
|
||||
//! every outward parent half-space. Intersections and touching boundaries refuse.
|
||||
use super::scene::{Triangle, reserved};
|
||||
use solidcraft_geom::Vec3;
|
||||
use solidcore_record::Vec3;
|
||||
use solidcraft_geom::prelude::*;
|
||||
use solidcraft_render::job::{CancelToken, ErrorCode, JobError, Result};
|
||||
use std::ops::Range;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//! Native progressive product rendering. Software BVH traversal needs no ray-query
|
||||
//! features. Small measured quanta adapt to the device, then check cancellation.
|
||||
use solidcraft_geom::Vec3;
|
||||
use solidcore_record::Vec3;
|
||||
#[cfg(test)]
|
||||
use solidcraft_render::job::ToneMap;
|
||||
use solidcraft_render::{
|
||||
|
||||
@@ -113,7 +113,7 @@ pub(super) fn ids(triangles: &[Triangle], cancel: &CancelToken) -> Result<Vec<u3
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use solidcraft_geom::Vec3;
|
||||
use solidcore_record::Vec3;
|
||||
use solidcraft_render::surface::OpaqueSurface;
|
||||
|
||||
fn triangle(p: [[f64; 3]; 3], body: u32) -> Triangle {
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
//! Original median-split BVH. World geometry is rebased around the camera target for f32.
|
||||
#[path = "planar_patches.rs"]
|
||||
mod planar_patches;
|
||||
use solidcraft_geom::prelude::*;
|
||||
use std::collections::HashMap;
|
||||
|
||||
use solidcraft_geom::Vec3;
|
||||
use solidcore_record::Vec3;
|
||||
use solidcraft_render::{
|
||||
ProductScene,
|
||||
job::{CancelToken, ErrorCode, JobError, Result},
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
use super::{MAX_BVH_DEPTH, Node, Triangle, build};
|
||||
use solidcraft_geom::Vec3;
|
||||
use solidcore_record::Vec3;
|
||||
use solidcraft_render::{job::CancelToken, surface::OpaqueSurface};
|
||||
|
||||
// Triangle centres spread over 60 decades: a sixteen-bin SAH split on the
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
use solidcraft_geom::prelude::*;
|
||||
use std::sync::Arc;
|
||||
|
||||
use super::{MediumWeld, Triangle, flatten, medium_preparation_bytes};
|
||||
use solidcraft_geom::{Mesh, Vec3};
|
||||
use solidcore_record::Vec3;
|
||||
use solidcraft_geom::Mesh;
|
||||
use solidcraft_render::{ProductMesh, ProductScene, job::CancelToken, surface::OpaqueSurface, transmission::Transmission};
|
||||
|
||||
fn seam_tetra(offset: Vec3) -> ProductScene {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
use super::*;
|
||||
use solidcraft_geom::prelude::*;
|
||||
use solidcraft_geom::{Aabb3, Mesh};
|
||||
use solidcraft_render::{Camera, ProductMesh, StandardView, surface::OpaqueSurface};
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
//! One read-only storage buffer: body lookup, planar records and linear RGBA pixels.
|
||||
use solidcraft_geom::Vec3;
|
||||
use solidcore_record::Vec3;
|
||||
use solidcraft_geom::prelude::*;
|
||||
use solidcraft_render::job::{
|
||||
CancelToken, ErrorCode, JobError, Result,
|
||||
textures::{BaseColorMode, RuntimeTextures, TextureMap},
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
use solidcraft_geom::Vec3;
|
||||
use solidcore_record::Vec3;
|
||||
use solidcraft_geom::prelude::*;
|
||||
use solidcraft_kernel::{Body, BoolOp};
|
||||
|
||||
use super::*;
|
||||
@@ -374,7 +375,7 @@ fn tessellation_without_surfaces_does_not_dispatch() {
|
||||
#[test]
|
||||
#[ignore]
|
||||
fn bench_plate() {
|
||||
use solidcraft_geom::{Loop2, Plane, Region2, Seg2, Vec2};
|
||||
use solidcore_record::{Loop2, Plane, Region2, Seg2, Vec2};
|
||||
let rect = |w: f64| Loop2 {
|
||||
segs: vec![
|
||||
Seg2::Line { a: Vec2::new(0.0, 0.0), b: Vec2::new(w, 0.0) },
|
||||
|
||||
@@ -9,9 +9,10 @@
|
||||
//! evaluated on the GPU into the vertex buffer the pass draws (see [`PlannedBody`]), with nothing
|
||||
//! built or read back on the CPU.
|
||||
|
||||
use solidcraft_geom::prelude::*;
|
||||
use std::sync::{Arc, Mutex};
|
||||
|
||||
use solidcraft_geom::Vec3;
|
||||
use solidcore_record::Vec3;
|
||||
|
||||
use crate::pbr;
|
||||
use wgpu::util::DeviceExt;
|
||||
@@ -4345,7 +4346,8 @@ mod tests {
|
||||
#[test]
|
||||
fn shared_tris_share_each_vertex_once() {
|
||||
use super::{SHARED_SIZE, SharedTris};
|
||||
use solidcraft_geom::{Mesh, Vec3};
|
||||
use solidcore_record::Vec3;
|
||||
use solidcraft_geom::Mesh;
|
||||
let p = [Vec3::new(0.0, 0.0, 0.0), Vec3::new(1.0, 0.0, 0.0), Vec3::new(1.0, 1.0, 0.0), Vec3::new(0.0, 1.0, 0.0)];
|
||||
// Two triangles of a square, each corner its own vertex (as an STL is read).
|
||||
let mut flat = Mesh::default();
|
||||
|
||||
Reference in New Issue
Block a user