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:
@@ -2,7 +2,8 @@
|
||||
//! Captured ordinal/name and mesh face tag must match. Strict plane equality is
|
||||
//! conservative: rotated or imported roundoff may refuse instead of guessing.
|
||||
|
||||
use solidcraft_geom::Vec3;
|
||||
use solidcore_record::Vec3;
|
||||
use solidcraft_geom::prelude::*;
|
||||
|
||||
use crate::{
|
||||
ProductScene,
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
//! Sampling estimates the area integral; it is not an exact solid-angle integral.
|
||||
//! No emitter geometry, indirect bounce or calibrated photometric units are implied.
|
||||
|
||||
use solidcraft_geom::Vec3;
|
||||
use solidcore_record::Vec3;
|
||||
use solidcraft_geom::prelude::*;
|
||||
|
||||
use super::lighting::MAX_LINEAR_RADIANCE;
|
||||
use super::{MAX_COORDINATE_MM, MAX_DISTANCE_MM, Ray, Result, TraceError};
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
//! Air is 1.0. Distances and absorption coefficients use millimetres.
|
||||
use super::{Bounds, Result, TraceError, Triangle, unit};
|
||||
use crate::{ProductScene, job::DielectricOptions};
|
||||
use solidcraft_geom::Vec3;
|
||||
use solidcore_record::Vec3;
|
||||
use solidcraft_geom::prelude::*;
|
||||
|
||||
pub const MAX_OVERRIDES: usize = 8;
|
||||
pub const MAX_BOUNDARIES: u8 = 8;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//! Visible surface radiance only: no mesh-light sampling or neighboring illumination.
|
||||
use crate::job::{EmissionSides, SurfaceEmission};
|
||||
use solidcraft_geom::Vec3;
|
||||
use solidcore_record::Vec3;
|
||||
|
||||
#[derive(Clone, Copy, Debug)]
|
||||
pub struct Emission {
|
||||
|
||||
@@ -13,7 +13,9 @@ use crate::{
|
||||
film::primary::PrimaryFilm,
|
||||
surface::{OpaqueSurface, srgb8_to_linear},
|
||||
};
|
||||
use solidcraft_geom::{Vec3, srgb::encode8};
|
||||
use solidcore_record::Vec3;
|
||||
use solidcraft_geom::prelude::*;
|
||||
use solidcraft_geom::srgb::encode8;
|
||||
|
||||
#[cfg(test)]
|
||||
#[path = "environment_image_tests.rs"]
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
//! Colours are linear sRGB; intensity is relative radiance, not watts or illuminance.
|
||||
//! Visibility is supplied separately for every light by the ray-tracing consumer.
|
||||
|
||||
use solidcraft_geom::Vec3;
|
||||
use solidcore_record::Vec3;
|
||||
use solidcraft_geom::prelude::*;
|
||||
|
||||
use crate::surface::{OpaqueSurface, unit_direction};
|
||||
|
||||
|
||||
@@ -5,7 +5,8 @@
|
||||
//! or third-party ray-tracer implementation is used. See `docs/render-raytrace-core.md`.
|
||||
|
||||
use crate::job::CancelToken;
|
||||
use solidcraft_geom::Vec3;
|
||||
use solidcore_record::Vec3;
|
||||
use solidcraft_geom::prelude::*;
|
||||
|
||||
mod anisotropic_faces;
|
||||
pub mod area;
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
//! Borrowed prepared-scene contract shared by bounded transport consumers.
|
||||
use super::{Bvh, Hit, MAX_DISTANCE_MM, Ray, Result, TraceError};
|
||||
use crate::{ProductScene, surface::OpaqueSurface};
|
||||
use solidcraft_geom::Vec3;
|
||||
use solidcore_record::Vec3;
|
||||
use solidcraft_geom::prelude::*;
|
||||
|
||||
#[derive(Clone, Copy)]
|
||||
pub struct PreparedPrimitive {
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
//! Original relative point/spot response. Coordinates/reference distances are mm.
|
||||
//! No lumen, lux, watts, measured CCT, IES or glTF photometry is implied.
|
||||
|
||||
use solidcraft_geom::Vec3;
|
||||
use solidcore_record::Vec3;
|
||||
use solidcraft_geom::prelude::*;
|
||||
|
||||
use super::{Ray, Result, TraceError, bounded, lighting::MAX_LIGHT_INTENSITY, prepared::SharedHit, unit};
|
||||
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
use super::{Result, TraceError};
|
||||
use crate::anisotropic_surface::{AnisotropicSurface, VisualFrame};
|
||||
use crate::surface::{OpaqueSurface, unit_direction};
|
||||
use solidcraft_geom::Vec3;
|
||||
use solidcore_record::Vec3;
|
||||
use solidcraft_geom::prelude::*;
|
||||
#[cfg(test)]
|
||||
use std::f64::consts::{PI, TAU};
|
||||
#[derive(Clone, Copy, Debug)]
|
||||
@@ -133,6 +134,7 @@ mod vndf_tests;
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::{OpaqueSurface, PI, Vec3, hash_variates as variates, mirror, rough_specular};
|
||||
use solidcraft_geom::prelude::*;
|
||||
fn white() -> OpaqueSurface {
|
||||
OpaqueSurface::new(Vec3::new(1.0, 1.0, 1.0), 1.0, 1.0, 1.5).unwrap()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user