Skip to main content

oxiphysics_geometry/implicit_geometry/
sdfboundedproxy_traits.rs

1//! # SdfBoundedProxy - Trait Implementations
2//!
3//! This module contains trait implementations for `SdfBoundedProxy`.
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::SdfBoundedProxy;
13
14impl<S: Sdf> Sdf for SdfBoundedProxy<S> {
15    fn dist(&self, p: [f64; 3]) -> f64 {
16        let bs_dist = len(sub(p, self.bsphere_center)) - self.bsphere_radius;
17        if bs_dist > 0.0 {
18            return bs_dist;
19        }
20        self.inner.dist(p)
21    }
22}