pub struct Point3 {
pub x: f64,
pub y: f64,
pub z: f64,
}Expand description
A point in 3D model space, in the document’s length unit.
Fields§
§x: f64X coordinate.
y: f64Y coordinate.
z: f64Z coordinate.
Implementations§
Source§impl Point3
impl Point3
Sourcepub fn distance_squared(self, other: Point3) -> f64
pub fn distance_squared(self, other: Point3) -> f64
Squared Euclidean distance to another point (no square root).
Sourcepub fn vector_from(self, origin: Point3) -> Vector3
pub fn vector_from(self, origin: Point3) -> Vector3
Displacement from origin to self, i.e. self - origin.
Sourcepub fn translated(self, vector: Vector3, scale: f64) -> Point3
pub fn translated(self, vector: Vector3, scale: f64) -> Point3
Point translated by scale * vector.
Trait Implementations§
impl Copy for Point3
Source§impl<'de> Deserialize<'de> for Point3
impl<'de> Deserialize<'de> for Point3
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl JsonSchema for Point3
impl JsonSchema for Point3
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreimpl StructuralPartialEq for Point3
Auto Trait Implementations§
impl Freeze for Point3
impl RefUnwindSafe for Point3
impl Send for Point3
impl Sync for Point3
impl Unpin for Point3
impl UnsafeUnpin for Point3
impl UnwindSafe for Point3
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more