Skip to content
Snippets Groups Projects
Commit d48d2022 authored by Gregor Kobsik's avatar Gregor Kobsik
Browse files

Update README.md

started the documentation for the initial implementation of the CT interpolation.
parent b8ec92c3
No related branches found
No related tags found
No related merge requests found
# TriangularInterpolants
Provides different interpolants for values over triangular meshes.
\ No newline at end of file
Provides different interpolants for values over triangular meshes. \
Currently supporting only the Clough-Tocher (CT) interpolant.\
\
Documentation-Version: `dev-0.2.0`
[[_TOC_]]
## src
### TriangularInterpolant2D
doc-ver: `dev-0.2.0`
Wrapped class to allow for later easier extensions to different interpolant algorithms.
### CloughTocherInterpolant
doc-ver: `dev-0.2.0`
Provides an API to execute the interpolation and output the results. \
The implementation is following the paper: [Mann, "Cubic precision Clough-Tocher interpolation", 1998](https://cs.uwaterloo.ca/research/tr/1998/15/CS-98-15.pdf)
##### CloughTocherInterpolant
doc-ver: `dev-0.2.0`
CloughTocherInterpolant::CloughTocherInterpolant(
std::shared_ptr<TriMesh> mesh,
std::vector<std::vector<float>> values,
CTType type
)
Creates an object that holds the results of the CT interpolation with the given mesh and the given values based on the desired type.
The CT interpolation is performed upon the creation.
mesh - is a ***TriMesh*** class, which holds informations about the topology of the mesh. Only the vertices positions and triangles need to be provided.
The normal values needed for the CT algorithm are computet for each vertex at the beginning of the algorithm. \
values - are values which 'live' above the vertices. These values will be interpolated. The vertex count of the mesh and the number of provided values have to match.
Furthermore the dimensionality of the vertex attribute of the mesh and the dimensionality of the provided values has to match. \
type - the type of the CT interpolation that will be performed. Currently only *CTType::CT_BASIC* is supported.
One can imagine the CT interpolation of values, as the height (values) of each vertex beeing smoothly interpolated between every vertex, resulting in a smooth surface,
that can be continiously evaluated at every point within the mesh. The CT algorithm uses Bezier curves/surfaces to describe the computed function. These surfaces are represented
by Bezier control points which are stored by the class. One can easily evaluate a point on a surface described by Bezier control points by applying the DeCasteljau algorithm.
The output of the interpolation at as specific point can be queried by **getValueAt()** or one can get the ***TriMeshCT*** object,
that holds the result of the CT interpolation by calling **getMesh()**.
##### getValueAt
doc-ver: `dev-0.2.0`
float
CloughTocherInterpolant::getValueAt(
glm::vec2 position,
uint index
)
##### getMesh
doc-ver: `dev-0.2.0`
std::shared_ptr<TriMesh>
CloughTocherInterpolant::getMesh(
)
##### getHeightVector
doc-ver: `dev-0.2.0`
std::vector< std::vector < std::vector<float>>>
CloughTocherInterpolant::getHeightVector(
glm::vec2 resulution,
glm::vec2 cropRange
)
##### computeNormals
doc-ver: `dev-0.2.0`
bool
CloughTocherInterpolant::computeNormals(
NormalType type
)
##### computeControlPointsXZPositions
doc-ver: `dev-0.2.0`
bool
CloughTocherInterpolant::computeControlPointsXZPositions(
)
##### CT_step1
doc-ver: `dev-0.2.0`
bool
CloughTocherInterpolant::CT_step1(
std::vector<std::vector<float>> values
)
##### CT_step2_3
doc-ver: `dev-0.2.0`
bool
CloughTocherInterpolant::CT_step2_3(
)
##### CT_step4
doc-ver: `dev-0.2.0`
bool
CloughTocherInterpolant::CT_step4(
)
##### CT_step5
doc-ver: `dev-0.2.0`
bool
CloughTocherInterpolant::CT_step5(
)
##### CT_step6
doc-ver: `dev-0.2.0`
bool
CloughTocherInterpolant::CT_step6(
)
##### evaluateBezierPatchAt
doc-ver: `dev-0.2.0`
float
CloughTocherInterpolant::evaluateBezierPatchAt(
glm::vec2 position,
uint index
)
## Geometry
### TriMesh
### TriMeshCT
### TriMeshUtils
## Utils
### DeCstaljauAlgorithm
### GeometryFunc
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment