axiolid_surface/evaluate.rs
1//! Backend-open surface evaluation capability.
2
3use axiolid_core::{Point3, Scalar, Tolerance, Vec3};
4
5/// Evaluate one surface representation without coupling it to a kernel.
6pub trait SurfaceEvaluator<S>: core::fmt::Debug + Send + Sync {
7 /// Evaluator-specific structured error.
8 type Error: std::error::Error + Send + Sync + 'static;
9
10 /// Position at parameters `(u, v)`.
11 fn evaluate(
12 &self,
13 surface: &S,
14 u: Scalar,
15 v: Scalar,
16 tolerance: Tolerance,
17 ) -> Result<Point3, Self::Error>;
18
19 /// Surface normal at parameters `(u, v)`.
20 fn normal(
21 &self,
22 surface: &S,
23 u: Scalar,
24 v: Scalar,
25 tolerance: Tolerance,
26 ) -> Result<Vec3, Self::Error>;
27}