Skip to main content

oxiphysics_geometry/implicit_geometry/
sdfrevolution_traits.rs

1//! # SdfRevolution - Trait Implementations
2//!
3//! This module contains trait implementations for `SdfRevolution`.
4//!
5//! ## Implemented Traits
6//!
7//! - `Sdf`
8//!
9//! 🤖 Generated with [SplitRS](https://github.com/cool-japan/splitrs)
10
11use super::functions::*;
12use super::types::SdfRevolution;
13
14impl<F: Fn(f64, f64) -> f64 + Send + Sync> Sdf for SdfRevolution<F> {
15    fn dist(&self, p: [f64; 3]) -> f64 {
16        let r = (p[0] * p[0] + p[2] * p[2]).sqrt();
17        (self.profile)(r, p[1])
18    }
19}