32    real_t t = (u - u0) / (u1 - u0);
 
   34    return ((T)(1) - t) * v0 + t * v1;
 
 
   54        mesh.addFace(w0, w01, w12);
 
   55        mesh.addFace(w0, w12, w2);
 
   61        mesh.addFace(vvv01, v1copy, vvv12);
 
   69        mesh.addFace(w0, w01, w12);
 
   70        mesh.addFace(w0, w12, w2);
 
   76        mesh.addFace(vvv01, v1copy, vvv12);
 
   79        gsWarn << 
"This situation of addThreeFlatTriangles should not happen, v1->x() = " 
   80               << v1->
x() << 
"." << std::endl;
 
 
   89    if(v0->
x() < 0 && v2->
x() < 0)
 
   94        addThreeFlatTrianglesOneOut(mesh, w0, w1, w2);
 
   96    else if(v0->
x() > 1 && v2->
x() > 1)
 
  101        addThreeFlatTrianglesOneOut(mesh, w0, w1, w2);
 
  104        gsWarn << 
"This situation of addThreeFlatTrianglesTwoOut should not happen, v1->x()=" 
  105               << v1->
x() << 
"." << std::endl;
 
 
  117    real_t v0x = v0->
x();
 
  118    real_t v1x = v1->
x();
 
  119    real_t v2x = v2->
x();
 
  121    while(v0x > 1 && v1x > 1 && v2x > 1)
 
  128    while(v0x < 0 && v1x < 0 && v2x < 0)
 
  135    if(v0x >= 0 && v0x <= 1 &&
 
  136       v1x >= 0 && v1x <= 1 &&
 
  137       v2x >= 0 && v2x <= 1)
 
  140            mesh.addVertex(v0x, v0->
y()),
 
  141            mesh.addVertex(v1x, v1->
y()),
 
  142            mesh.addVertex(v2x, v2->
y()));
 
  146        gsWarn << 
"This triangle does intersect the boundary.";
 
  147        gsWarn << 
"v0: " << v0x << 
", " << v0->
y() << std::endl;
 
  148        gsWarn << 
"v1: " << v1x << 
", " << v1->
y() << std::endl;
 
  149        gsWarn << 
"v2: " << v2x << 
", " << v2->
y() << std::endl;
 
 
  158    for(
size_t i=0; i<m_unfolded.getNumberOfTriangles(); i++)
 
  163        for(
size_t j=1; j<=3; ++j)
 
  165            vh[j-1] = m_unfolded.getVertex(m_unfolded.getGlobalVertexIndex(j, i));
 
  166            real_t u = vh[j-1]->
x();
 
  173        if( !out[0] && !out[1] && !out[2] )
 
  174            addOneFlatTriangleNotIntersectingBoundary(result, vh[0], vh[1], vh[2]);
 
  176        else if( out[0] && !out[1] && out[2] )
 
  177            addThreeFlatTrianglesTwoOut(result, vh[0], vh[1], vh[2]);
 
  178        else if( out[0] && out[1] && !out[2] )
 
  179            addThreeFlatTrianglesTwoOut(result, vh[1], vh[2], vh[0]);
 
  180        else if( !out[0] && out[1] && out[2] )
 
  181            addThreeFlatTrianglesTwoOut(result, vh[2], vh[0], vh[1]);
 
  183        else if( !out[0] && !out[1] && out[2] )
 
  184            addThreeFlatTrianglesOneOut(result, vh[1], vh[2], vh[0]);
 
  185        else if( !out[0] && out[1] && !out[2] )
 
  186            addThreeFlatTrianglesOneOut(result, vh[0], vh[1], vh[2]);
 
  187        else if( out[0] && !out[1] && !out[2] )
 
  188            addThreeFlatTrianglesOneOut(result, vh[2], vh[0], vh[1]);
 
  191            addOneFlatTriangleNotIntersectingBoundary(result, vh[0], vh[1], vh[2]);
 
 
  200                                                    real_t uMin, real_t uMax)
 const 
  203    real_t uLength = uMax - uMin;
 
  204    for(
index_t j=0; j<uv.cols(); j++)
 
  216void gsPeriodicParametrization<T>::initParameterPoints()
 
  218    typedef typename gsParametrization<T>::Point2D Point2D;
 
  220    size_t n = this->
m_mesh.getNumberOfInnerVertices();
 
  221    size_t N = this->
m_mesh.getNumberOfVertices();
 
  224    for (
size_t i = 1; i <= n; i++)
 
  228    size_t v0size = m_paramsV0.cols();
 
  229    size_t v1size = m_paramsV1.cols();
 
  230    GISMO_ASSERT(m_indicesV0.size() == v0size, 
"Different sizes of u0.");
 
  231    GISMO_ASSERT(m_indicesV1.size() == v1size, 
"Different sizes of u1.");
 
  233                 "Not prescribing all boundary points.");
 
  235    size_t numPtsSoFar = n;
 
  239    for(
size_t i=0; i<v0size; i++)
 
  240        this->
m_parameterPoints[m_indicesV0[i]-1] = Point2D(m_paramsV0(0, i), 0, numPtsSoFar++);
 
  243    for(
size_t i=0; i<v1size; i++)
 
  244        this->
m_parameterPoints[m_indicesV1[i]-1] = Point2D(m_paramsV1(0, i), 1, numPtsSoFar++);
 
A matrix with arbitrary coefficient type and fixed or dynamic size.
Definition gsMatrix.h:41
 
Class Representing a triangle mesh with 3D vertices.
Definition gsMesh.h:32
 
gsMesh & cleanMesh()
reorders the vertices of all faces of an .stl mesh, such that only 1 vertex is used instead of #(adja...
Definition gsMesh.hpp:250
 
VectorType m_parameterPoints
parameter points
Definition gsParametrization.h:58
 
const gsHalfEdgeMesh< T > m_mesh
mesh information
Definition gsParametrization.h:57
 
void addOneFlatTriangleNotIntersectingBoundary(gsMesh< T > &mesh, const VertexHandle &v0, const VertexHandle &v1, const VertexHandle &v2) const
Adds a flat triangle and shifts it inside the domain if necessary.
Definition gsPeriodicParametrization.hpp:109
 
gsMesh< T > createRestrictedFlatMesh() const
Trims the mesh to [0, 1]^2.
Definition gsPeriodicParametrization.hpp:154
 
real_t correspondingV(const VertexHandle &v0, const VertexHandle &v1, real_t u) const
Definition gsPeriodicParametrization.hpp:23
 
void addThreeFlatTrianglesOneOut(gsMesh< T > &mesh, const VertexHandle &v0, const VertexHandle &v1, const VertexHandle &v2) const
Definition gsPeriodicParametrization.hpp:38
 
void addThreeFlatTrianglesTwoOut(gsMesh< T > &mesh, const VertexHandle &v0, const VertexHandle &v1, const VertexHandle &v2) const
Definition gsPeriodicParametrization.hpp:84
 
gsVertex class that represents a 3D vertex for a gsMesh.
Definition gsVertex.h:27
 
T x() const
Definition gsVertex.h:120
 
T y() const
Definition gsVertex.h:122
 
#define index_t
Definition gsConfig.h:32
 
#define gsWarn
Definition gsDebug.h:50
 
#define GISMO_UNUSED(x)
Definition gsDebug.h:112
 
#define GISMO_ASSERT(cond, message)
Definition gsDebug.h:89
 
Abstract class with the functionality common to gsPeriodicStitch and gsPeriodicOverlap.
 
The G+Smo namespace, containing all definitions for the library.