Skip to main content

Polyline

Struct Polyline 

Source
pub struct Polyline {
    pub common: EntityCommon,
    pub flags: PolylineFlags,
    pub vertices: Vec<Vertex3D>,
}
Expand description

A 3D polyline entity

Fields§

§common: EntityCommon

Common entity data

§flags: PolylineFlags

Polyline flags

§vertices: Vec<Vertex3D>

Vertices of the polyline

Implementations§

Source§

impl Polyline

Source

pub fn new() -> Self

Create a new empty polyline

Source

pub fn from_points(points: Vec<Vector3>) -> Self

Create a polyline from a list of points

Source

pub fn add_vertex(&mut self, vertex: Vertex3D)

Add a vertex to the polyline

Source

pub fn add_point(&mut self, point: Vector3)

Add a point to the polyline

Source

pub fn vertex_count(&self) -> usize

Get the number of vertices

Source

pub fn is_closed(&self) -> bool

Check if closed

Source

pub fn close(&mut self)

Close the polyline

Trait Implementations§

Source§

impl Clone for Polyline

Source§

fn clone(&self) -> Polyline

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Polyline

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Polyline

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Entity for Polyline

Source§

fn handle(&self) -> Handle

Get the entity’s unique handle
Source§

fn set_handle(&mut self, handle: Handle)

Set the entity’s handle
Source§

fn layer(&self) -> &str

Get the entity’s layer name
Source§

fn set_layer(&mut self, layer: String)

Set the entity’s layer name
Source§

fn color(&self) -> Color

Get the entity’s color
Source§

fn set_color(&mut self, color: Color)

Set the entity’s color
Source§

fn line_weight(&self) -> LineWeight

Get the entity’s line weight
Source§

fn set_line_weight(&mut self, weight: LineWeight)

Set the entity’s line weight
Source§

fn transparency(&self) -> Transparency

Get the entity’s transparency
Source§

fn set_transparency(&mut self, transparency: Transparency)

Set the entity’s transparency
Source§

fn is_invisible(&self) -> bool

Check if the entity is invisible
Source§

fn set_invisible(&mut self, invisible: bool)

Set the entity’s visibility
Source§

fn bounding_box(&self) -> BoundingBox3D

Get the bounding box of the entity
Source§

fn translate(&mut self, offset: Vector3)

Transform the entity by a translation vector
Source§

fn entity_type(&self) -> &'static str

Get the entity type name
Source§

fn apply_transform(&mut self, transform: &Transform)

Apply a general transform to the entity Read more
Source§

fn apply_rotation(&mut self, axis: Vector3, angle: f64)

Apply rotation around an axis
Source§

fn apply_scaling(&mut self, scale: f64)

Apply uniform scaling
Source§

fn apply_scaling_xyz(&mut self, scale: Vector3)

Apply non-uniform scaling
Source§

fn apply_scaling_with_origin(&mut self, scale: Vector3, origin: Vector3)

Apply scaling with a specific origin point
Source§

fn apply_mirror(&mut self, transform: &Transform)

Apply a mirror transform with entity-specific corrections Read more
Source§

fn mirror_x(&mut self)

Mirror the entity across the YZ plane (negate X coordinates)
Source§

fn mirror_y(&mut self)

Mirror the entity across the XZ plane (negate Y coordinates)
Source§

fn mirror_z(&mut self)

Mirror the entity across the XY plane (negate Z coordinates)
Source§

fn mirror_about_line(&mut self, p1: Vector3, p2: Vector3)

Mirror the entity across a line defined by two points (in the XY plane)
Source§

fn mirror_about_plane(&mut self, point: Vector3, normal: Vector3)

Mirror the entity across an arbitrary plane
Source§

impl PartialEq for Polyline

Source§

fn eq(&self, other: &Polyline) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for Polyline

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.