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

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.

Methods

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> NumVertices for PointCloud<T>[src]

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

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

type Element = [T; 3]

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

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<PolyMesh<T>> for PointCloud<T>[src]

Convert a polygon mesh to a point cloud by erasing all polygon 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> 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<PointCloud<T>> for PolyMesh<T>[src]

Convert a point cloud into a polygon mesh.

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

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

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

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

Auto Trait Implementations

impl<T> Send for PointCloud<T>

impl<T> Sync for PointCloud<T>

impl<T> Unpin for PointCloud<T> where
    T: Unpin

impl<T> UnwindSafe for PointCloud<T> where
    T: UnwindSafe

impl<T> RefUnwindSafe for PointCloud<T> where
    T: RefUnwindSafe

Blanket Implementations

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

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<T, M> Rotate<T> for M where
    M: VertexPositions<Element = [T; 3]>,
    T: BaseFloat
[src]

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

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

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

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

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

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

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

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

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

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

Compute the bounding box of this object.

impl<T> Bytes for T[src]

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

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

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

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

type Owned = T

The resulting type after obtaining ownership.

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

type Error = !

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<T> Borrow<T> for T where
    T: ?Sized
[src]

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

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