Struct gut::mesh::pointcloud::PointCloud[][src]

pub struct PointCloud<T: Real> {
    pub vertex_positions: IntrinsicAttribute<[T; 3], VertexIndex>,
    pub vertex_attributes: AttribDict<VertexIndex>,
}

A collection of disconnected points, possibly but not necessarily representing some geometry. The points may have arbitrary attributes assigned to them such as orientation.

Fields

vertex_positions: IntrinsicAttribute<[T; 3], VertexIndex>

Vertex positions.

vertex_attributes: AttribDict<VertexIndex>

Vertex attribute data.

Implementations

impl<T: Real> PointCloud<T>[src]

pub fn new(verts: Vec<[T; 3]>) -> PointCloud<T>[src]

Construct a PointCloud from an array of vertices.

Examples

use gut::mesh::{PointCloud, VertexPositions};
let points = vec![
    [0.0, 0.0, 0.0],
    [1.0, 0.0, 0.0],
    [0.0, 1.0, 0.0],
    [1.0, 1.0, 0.0],
    [0.0, 0.0, 1.0],
    [1.0, 0.0, 1.0]];

let ptcloud = PointCloud::new(points.clone());

let positions = ptcloud.vertex_positions().to_vec();
assert_eq!(positions, points);

Trait Implementations

impl<T: Real> Attrib for PointCloud<T>[src]

impl<T: Clone + Real> Clone for PointCloud<T>[src]

impl<T: Debug + Real> Debug for PointCloud<T>[src]

impl<T: Real> Default for PointCloud<T>[src]

fn default() -> Self[src]

Produce an empty PointCloud.

This is not particularly useful on its own, however it can be used as a null case for various mesh algorithms.

impl<T: Real, M: VertexMesh<T>> From<&'_ M> for PointCloud<T>[src]

Convert a borrow of any VertexMesh into a PointCloud. Since we can't destructure a generic type, it's sufficient to do the conversion from a reference to a mesh.

impl<T: Real> From<PointCloud<T>> for PolyMesh<T>[src]

Convert a point cloud into a polygon mesh.

impl<T: Real> From<PolyMesh<T>> for PointCloud<T>[src]

Convert a polygon mesh to a point cloud by erasing all polygon data.

impl<T: Real> From<QuadMesh<T>> for PointCloud<T>[src]

Convert a quad mesh to a point cloud by erasing all quad data.

impl<T: Real> From<TetMesh<T>> for PointCloud<T>[src]

Convert a tet mesh to a point cloud by erasing all tet data.

impl<T: Real> From<TriMesh<T>> for PointCloud<T>[src]

Convert a triangle mesh to a point cloud by erasing all triangle data.

impl<T: Real> Merge for PointCloud<T>[src]

impl<T: Real> NumVertices for PointCloud<T>[src]

impl<T: PartialEq + Real> PartialEq<PointCloud<T>> for PointCloud<T>[src]

impl<T: Real> StructuralPartialEq for PointCloud<T>[src]

impl<T: Real> VertexAttrib for PointCloud<T>[src]

impl<T: Real> VertexPositions for PointCloud<T>[src]

type Element = [T; 3]

Auto Trait Implementations

impl<T> RefUnwindSafe for PointCloud<T> where
    T: RefUnwindSafe
[src]

impl<T> Send for PointCloud<T>[src]

impl<T> Sync for PointCloud<T>[src]

impl<T> Unpin for PointCloud<T> where
    T: Unpin
[src]

impl<T> UnwindSafe for PointCloud<T> where
    T: UnwindSafe
[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> AsSlice<T> for T[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<M, T> BoundingBox<T> for M where
    T: Real,
    M: VertexPositions<Element = [T; 3]>, 
[src]

pub fn bounding_box(&Self) -> BBox<T>[src]

Compute the bounding box of this object.

impl<T> CloneBytes for T where
    T: 'static + Clone
[src]

impl<T> DebugBytes for T where
    T: 'static + Debug
[src]

impl<T> Downcast for T where
    T: Any

impl<T> DowncastSync for T where
    T: Send + Sync + Any

impl<T> DropBytes for T where
    T: 'static, 
[src]

impl<T> Elem for T where
    T: Any + DropBytes
[src]

impl<T> From<T> for T[src]

impl<'a, S, I> Get<'a, I> for S where
    I: GetIndex<'a, S>, 
[src]

type Output = <I as GetIndex<'a, S>>::Output

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<S, I> Isolate<I> for S where
    I: IsolateIndex<S>, 
[src]

type Output = <I as IsolateIndex<S>>::Output

impl<T> PartialEqBytes for T where
    T: 'static + PartialEq<T>, 
[src]

impl<M> Partition for M where
    M: Attrib
[src]

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T, N> PushArrayToVec<N> for T where
    T: Clone,
    N: Array<T>, 
[src]

impl<T, M> Rotate<T> for M where
    T: BaseFloat,
    M: VertexPositions<Element = [T; 3]>, 
[src]

pub fn rotate_by_matrix(&mut Self, [[T; 3]; 3])[src]

Rotate the mesh using the given column-major rotation matrix.

impl<S, T> Rotated<T> for S where
    T: BaseFloat,
    S: Rotate<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, M> Scale<T> for M where
    T: BaseFloat,
    M: VertexPositions<Element = [T; 3]>, 
[src]

pub fn scale(&mut Self, [T; 3])[src]

Scale a mesh in 3D by a given vector of scale factors. s = [1.0; 3] corresponds to a noop.

impl<S, T> Scaled<T> for S where
    T: Copy,
    S: Scale<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, M> Translate<T> for M where
    T: BaseFloat,
    M: VertexPositions<Element = [T; 3]>, 
[src]

pub fn translate(&mut Self, [T; 3])[src]

Translate the mesh by the given translation vector (displacement) t.

impl<S, T> Translated<T> for S where
    S: Translate<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<M, T> VertexMesh<T> for M where
    T: Real,
    M: Attrib + VertexAttrib + NumVertices + VertexPositions<Element = [T; 3]>, 
[src]