25CTextileDecoupledLToL::CTextileDecoupledLToL(
int iNumXYarns,
int iNumYYarns,
double dXSpacing,
double dYSpacing,
double dXHeight,
double dYHeight,
int iNumBinderLayers,
bool bShapeBinders)
26 :
CTextileLayerToLayer(iNumXYarns, iNumYYarns, dXSpacing, dYSpacing, dXHeight, dYHeight, iNumBinderLayers, bShapeBinders)
48 vector<PATTERN3D> &Cell =
GetCell(x, y);
50 vector<int> BinderPositions;
51 int size = Cell.size();
52 vector<int>::iterator itzOffsets;
57 for (itzOffsets = zOffsets.begin(); itzOffsets != zOffsets.end(); itzOffsets++)
59 BinderPos = (size - 1) - *itzOffsets * 2;
60 if (BinderPos >= LastPos)
62 TGERROR(
"Binder offsets incorrectly ordered at position " << x <<
", " << y <<
", binder yarns positions not set");
65 BinderPositions.push_back(BinderPos);
71 for (
int j = size-1; j >= 0; j -= 2)
118 vector<int> BinderIndices;
119 vector<int>::iterator itBinder;
128 const vector<PATTERN3D> &Cell =
GetCell(0, j);
131 BinderIndices.push_back(BinderIndex);
136 for (itBinder = BinderIndices.begin(); itBinder != BinderIndices.end(); itBinder++)
144 int i = Cell.size() - 1;
145 int CurrentHeight = 0;
151 if (CurrentHeight == Height)
#define TGERROR(MESSAGE)
Macros used to report the file name and line number to the TexGenError and TexGenLog functions.
int GetYarnIndex(int x, int y, int z) const
void CheckUpVectors(int WarpIndex, bool Yarn=PATTERN3D_XYARN, bool bYarnsIndex=false) const
bool IsBinderYarn(int index) const
Check if X yarn is binder or warp. Returns true if binder.
const vector< PATTERN3D > & GetCell(int x, int y) const
void ShapeBinderYarns() const
Add extra nodes to binder layers to conform to shape of adjacent weft yarns.
void CheckUpVectors() const
Ensure that up vectors are not coincident with tangent.
int FindBinderHeight(const vector< PATTERN3D > &Cell, int Height) const
Find cell index of a given binder yarn given its height.
void SetBinderPosition(int x, int y, vector< int > zOffsets)
Sets the vertical positions of the binder yarns.
virtual void PopulateTiXmlElement(TiXmlElement &Element, OUTPUT_TYPE OutputType)
Used for saving data to XML.
virtual ~CTextileDecoupledLToL(void)
CTextileDecoupledLToL(int iNumXYarns, int iNumYYarns, double dXSpacing, double dYSpacing, double dXHeight, double dYHeight, int iNumBinderLayers, bool bShapeBinders=true)
Build a weave unit cell of given width, height, yarn spacing and fabric thickness.
bool BuildTextile() const
Build the textile yarns from the cell data.
virtual void PopulateTiXmlElement(TiXmlElement &Element, OUTPUT_TYPE OutputType)
Used for saving data to XML.
bool BuildLayerToLayerTextile() const
int AddBinderNodes(int CurrentNode, int i, int j, int Height) const
Add extra nodes to binder yarns to match shape of adjacent weft yarns.
Namespace containing a series of customised math operations not found in the standard c++ library.