Table of Contents

Class LoopSubdivision

Namespace
HelixToolkit.Wpf
Assembly
HelixToolkit.Wpf.dll

Builds a subdivision surface from a triangular mesh.

public sealed class LoopSubdivision
Inheritance
LoopSubdivision
Inherited Members

Remarks

http:///en.wikipedia.org/wiki/Subdivision_surface http:///en.wikipedia.org/wiki/Loop_subdivision_surface http:///research.microsoft.com/~cloop/thesis.pdf http:///www.dgp.toronto.edu/people/stam/reality/Research/pdf/loop.pdf http:///research.microsoft.com/en-us/um/people/cloop/

This code is based on a matlab program "loopSubdivision.m" by Jesús P. Mena-Chalco. http:///www.mathworks.com.au/matlabcentral/fileexchange/24942-loop-subdivision

Copyright (c) 2009, Jesus Mena All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Constructors

LoopSubdivision(IList<Point3D>, IList<int>)

Initializes a new instance of the LoopSubdivision class.

public LoopSubdivision(IList<Point3D> vertices, IList<int> triangleIndices)

Parameters

vertices IList<Point3D>

The vertices.

triangleIndices IList<int>

The triangle indices.

LoopSubdivision(MeshGeometry3D)

Initializes a new instance of the LoopSubdivision class.

public LoopSubdivision(MeshGeometry3D meshGeometry)

Parameters

meshGeometry MeshGeometry3D

The mesh geometry.

Properties

Positions

Gets the positions.

public IList<Point3D> Positions { get; }

Property Value

IList<Point3D>

The positions.

Scheme

Gets or sets the subdivision scheme.

public SubdivisionScheme Scheme { get; set; }

Property Value

SubdivisionScheme

The scheme.

Methods

Add(int, int, int)

Adds a triangle.

public void Add(int v0, int v1, int v2)

Parameters

v0 int

The first vertex index.

v1 int

The second vertex index.

v2 int

The third vertex index.

Sqr(double)

Squares the specified double.

public static double Sqr(double d)

Parameters

d double

The double.

Returns

double

The square.

Subdivide()

Subdivides this instance.

public void Subdivide()

Subdivide(int)

Subdivides this instance n times.

public void Subdivide(int n)

Parameters

n int

The number of subdivisions.

ToMesh3D()

Creates a mesh.

public Mesh3D ToMesh3D()

Returns

Mesh3D

A Mesh3D instance.

ToMeshGeometry3D()

Creates a mesh geometry.

public MeshGeometry3D ToMeshGeometry3D()

Returns

MeshGeometry3D

A MeshGeometry3D instance.