pub struct IntersectionCurve<C, S> { /* private fields */ }
Expand description

Intersection curve between two surfaces.

Implementations§

This curve is a part of intersection of self.surface0() and self.surface1().

Examples found in repository?
src/decorators/intersection_curve.rs (line 115)
113
114
115
116
117
118
119
120
121
122
123
    pub fn search_triple(&self, t: f64) -> Option<(Point3, Point2, Point2)> {
        double_projection(
            self.surface0(),
            None,
            self.surface1(),
            None,
            self.leader.subs(t),
            self.leader.der(t),
            100,
        )
    }

This curve is a part of intersection of self.surface0() and self.surface1().

Examples found in repository?
src/decorators/intersection_curve.rs (line 117)
113
114
115
116
117
118
119
120
121
122
123
    pub fn search_triple(&self, t: f64) -> Option<(Point3, Point2, Point2)> {
        double_projection(
            self.surface0(),
            None,
            self.surface1(),
            None,
            self.leader.subs(t),
            self.leader.der(t),
            100,
        )
    }

Returns the polyline leading this curve.

Examples found in repository?
src/decorators/intersection_curve.rs (line 205)
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
    fn search_parameter<H: Into<SPHint1D>>(
        &self,
        point: Point3,
        hint: H,
        trials: usize,
    ) -> Option<f64> {
        let t = self
            .leader()
            .search_nearest_parameter(point, hint, trials)
            .unwrap();
        let pt = self.subs(t);
        match pt.near(&point) {
            true => Some(t),
            false => None,
        }
    }
}

/// Only derive from leading curve. Not precise.
impl<C, S> SearchNearestParameter<D1> for IntersectionCurve<C, S>
where
    C: ParametricCurve3D + SearchNearestParameter<D1, Point = Point3>,
    S: ParametricSurface3D + SearchNearestParameter<D2, Point = Point3>,
{
    type Point = Point3;
    fn search_nearest_parameter<H: Into<SPHint1D>>(
        &self,
        point: Point3,
        hint: H,
        trials: usize,
    ) -> Option<f64> {
        self.leader().search_nearest_parameter(point, hint, trials)
    }

The tolerance for generating this intersection curve.

Creates intersection curve with unchecked bound. This method is only for developer of truck, deplicated for users.

Search triple value of the point corresponding to the parameter t.

  • the coordinate on 3D space
  • the uv coordinate on self.surface0()
  • the uv coordinate on self.surface1()
Examples found in repository?
src/decorators/intersection_curve.rs (line 133)
133
134
135
136
137
138
139
140
141
142
143
    fn subs(&self, t: f64) -> Point3 { self.search_triple(t).unwrap().0 }
    fn der(&self, t: f64) -> Vector3 {
        let n = self.leader.der(t);
        let (_, p0, p1) = self.search_triple(t).unwrap();
        let d = self
            .surface0
            .normal(p0.x, p0.y)
            .cross(self.surface1.normal(p1.x, p1.y))
            .normalize();
        d * (n.dot(n) / d.dot(n))
    }

Optimizes intersection curve of Plane into Line.

Trait Implementations§

The range of the parameter of the curve.
The front end point of the curve.
The back end point of the curve.
Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Cuts one curve into two curves. Assigns the former curve to self and returns the later curve.
Formats the value using the given formatter. Read more
Deserialize this value from the given Serde deserializer. Read more
Inverts self
Returns the inverse.
The curve is in the space of Self::Point.
Creates the curve division (parameters, corresponding points). Read more

This method is unimplemented! Should panic!!

The curve is in the space of Self::Point.
The derivation vector of the curve.
Substitutes the parameter t.
Returns the derivation.

Only derive from leading curve. Not precise.

point
Search nearest parameter t such that self.subs(t) is nearest point.
Returns None if could not find such parameter.
point
Search parameter t such that self.subs(t) is near point.
Returns None if could not find such parameter.
Serialize this value into the given Serde serializer. Read more
transform by trans.
transformed geometry by trans.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.