Struct linestring::cgmath_2d::LineString2[][src]

pub struct LineString2<T> where
    T: BaseFloat + Sync
{ pub connected: bool, // some fields omitted }
Expand description

A 2d line string, aka polyline. If the ‘connected’ field is set the ‘as_lines()’ method will connect start point with the end-point. Todo: The builder structure of this struct needs to be revisited

Fields

connected: bool

if connected is set the as_lines() method will add an extra line connecting the first and last point

Implementations

Copies the points of the iterator into the LineString2 from_iter is already claimed for into() objects.

Moves all the elements of other into Self, leaving other empty. TODO: currently ignores if other is connected or not.

Panics

Panics if the number of elements in the points vector overflows a usize.

Returns true if the lines are self intersecting If number of points < 10 then the intersections are tested using brute force O(n²) If more than that a sweep-line algorithm is used O(nlog(n)+ilog(n))

returns the number of points in the point list not the number of segments (add one if connected)

returns true if the point list is empty

Returns the line string as a Vec of lines Will be deprecated at some time, use self.as_lines_iter().collect() instead

Returns the line string as a iterator of lines

The iterator of as_lines_iter() does not implement ExactSizeIterator. This can be used as a work around for that problem

Copy this linestring2 into a linestring3, populating the axes defined by ‘plane’ An axis will always try to keep it’s position (e.g. y goes to y if possible). That way the operation is reversible (with regards to axis positions).

Simplify using Ramer–Douglas–Peucker algorithm

Simplify using Visvalingam–Whyatt algorithm. This algorithm will delete ‘points_to_delete’ of points from the polyline with the smallest area defined by one point and it’s neighbours.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

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

creates a connected LineString2 from the outlines of the Aabb2

Creates a value from an iterator. Read more

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

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

Performs the conversion.

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

Should always be Self

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more

Checks if self is actually part of its subset T (and can be converted to it).

Use with care! Same as self.to_subset but without any property checks. Always succeeds.

The inclusion map: converts self to the equivalent element of its superset.

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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.