TexGen
Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Private Member Functions | Friends | List of all members
TexGen::CYarn Class Reference

Represents a yarn consisting of master nodes, section and interpolation function. More...

#include <Yarn.h>

Inheritance diagram for TexGen::CYarn:
Inheritance graph
[legend]

Public Types

enum  BUILD_TYPE {
  NONE = 0 , LINE = 1<<0 , SURFACE = 1<<1 , VOLUME = 1<<2 ,
  ALL = LINE | SURFACE | VOLUME , CENTRE_PLANE = 1<<3
}
 

Public Member Functions

 CYarn (void)
 
 CYarn (TiXmlElement &Element)
 
 ~CYarn (void)
 
void PopulateTiXmlElement (TiXmlElement &Element, OUTPUT_TYPE OutputType)
 Used for saving data to XML. More...
 
void AddNode (const CNode &Node)
 Add a node to the end of the list of nodes (note the nodes must be ordered) More...
 
bool InsertNode (const CNode &Node, const CNode *pBefore)
 Insert a node before node pBefore. More...
 
bool InsertNode (const CNode &Node, int iIndex)
 Insert a node at given index. More...
 
bool ReplaceNode (int iIndex, CNode NewNode)
 Replace an existing node with given node. More...
 
bool DeleteNode (int iIndex)
 Delete an existing node. More...
 
const CNodeGetNode (int iIndex) const
 Get a master node by index. More...
 
void SetNodes (const vector< CNode > &Nodes)
 Set the nodes for this yarn given as an ordered list of nodes. More...
 
void AssignInterpolation (const CInterpolation &Interpolation)
 Assign an interpolation function to the yarn. More...
 
void AssignFibreDistribution (const CFibreDistribution &Distribution)
 Assign a fibre distribution. More...
 
void SetResolution (int iNumSlaveNodes, int iNumSectionPoints)
 Set the resolution of the mesh created. More...
 
bool SetResolution (int iNumSectionPoints)
 Set the resolution of the mesh created. More...
 
void SetEquiSpacedSectionMesh (bool bEquiSpacedSectionMesh)
 Meshes of the yarn should be equispaced if true. More...
 
void AssignSection (const CYarnSection &YarnSection)
 Assign a section to the yarn. More...
 
void Rotate (WXYZ Rotation, XYZ Origin=XYZ(0, 0, 0))
 Rotate the Yarn by given quaternion. More...
 
void Translate (XYZ Vector)
 Translate the Yarn by given vector. More...
 
bool AddAABBToMesh (CMesh &Mesh) const
 Add the axis aligned bounding box of the yarn to the Mesh. More...
 
bool AddAABBToMesh (CMesh &Mesh, const vector< pair< int, int > > &RepeatLimits) const
 Add the repeated axis aligned bounding box of the yarn to the Mesh. More...
 
bool AddNodesToMesh (CMesh &Mesh) const
 Add the master nodes to the mesh. More...
 
bool AddPathToMesh (CMesh &Mesh) const
 Add yarn centerline path to mesh. More...
 
bool AddSurfaceToMesh (CMesh &Mesh, bool bAddEndCaps=true) const
 Create surface mesh for this yarn and add it to the surface mesh object. More...
 
bool AddSurfaceToMesh (CMesh &Mesh, const vector< pair< int, int > > &RepeatLimits) const
 Create surface mesh for this yarn and add it to the surface mesh object. More...
 
bool AddSurfaceToMesh (CMesh &Mesh, const vector< XYZ > &TranslationVectors, bool bAddEndCaps=true) const
 Create surface mesh for this yarn and add it to the surface mesh object. More...
 
bool AddSurfaceToMesh (CMesh &Mesh, const CDomain &Domain, bool bAddEndCaps=true, bool bFillGaps=true) const
 Create surface mesh for this yarn bounded by the given domain and add it to the surface mesh object. More...
 
bool AddSurfaceToMesh (CMesh &Mesh, const CDomain &Domain, vector< CMesh > &DomainMeshes) const
 
bool AddVolumeToMesh (CMesh &Mesh) const
 Create volume mesh for this yarn and add it to the volume mesh object. More...
 
bool AddVolumeToMesh (CMesh &Mesh, const vector< pair< int, int > > &RepeatLimits) const
 Create volume mesh for this yarn and add it to the volume mesh object. More...
 
bool AddVolumeToMesh (CMesh &Mesh, const vector< XYZ > &TranslationVectors) const
 Create volume mesh for this yarn and add it to the volume mesh object. More...
 
bool AddVolumeToMesh (CMesh &Mesh, const CDomain &Domain) const
 Create volume mesh for this yarn bounded by the given domain and add it to the volume mesh object. More...
 
bool AddCentrePlaneToMesh (CMesh &Mesh) const
 Create mesh of the centre plane for this yarn and add it to the plane mesh object. More...
 
bool AddCentrePlaneToMesh (CMesh &Mesh, const vector< XYZ > &TranslationVectors) const
 Create mesh of the centre plane for this yarn and add it to the plane mesh object. More...
 
bool AddCentrePlaneToMesh (CMesh &Mesh, const CDomain &Domain) const
 Create centre plane mesh for this yarn bounded by the given domain and add it to the plane mesh object. More...
 
void AddRepeat (XYZ Repeat)
 Add a repeat vector. More...
 
void ClearRepeats ()
 Remove all repeat vectors. More...
 
void SetRepeats (const vector< XYZ > &Repeats)
 Set the repeat vectors. More...
 
bool RepeatMatchesEnds (XYZ Repeat) const
 Check if the repeat vector is the same as the last master node - first master node. More...
 
void ClearMasterNodeOrientations ()
 Set the tangents and up vectors of all the master nodes to null. More...
 
bool PointInsideYarn (const XYZ &Point, XYZ *pTangent=NULL, XY *pLoc=NULL, double *pVolumeFraction=NULL, double *pDistanceToSurface=NULL, double dTolerance=1e-9, XYZ *pOrientation=NULL, XYZ *pUp=NULL, bool bSurface=false) const
 Determine if the given point lies within the yarn (this function doesn't take the repeats into account). More...
 
bool PointInsideYarn (const XYZ &Point, const vector< XYZ > &Translations, XYZ *pTangent=NULL, XY *pLoc=NULL, double *pVolumeFraction=NULL, double *pDistanceToSurface=NULL, double dTolerance=1e-9, XYZ *pOrientation=NULL, XYZ *pUp=NULL, bool bSurface=false) const
 Similar to the above function except that this one takes into account repeated yarns. More...
 
bool FindPlaneContainingPoint (const XYZ &Point, double &u, double dTolerance, int iSeg) const
 Find the plane normal to the yarn which contains a specified point. More...
 
double FindClosestSurfacePoint (const XYZ &Point, XYZ &SurfacePoint, int iNumSectionPoints, double dTolerance=1e-9)
 Finds the closest point on the yarn surface to Point. More...
 
bool FindClosestSurfacePoint (const XYZ &Point, const vector< XYZ > &Translations, XYZ &SurfacePoint, int iNumSectionPoints, double dTolerance=1e-9)
 Finds the closest point on the yarn surface to Point. More...
 
void StraightenYarn (double dStraightness=1)
 Straighten the yarn. More...
 
pair< XYZ, XYZGetAABB () const
 Get axis aligned bounding box for the yarn (building the yarn if necessary) More...
 
pair< XYZ, XYZGetSectionAABB (int iIndex) const
 Get axis aligned bounding box for a yarn section (building the yarn if necessary) More...
 
double GetRawYarnLength () const
 Get the length of the yarn (building the yarn if necessary) More...
 
double GetRawYarnSectionLength (int iIndex) const
 Get the length of a yarn section (building the yarn if necessary) More...
 
double GetRawYarnVolume () const
 Get the volume of the yarn (building the yarn if necessary) More...
 
double GetRawRepeatArea () const
 Get repeat area. More...
 
vector< double > GetYarnSectionLengths () const
 Get the lengths of all the yarn sections. More...
 
const vector< CSlaveNode > & GetSlaveNodes (BUILD_TYPE Usage) const
 Get the slave nodes and build them if necessary. More...
 
double GetRealYarnLength (string Units="m") const
 Calculate the total yarn length. More...
 
double GetYarnLengthPerUnitArea (string Units="/m") const
 Calculate the total yarn length per unit area. More...
 
double GetRealYarnVolume (string Units="m^3") const
 Calculate the yarn volume. More...
 
double GetYarnVolumePerUnitArea (string Units="m") const
 Calculate the total yarn volume per unit area. More...
 
double GetFibreVolume (string Units="m^3") const
 
double GetFibreVolumePerUnitArea (string Units="m") const
 
double GetFibreYarnVolumeFraction () const
 
int GetNumSectionPoints () const
 Get number of section points. More...
 
int GetNumSlaveNodes () const
 Get number of slave nodes. More...
 
bool ConvertToInterpNodes ()
 
const vector< CNode > & GetMasterNodes () const
 
const vector< XYZ > & GetRepeats () const
 
const CYarnSectionGetYarnSection () const
 
const CInterpolationGetInterpolation () const
 
const CFibreDistributionGetFibreDistribution () const
 
int GetNumNodes () const
 
vector< double > GetSectionLengths () const
 
CMesh::ELEMENT_TYPE GetMeshPoint (CMesh &Mesh, const XY &Point, int &Index) const
 
void SetYarnLinearDensity (double dValue, string Units="kg/m")
 Set the fibre linear density, i.e. the mass per unit length of fibre. More...
 
void SetFibreDensity (double dValue, string Units="kg/m^3")
 Set the fibre density, i.e. the mass per unit volume of fibre. More...
 
void SetFibreDiameter (double dValue, string Units="m")
 Set the fibre diameter. More...
 
void SetFibresPerYarn (int iValue)
 Set the number of fibres in a yarn. More...
 
void SetYoungsModulus (double dValue, string Units="MPa")
 Set the Young's modulus for a yarn. More...
 
void SetYoungsModulusX (double dValue, string Units="MPa")
 
void SetYoungsModulusY (double dValue, string Units="MPa")
 
void SetYoungsModulusZ (double dValue, string Units="MPa")
 
void SetShearModulusXY (double dValue, string Units="MPa")
 Set the Shear modulus for a yarn. More...
 
void SetShearModulusXZ (double dValue, string Units="MPa")
 
void SetShearModulusYZ (double dValue, string Units="MPa")
 
void SetPoissonsRatio (double dValue)
 Set the Poisson's ratio for a yarn. More...
 
void SetPoissonsRatioX (double dValue)
 
void SetPoissonsRatioY (double dValue)
 
void SetPoissonsRatioZ (double dValue)
 
void SetAlphaX (double dValue, string Units="/K")
 Set the coefficients of thermal expansion for a yarn. More...
 
void SetAlphaY (double dValue, string Units="/K")
 
void SetAlphaZ (double dValue, string Units="/K")
 
void SetFibreArea (double dValue, string Units="m^2")
 Set the area occupied by fibres in a yarn cross-section. More...
 
void ResetYarnLinearDensity ()
 
void ResetFibreDensity ()
 
void ResetFibreDiameter ()
 
void ResetFibresPerYarn ()
 
void ResetFibreArea ()
 
void ResetYoungsModulusX ()
 
void ResetYoungsModulusY ()
 
void ResetYoungsModulusZ ()
 
void ResetShearModulusXY ()
 
void ResetShearModulusXZ ()
 
void ResetShearModulusYZ ()
 
void ResetAlphaX ()
 
void ResetAlphaY ()
 
void ResetAlphaZ ()
 
void ResetPoissonsRatioX ()
 
void ResetPoissonsRatioY ()
 
void ResetPoissonsRatioZ ()
 
double GetYarnLinearDensity (string Units="kg/m") const
 
double GetFibreDensity (string Units="kg/m^3") const
 
double GetFibreDiameter (string Units="m") const
 
int GetFibresPerYarn () const
 
double GetFibreArea (string Units="m^2") const
 Get the area occupied by fibres given fibre diameter and number of fibres. More...
 
double GetYoungsModulusX (string Units="MPa") const
 
double GetYoungsModulusY (string Units="MPa") const
 
double GetYoungsModulusZ (string Units="MPa") const
 
double GetShearModulusXY (string Units="MPa") const
 
double GetShearModulusXZ (string Units="MPa") const
 
double GetShearModulusYZ (string Units="MPa") const
 
double GetAlphaX (string Units="/K") const
 
double GetAlphaY (string Units="/K") const
 
double GetAlphaZ (string Units="/K") const
 
double GetPoissonsRatioX () const
 
double GetPoissonsRatioY () const
 
double GetPoissonsRatioZ () const
 

Public Attributes

CProperty m_YarnLinearDensity
 
CProperty m_FibreDensity
 
CProperty m_FibreArea
 
CProperty m_FibreDiameter
 
CProperty m_YoungsModulusX
 
CProperty m_YoungsModulusY
 
CProperty m_YoungsModulusZ
 
CProperty m_ShearModulusXY
 
CProperty m_ShearModulusXZ
 
CProperty m_ShearModulusYZ
 
CProperty m_AlphaX
 
CProperty m_AlphaY
 
CProperty m_AlphaZ
 
CProperty m_CalculatedArea
 

Protected Member Functions

bool BuildYarnIfNeeded (int iBuildType) const
 Create slave nodes and apply yarn section to them. More...
 
bool BuildSlaveNodes () const
 
bool BuildSections () const
 
bool BuildSectionMeshes () const
 
void AddEndCapsToMesh (CMesh &Mesh) const
 Add end caps to the mesh. More...
 
void CreateSectionAABBs () const
 Create the section Axis aligned bounding boxes. More...
 
void SetParent (const CTextile *pParent)
 Set the yarn parent. More...
 
double FindClosestEdgeDistance (XY &Loc, const vector< XY > &SectionPoints, double dTolerance) const
 Find closest perpendicular distance from point to polygon specified by SectionPoints. More...
 
void SetDefaultProperties ()
 Set default properties as specified by DefaultProperties.h. More...
 

Protected Attributes

vector< CNodem_MasterNodes
 Ordered list of nodes belonging to this Yarn. More...
 
CObjectContainer< CInterpolationm_pInterpolation
 Interpolation applied to smooth the yarn paths. More...
 
CObjectContainer< CYarnSectionm_pYarnSection
 Section applied to this yarn, with possibility of a varying cross-section. More...
 
CObjectContainer< CFibreDistributionm_pFibreDistribution
 Fibre distribution given to the yarn, used for getting Fibre Volume Fraction. More...
 
vector< XYZm_Repeats
 List of infinite repeat vectors, yarns will be repeated to infinite displaced by the specified vector multiplied integer values. More...
 
int m_iNumSlaveNodes
 Number of slave nodes to create. More...
 
int m_iNumSectionPoints
 Number of section points to create. More...
 
bool m_bEquiSpacedSectionMesh
 Whether or not volume meshes of the yarn should be equispaced. More...
 
int m_iNeedsBuilding
 Variable used to keep track of wether the yarn needs to be rebuilt or not and what part needs rebuilding. More...
 
vector< CSlaveNodem_SlaveNodes
 Ordered list of interpolated slave nodes belonging to this Yarn. More...
 
pair< XYZ, XYZm_AABB
 An axis aligned bounding box containing the full unrepeated yarn. More...
 
vector< pair< XYZ, XYZ > > m_SectionAABBs
 An axis aligned bounding box containing each section of the yarn. More...
 
vector< double > m_SectionLengths
 The length of each of the sections in the yarn. More...
 
CWeakPointer< const CTextilem_pParent
 Stores a pointer to the CTextile it belongs to. More...
 
int m_iFibresPerYarn
 
double m_PoissonsRatioX
 
double m_PoissonsRatioY
 
double m_PoissonsRatioZ
 

Private Member Functions

void AssignDefaults ()
 

Friends

class CTextile
 

Detailed Description

Represents a yarn consisting of master nodes, section and interpolation function.

Definition at line 48 of file Yarn.h.

Member Enumeration Documentation

◆ BUILD_TYPE

Enumerator
NONE 
LINE 
SURFACE 
VOLUME 
ALL 
CENTRE_PLANE 

Definition at line 56 of file Yarn.h.

Constructor & Destructor Documentation

◆ CYarn() [1/2]

CYarn::CYarn ( void  )

Definition at line 30 of file Yarn.cpp.

References AssignDefaults().

◆ CYarn() [2/2]

CYarn::CYarn ( TiXmlElement &  Element)

◆ ~CYarn()

CYarn::~CYarn ( void  )

Definition at line 40 of file Yarn.cpp.

Member Function Documentation

◆ AddAABBToMesh() [1/2]

bool CYarn::AddAABBToMesh ( CMesh Mesh) const

◆ AddAABBToMesh() [2/2]

bool CYarn::AddAABBToMesh ( CMesh Mesh,
const vector< pair< int, int > > &  RepeatLimits 
) const

Add the repeated axis aligned bounding box of the yarn to the Mesh.

Definition at line 777 of file Yarn.cpp.

References AddAABBToMesh(), TexGen::CMesh::CopySelfToRange(), TexGen::CMesh::InsertMesh(), m_Repeats, and TGERROR.

◆ AddCentrePlaneToMesh() [1/3]

bool CYarn::AddCentrePlaneToMesh ( CMesh Mesh) const

◆ AddCentrePlaneToMesh() [2/3]

bool CYarn::AddCentrePlaneToMesh ( CMesh Mesh,
const CDomain Domain 
) const

Create centre plane mesh for this yarn bounded by the given domain and add it to the plane mesh object.

Parameters
MeshMesh to add elements to
DomainDomain to restrict the mesh to

Definition at line 1220 of file Yarn.cpp.

References AddCentrePlaneToMesh(), TexGen::CDomain::ClipMeshToDomain(), TexGen::CDomain::GetTranslations(), and TexGen::CMesh::InsertMesh().

◆ AddCentrePlaneToMesh() [3/3]

bool CYarn::AddCentrePlaneToMesh ( CMesh Mesh,
const vector< XYZ > &  TranslationVectors 
) const

Create mesh of the centre plane for this yarn and add it to the plane mesh object.

Parameters
MeshMesh to add elements to
TranslationVectorsA number of translations be to applied to the yarn

Definition at line 1233 of file Yarn.cpp.

References AddCentrePlaneToMesh(), TexGen::CMesh::InsertMesh(), and TexGen::CMesh::MergeNodes().

◆ AddEndCapsToMesh()

void CYarn::AddEndCapsToMesh ( CMesh Mesh) const
protected

◆ AddNode()

void CYarn::AddNode ( const CNode Node)

Add a node to the end of the list of nodes (note the nodes must be ordered)

Parameters
NodeThe Node to add

Definition at line 196 of file Yarn.cpp.

References ALL, TexGen::CNode::GetPosition(), m_iNeedsBuilding, m_MasterNodes, and TGERROR.

Referenced by TexGen::CDomainPrism::CDomainPrism().

◆ AddNodesToMesh()

bool CYarn::AddNodesToMesh ( CMesh Mesh) const

Add the master nodes to the mesh.

Definition at line 803 of file Yarn.cpp.

References TexGen::CMesh::AddNode(), and m_MasterNodes.

◆ AddPathToMesh()

bool CYarn::AddPathToMesh ( CMesh Mesh) const

◆ AddRepeat()

void CYarn::AddRepeat ( XYZ  Repeat)

Add a repeat vector.

Definition at line 1253 of file Yarn.cpp.

References m_Repeats.

◆ AddSurfaceToMesh() [1/5]

bool CYarn::AddSurfaceToMesh ( CMesh Mesh,
bool  bAddEndCaps = true 
) const

Create surface mesh for this yarn and add it to the surface mesh object.

Parameters
MeshMesh to add elements to
bAddEndCapsIf true then the ends of the yarns will be closed with triangles

Definition at line 860 of file Yarn.cpp.

References TexGen::CMesh::AddElement(), AddEndCapsToMesh(), TexGen::CMesh::AddNode(), BuildYarnIfNeeded(), TexGen::CMesh::GetNumNodes(), m_SlaveNodes, TexGen::CMesh::QUAD, SURFACE, TGERROR, and TGLOG.

Referenced by AddSurfaceToMesh(), TexGen::CDomainPrism::BuildMesh(), TexGen::CTextileLayered::GetLayerMeshes(), GetRawYarnVolume(), TexGen::CTexGenRenderer::RenderYarn(), and TexGen::CShellElementExport::SaveShellElementToABAQUS().

◆ AddSurfaceToMesh() [2/5]

bool CYarn::AddSurfaceToMesh ( CMesh Mesh,
const CDomain Domain,
bool  bAddEndCaps = true,
bool  bFillGaps = true 
) const

Create surface mesh for this yarn bounded by the given domain and add it to the surface mesh object.

Parameters
MeshMesh to add elements to
DomainDomain to restrict the mesh to
bAddEndCapsIf true then the ends of the yarns will be closed with triangles

Definition at line 833 of file Yarn.cpp.

References AddSurfaceToMesh(), TexGen::CDomain::ClipMeshToDomain(), TexGen::CDomain::GetTranslations(), and TexGen::CMesh::InsertMesh().

◆ AddSurfaceToMesh() [3/5]

bool CYarn::AddSurfaceToMesh ( CMesh Mesh,
const CDomain Domain,
vector< CMesh > &  DomainMeshes 
) const

Create surface mesh for this yarn bounded by the given domain and add it to the surface mesh object Polygons created by the intersection of yarns with domain are added to the DomainMeshes object

Parameters
MeshMesh to add elements to
DomainDomain to restrict the mesh to

Definition at line 846 of file Yarn.cpp.

References AddSurfaceToMesh(), TexGen::CDomain::ClipMeshToDomain(), TexGen::CDomain::GetTranslations(), and TexGen::CMesh::InsertMesh().

◆ AddSurfaceToMesh() [4/5]

bool CYarn::AddSurfaceToMesh ( CMesh Mesh,
const vector< pair< int, int > > &  RepeatLimits 
) const

Create surface mesh for this yarn and add it to the surface mesh object.

Parameters
MeshMesh to add elements to
RepeatLimitsA vector of pairs of doubles that represent the repeat limits the number of items in the vector should be equal to the number of infinite repeats

Definition at line 947 of file Yarn.cpp.

References AddSurfaceToMesh(), TexGen::CMesh::CopySelfToRange(), TexGen::CMesh::InsertMesh(), m_Repeats, TexGen::CMesh::MergeNodes(), TexGen::CMesh::RemoveOpposingTriangles(), and TGERROR.

◆ AddSurfaceToMesh() [5/5]

bool CYarn::AddSurfaceToMesh ( CMesh Mesh,
const vector< XYZ > &  TranslationVectors,
bool  bAddEndCaps = true 
) const

Create surface mesh for this yarn and add it to the surface mesh object.

Parameters
MeshMesh to add elements to
TranslationVectorsA number of translations be to applied to the yarn
bAddEndCapsIf true then the ends of the yarns will be closed with triangles

Definition at line 976 of file Yarn.cpp.

References AddSurfaceToMesh(), TexGen::CMesh::InsertMesh(), TexGen::CMesh::MergeNodes(), and TexGen::CMesh::RemoveOpposingTriangles().

◆ AddVolumeToMesh() [1/4]

bool CYarn::AddVolumeToMesh ( CMesh Mesh) const

◆ AddVolumeToMesh() [2/4]

bool CYarn::AddVolumeToMesh ( CMesh Mesh,
const CDomain Domain 
) const

Create volume mesh for this yarn bounded by the given domain and add it to the volume mesh object.

Parameters
MeshMesh to add elements to
DomainDomain to restrict the mesh to

Definition at line 997 of file Yarn.cpp.

References AddVolumeToMesh(), TexGen::CDomain::ClipMeshToDomain(), TexGen::CDomain::GetTranslations(), and TexGen::CMesh::InsertMesh().

◆ AddVolumeToMesh() [3/4]

bool CYarn::AddVolumeToMesh ( CMesh Mesh,
const vector< pair< int, int > > &  RepeatLimits 
) const

Create volume mesh for this yarn and add it to the volume mesh object.

Parameters
MeshMesh to add elements to
RepeatLimitsA vector of pairs of doubles that represent the repeat limits the number of items in the vector should be equal to the number of infinite repeats

Definition at line 1110 of file Yarn.cpp.

References AddVolumeToMesh(), TexGen::CMesh::CopySelfToRange(), TexGen::CMesh::InsertMesh(), m_Repeats, TexGen::CMesh::MergeNodes(), and TGERROR.

◆ AddVolumeToMesh() [4/4]

bool CYarn::AddVolumeToMesh ( CMesh Mesh,
const vector< XYZ > &  TranslationVectors 
) const

Create volume mesh for this yarn and add it to the volume mesh object.

Parameters
MeshMesh to add elements to
TranslationVectorsA number of translations be to applied to the yarn

Definition at line 1138 of file Yarn.cpp.

References AddVolumeToMesh(), TexGen::CMesh::InsertMesh(), TexGen::CMesh::MergeNodes(), and TexGen::CMesh::RemoveOpposingTriangles().

◆ AssignDefaults()

void CYarn::AssignDefaults ( )
private

Definition at line 179 of file Yarn.cpp.

References AssignFibreDistribution(), AssignInterpolation(), AssignSection(), and SetResolution().

Referenced by CYarn().

◆ AssignFibreDistribution()

void CYarn::AssignFibreDistribution ( const CFibreDistribution Distribution)

Assign a fibre distribution.

Definition at line 658 of file Yarn.cpp.

References m_pFibreDistribution.

Referenced by AssignDefaults().

◆ AssignInterpolation()

void CYarn::AssignInterpolation ( const CInterpolation Interpolation)

Assign an interpolation function to the yarn.

The interpolation function determines what the exact path of the yarns will be between the master nodes. For example bezier curves or cubic splines.

Definition at line 641 of file Yarn.cpp.

References ALL, m_iNeedsBuilding, and m_pInterpolation.

Referenced by AssignDefaults(), TexGen::CGeometrySolver::CreateSystem(), and TexGen::CTextileDeformer::DeformTextile().

◆ AssignSection()

void CYarn::AssignSection ( const CYarnSection YarnSection)

◆ BuildSectionMeshes()

bool CYarn::BuildSectionMeshes ( ) const
protected

◆ BuildSections()

bool CYarn::BuildSections ( ) const
protected

◆ BuildSlaveNodes()

bool CYarn::BuildSlaveNodes ( ) const
protected

◆ BuildYarnIfNeeded()

bool CYarn::BuildYarnIfNeeded ( int  iBuildType) const
protected

Create slave nodes and apply yarn section to them.

Before this function is called, a yarn section must be applied to this yarn along with an interpolation function. The resolution of the yarn created must also be set. The order of these is not important, but they must all be done before building the yarn. This function should be called by any function that needs a built yarn (i.e. AddSurfaceToMesh). m_iNeedsBuilding should be set to ALL whenever a change to the geometry is made which would require a rebuild of the yarn. If iBuildType is set to VOLUME any sections used in this yarn must have section meshes assigned to them. Furthermore, all sections in the yarn must have compatible section meshes. What this means is that the number of nodes in the section meshes must be the same and the node linkage must be the same.

Parameters
iBuildTypeCan be a value from the BUILD_TYPE enum. Create either a "SURFACE" mesh or "VOLUME" mesh (Note: surface mesh is automatically created along with the volume mesh).
See also
SetResolution
AssignInterpolation
AssignSection
BUILD_TYPE
Returns
false if the yarn building failed

Definition at line 375 of file Yarn.cpp.

References BuildSectionMeshes(), BuildSections(), BuildSlaveNodes(), LINE, m_iNeedsBuilding, SURFACE, and VOLUME.

Referenced by AddAABBToMesh(), AddCentrePlaneToMesh(), AddPathToMesh(), AddSurfaceToMesh(), AddVolumeToMesh(), FindClosestSurfacePoint(), GetAABB(), GetRawYarnLength(), GetRawYarnSectionLength(), GetSectionAABB(), GetSlaveNodes(), GetYarnSectionLengths(), PointInsideYarn(), and SetResolution().

◆ ClearMasterNodeOrientations()

void CYarn::ClearMasterNodeOrientations ( )

Set the tangents and up vectors of all the master nodes to null.

Definition at line 1283 of file Yarn.cpp.

References m_MasterNodes.

◆ ClearRepeats()

void CYarn::ClearRepeats ( )

Remove all repeat vectors.

Definition at line 1258 of file Yarn.cpp.

References m_Repeats.

◆ ConvertToInterpNodes()

bool CYarn::ConvertToInterpNodes ( )

Converts a yarn with constant cross-section to interpolate sections between nodes Sets the section at each node to the original section

Definition at line 1959 of file Yarn.cpp.

References TexGen::CYarnSectionInterpNode::AddSection(), AssignSection(), TexGen::CYarnSection::Copy(), GetNumNodes(), TexGen::CYarnSectionConstant::GetSection(), TexGen::CYarnSection::GetType(), and GetYarnSection().

◆ CreateSectionAABBs()

void CYarn::CreateSectionAABBs ( ) const
protected

Create the section Axis aligned bounding boxes.

Definition at line 553 of file Yarn.cpp.

References m_MasterNodes, m_SectionAABBs, m_SlaveNodes, TexGen::Max(), and TexGen::Min().

Referenced by BuildSections().

◆ DeleteNode()

bool CYarn::DeleteNode ( int  iIndex)

Delete an existing node.

Parameters
iIndexThe index of the node to delete
Returns
false if the index is out of range

Definition at line 282 of file Yarn.cpp.

References ALL, AssignSection(), TexGen::CYarnSectionInterpNode::DeleteSection(), m_iNeedsBuilding, m_MasterNodes, and m_pYarnSection.

◆ FindClosestEdgeDistance()

double CYarn::FindClosestEdgeDistance ( XY Loc,
const vector< XY > &  SectionPoints,
double  dTolerance 
) const
protected

Find closest perpendicular distance from point to polygon specified by SectionPoints.

Definition at line 1914 of file Yarn.cpp.

References TexGen::DotProduct(), TexGen::Normalise(), TexGen::XY::x, and TexGen::XY::y.

Referenced by PointInsideYarn().

◆ FindClosestSurfacePoint() [1/2]

bool CYarn::FindClosestSurfacePoint ( const XYZ Point,
const vector< XYZ > &  Translations,
XYZ SurfacePoint,
int  iNumSectionPoints,
double  dTolerance = 1e-9 
)

Finds the closest point on the yarn surface to Point.

Parameters
PointThe point for which the closest point on the surface is being found
Translationsfor if repeat specified
SurfacePointUsed to return the closest point found
iNumSectionPointsSet this to the number of points to be generated around the cross-section The function returns one of these points so increasing this value will improve the accuracy of the point found
dToleranceTolerance for plane containing the search point
Returns
True if point found, False if not

Definition at line 1666 of file Yarn.cpp.

References FindClosestSurfacePoint().

◆ FindClosestSurfacePoint() [2/2]

double CYarn::FindClosestSurfacePoint ( const XYZ Point,
XYZ SurfacePoint,
int  iNumSectionPoints,
double  dTolerance = 1e-9 
)

Finds the closest point on the yarn surface to Point.

Parameters
PointThe point for which the closest point on the surface is being found
SurfacePointUsed to return the closest point found
iNumSectionPointsSet this to the number of points to be generated around the cross-section The function returns one of these points so increasing this value will improve the accuracy of the point found
dToleranceTolerance for plane containing the search point
Returns
The distance of the point to the surface

Definition at line 1619 of file Yarn.cpp.

References BuildYarnIfNeeded(), TexGen::YARN_POSITION_INFORMATION::dSectionPosition, FindPlaneContainingPoint(), TexGen::GetClosestPointIndex(), TexGen::CSlaveNode::GetIndex(), TexGen::GetLength(), TexGen::CSlaveNode::GetSectionPoints(), TexGen::CSlaveNode::GetT(), TexGen::YARN_POSITION_INFORMATION::iSection, m_MasterNodes, m_pInterpolation, m_pYarnSection, m_SectionLengths, TexGen::YARN_POSITION_INFORMATION::SectionLengths, SURFACE, and TexGen::CSlaveNode::UpdateSectionPoints().

Referenced by FindClosestSurfacePoint().

◆ FindPlaneContainingPoint()

bool CYarn::FindPlaneContainingPoint ( const XYZ Point,
double &  u,
double  dTolerance,
int  iSeg 
) const

Find the plane normal to the yarn which contains a specified point.

Returns false if iterative method doesn't find a plane Returns Planes, a vector of all instances of the normalised distance along the yarn where the plane crosses the yarn centreline. Where the yarn undulates there may be more than one plane

Definition at line 1549 of file Yarn.cpp.

References TexGen::PLANE::d, TexGen::DotProduct(), TexGen::CNode::GetNormal(), TexGen::CNode::GetPosition(), m_MasterNodes, m_pInterpolation, TexGen::PLANE::Normal, and TGLOG.

Referenced by FindClosestSurfacePoint(), and PointInsideYarn().

◆ GetAABB()

pair< XYZ, XYZ > CYarn::GetAABB ( ) const

Get axis aligned bounding box for the yarn (building the yarn if necessary)

Definition at line 1733 of file Yarn.cpp.

References BuildYarnIfNeeded(), m_AABB, and SURFACE.

◆ GetAlphaX()

double CProperties::GetAlphaX ( string  Units = "/K") const
inherited

◆ GetAlphaY()

double CProperties::GetAlphaY ( string  Units = "/K") const
inherited

◆ GetAlphaZ()

double CProperties::GetAlphaZ ( string  Units = "/K") const
inherited

◆ GetFibreArea()

double CProperties::GetFibreArea ( string  Units = "m^2") const
inherited

Get the area occupied by fibres given fibre diameter and number of fibres.

Either returns the value stored in m_dFibreArea or calculates it from m_iFibresPerYarn and m_FibreDiameter if they are set OR from m_dYarnLinearDensity and m_dFibreDensity if they are set.

Definition at line 251 of file Properties.cpp.

References TexGen::ConvertUnits(), TexGen::CProperty::GetSIValue(), TexGen::CProperty::GetValue(), TexGen::CProperty::IsSet(), TexGen::CProperties::m_CalculatedArea, TexGen::CProperties::m_FibreArea, TexGen::CProperties::m_FibreDensity, TexGen::CProperties::m_FibreDiameter, TexGen::CProperties::m_iFibresPerYarn, TexGen::CProperties::m_YarnLinearDensity, and PI.

Referenced by TexGen::CTextile3DWeave::GetFibreArea(), GetFibreVolume(), TexGen::CSimulationAbaqus::GetSectionVolumeFraction(), and PointInsideYarn().

◆ GetFibreDensity()

double CProperties::GetFibreDensity ( string  Units = "kg/m^3") const
inherited

◆ GetFibreDiameter()

double CProperties::GetFibreDiameter ( string  Units = "m") const
inherited

◆ GetFibreDistribution()

const CFibreDistribution * TexGen::CYarn::GetFibreDistribution ( ) const
inline

Definition at line 451 of file Yarn.h.

Referenced by TexGen::CSimulationAbaqus::GetSectionVolumeFraction().

◆ GetFibresPerYarn()

int CProperties::GetFibresPerYarn ( ) const
inherited

◆ GetFibreVolume()

double CYarn::GetFibreVolume ( string  Units = "m^3") const

Calculates the volume of fibre without taking account of repeat vectors or unit cell sizes. This only works when the linear density of the yarns and fibre density are specified.

Definition at line 1792 of file Yarn.cpp.

References TexGen::ConvertUnits(), TexGen::CProperties::GetFibreArea(), TexGen::CProperties::GetFibreDensity(), GetRealYarnLength(), TexGen::CProperties::GetYarnLinearDensity(), m_pParent, and TGERROR.

Referenced by GetFibreYarnVolumeFraction().

◆ GetFibreVolumePerUnitArea()

double CYarn::GetFibreVolumePerUnitArea ( string  Units = "m") const

Calculates the volume of fibre per unit area of fabric. This only works when the areal density and fibre density is specified. Alternatively if linear density and fibre density is specified calculation will be based on these values.

Definition at line 1830 of file Yarn.cpp.

References TexGen::ConvertUnits(), TexGen::CProperties::GetFibreDensity(), GetRawRepeatArea(), GetYarnLengthPerUnitArea(), TexGen::CProperties::GetYarnLinearDensity(), m_pParent, and TGERROR.

◆ GetFibreYarnVolumeFraction()

double CYarn::GetFibreYarnVolumeFraction ( ) const

Calculates the volume of fibre divided by the volume of yarn. See GetFibreVolume and GetYarnVolume functions for requirements.

Definition at line 1861 of file Yarn.cpp.

References GetFibreVolume(), GetRealYarnVolume(), and m_pParent.

◆ GetInterpolation()

const CInterpolation * TexGen::CYarn::GetInterpolation ( ) const
inline

◆ GetMasterNodes()

const vector< CNode > & TexGen::CYarn::GetMasterNodes ( ) const
inline

◆ GetMeshPoint()

CMesh::ELEMENT_TYPE CYarn::GetMeshPoint ( CMesh Mesh,
const XY Point,
int &  Index 
) const

◆ GetNode()

const CNode * CYarn::GetNode ( int  iIndex) const

Get a master node by index.

Definition at line 299 of file Yarn.cpp.

References m_MasterNodes, and NULL.

Referenced by TexGen::CShearedTextileWeave2D::AdjustSectionsForRotation(), and TexGen::CDomainPrism::GetPolygonLimits().

◆ GetNumNodes()

int TexGen::CYarn::GetNumNodes ( ) const
inline

Definition at line 452 of file Yarn.h.

Referenced by ConvertToInterpNodes().

◆ GetNumSectionPoints()

int TexGen::CYarn::GetNumSectionPoints ( ) const
inline

Get number of section points.

Definition at line 437 of file Yarn.h.

◆ GetNumSlaveNodes()

int TexGen::CYarn::GetNumSlaveNodes ( ) const
inline

Get number of slave nodes.

Definition at line 440 of file Yarn.h.

Referenced by TexGen::CTextileLayered::GetLayerMeshes().

◆ GetPoissonsRatioX()

double CProperties::GetPoissonsRatioX ( ) const
inherited

◆ GetPoissonsRatioY()

double CProperties::GetPoissonsRatioY ( ) const
inherited

◆ GetPoissonsRatioZ()

double CProperties::GetPoissonsRatioZ ( ) const
inherited

◆ GetRawRepeatArea()

double CYarn::GetRawRepeatArea ( ) const

Get repeat area.

This area corresponds to the area of a parallelogram formed by two repeat vectors. Note that in order for this to work the number of repeat vectors must be exactly equal to two otherwise the area returned is 0.

Definition at line 1722 of file Yarn.cpp.

References TexGen::CrossProduct(), TexGen::GetLength(), m_Repeats, and TGERROR.

Referenced by GetFibreVolumePerUnitArea(), GetYarnLengthPerUnitArea(), and GetYarnVolumePerUnitArea().

◆ GetRawYarnLength()

double CYarn::GetRawYarnLength ( ) const

Get the length of the yarn (building the yarn if necessary)

This function doesn't take care of units, it is the raw unconverted yarn length.

Definition at line 1689 of file Yarn.cpp.

References BuildYarnIfNeeded(), LINE, and m_SectionLengths.

Referenced by GetRealYarnLength(), GetYarnLengthPerUnitArea(), and SetResolution().

◆ GetRawYarnSectionLength()

double CYarn::GetRawYarnSectionLength ( int  iIndex) const

Get the length of a yarn section (building the yarn if necessary)

This function doesn't take care of units, it is the raw unconverted yarn section length.

Definition at line 1703 of file Yarn.cpp.

References BuildYarnIfNeeded(), LINE, m_SectionLengths, and TGERROR.

◆ GetRawYarnVolume()

double CYarn::GetRawYarnVolume ( ) const

Get the volume of the yarn (building the yarn if necessary)

This function doesn't take care of units, it is the raw unconverted yarn volume.

Definition at line 1696 of file Yarn.cpp.

References AddSurfaceToMesh(), and TexGen::CMesh::CalculateVolume().

Referenced by GetRealYarnVolume(), and GetYarnVolumePerUnitArea().

◆ GetRealYarnLength()

double CYarn::GetRealYarnLength ( string  Units = "m") const

Calculate the total yarn length.

This is the total length of yarn without taking in account of repeat vectors or unit cell sizes. It is calculated from the geometry alone and uses the m_GeometryScale to give the value in the requested units.

Definition at line 1755 of file Yarn.cpp.

References TexGen::ConvertUnits(), GetRawYarnLength(), and m_pParent.

Referenced by GetFibreVolume().

◆ GetRealYarnVolume()

double CYarn::GetRealYarnVolume ( string  Units = "m^3") const

Calculate the yarn volume.

This is the volume without taking account of repeat vectors or unit cell sizes. It is calculated from the geometry alone and uses the m_GeometryScale to give the value in the requested units.

Definition at line 1773 of file Yarn.cpp.

References TexGen::ConvertUnits(), GetRawYarnVolume(), and m_pParent.

Referenced by GetFibreYarnVolumeFraction().

◆ GetRepeats()

const vector< XYZ > & TexGen::CYarn::GetRepeats ( ) const
inline

◆ GetSectionAABB()

pair< XYZ, XYZ > CYarn::GetSectionAABB ( int  iIndex) const

Get axis aligned bounding box for a yarn section (building the yarn if necessary)

Definition at line 1740 of file Yarn.cpp.

References BuildYarnIfNeeded(), m_SectionAABBs, and SURFACE.

◆ GetSectionLengths()

vector< double > TexGen::CYarn::GetSectionLengths ( ) const
inline

Definition at line 453 of file Yarn.h.

Referenced by TexGen::CAdjustMeshInterference::AdjustSectionMeshes().

◆ GetShearModulusXY()

double CProperties::GetShearModulusXY ( string  Units = "MPa") const
inherited

◆ GetShearModulusXZ()

double CProperties::GetShearModulusXZ ( string  Units = "MPa") const
inherited

◆ GetShearModulusYZ()

double CProperties::GetShearModulusYZ ( string  Units = "MPa") const
inherited

◆ GetSlaveNodes()

const vector< CSlaveNode > & CYarn::GetSlaveNodes ( BUILD_TYPE  Usage) const

Get the slave nodes and build them if necessary.

Parameters
UsageSpecify what the slave nodes will be used for, this will determine what type of build is performed (LINE, SURFACE or VOLUME). If only the position of the slave nodes is required select LINE, if access to the slave node's sections is required select SURFACE, if access to the slave node's section mesh is required select VOLUME.

Definition at line 1749 of file Yarn.cpp.

References BuildYarnIfNeeded(), and m_SlaveNodes.

Referenced by TexGen::CAdjustMeshInterference::AdjustSectionMeshes(), TexGen::CExporter::ConvertYarn(), TexGen::CTextileDeformer::DeformTextile(), and TexGen::CDomainPrism::GetPolygonLimits().

◆ GetYarnLengthPerUnitArea()

double CYarn::GetYarnLengthPerUnitArea ( string  Units = "/m") const

Calculate the total yarn length per unit area.

Calculates the total length of yarn in the unit cell taking into account the repeat vectors. This function only works when each yarn has two repeat vectors assigned to it, otherwise it does not make sense to obtain a length per unit AREA.

Definition at line 1762 of file Yarn.cpp.

References TexGen::ConvertUnits(), GetRawRepeatArea(), GetRawYarnLength(), and m_pParent.

Referenced by GetFibreVolumePerUnitArea().

◆ GetYarnLinearDensity()

double CProperties::GetYarnLinearDensity ( string  Units = "kg/m") const
inherited

◆ GetYarnSection()

const CYarnSection * TexGen::CYarn::GetYarnSection ( ) const
inline

◆ GetYarnSectionLengths()

vector< double > CYarn::GetYarnSectionLengths ( ) const

Get the lengths of all the yarn sections.

Definition at line 1715 of file Yarn.cpp.

References BuildYarnIfNeeded(), LINE, and m_SectionLengths.

◆ GetYarnVolumePerUnitArea()

double CYarn::GetYarnVolumePerUnitArea ( string  Units = "m") const

Calculate the total yarn volume per unit area.

Calculates the volume of yarn in the unit cell taking into account the repeat vectors. This function only works when each yarn has two repeat vectors assigned to it, otherwise it does not make sense to obtain a volume per unit AREA. If 1 repeat vector is given then a volume per unit length would be more suitable, similarly 2 repeat vectors would give a volume per unit volume (i.e. a volume fraction of region occupied by yarns).

Definition at line 1781 of file Yarn.cpp.

References TexGen::ConvertUnits(), GetRawRepeatArea(), GetRawYarnVolume(), and m_pParent.

◆ GetYoungsModulusX()

double CProperties::GetYoungsModulusX ( string  Units = "MPa") const
inherited

◆ GetYoungsModulusY()

double CProperties::GetYoungsModulusY ( string  Units = "MPa") const
inherited

◆ GetYoungsModulusZ()

double CProperties::GetYoungsModulusZ ( string  Units = "MPa") const
inherited

◆ InsertNode() [1/2]

bool CYarn::InsertNode ( const CNode Node,
const CNode pBefore 
)

Insert a node before node pBefore.

Parameters
NodeThe Node to add
pBeforeInsert node before this node
Returns
false if it couldn't find pBefore in the list

Definition at line 213 of file Yarn.cpp.

References ALL, TexGen::CYarnSectionInterpNode::GetNodeSection(), TexGen::CYarnSectionInterpNode::InsertSection(), m_iNeedsBuilding, m_MasterNodes, m_pYarnSection, and TGERROR.

◆ InsertNode() [2/2]

bool CYarn::InsertNode ( const CNode Node,
int  iIndex 
)

Insert a node at given index.

Parameters
NodeThe Node to add
iIndexThe index which the new node will take
Returns
false if the index is invalid

Definition at line 236 of file Yarn.cpp.

References ALL, AssignSection(), TexGen::CYarnSectionInterpNode::GetNodeSection(), TexGen::CYarnSectionInterpNode::InsertSection(), m_iNeedsBuilding, m_MasterNodes, m_pYarnSection, and TGERROR.

◆ PointInsideYarn() [1/2]

bool CYarn::PointInsideYarn ( const XYZ Point,
const vector< XYZ > &  Translations,
XYZ pTangent = NULL,
XY pLoc = NULL,
double *  pVolumeFraction = NULL,
double *  pDistanceToSurface = NULL,
double  dTolerance = 1e-9,
XYZ pOrientation = NULL,
XYZ pUp = NULL,
bool  bSurface = false 
) const

Similar to the above function except that this one takes into account repeated yarns.

The translations can be calculated by creating a domain that encompases this point alone and call the calculate translation from the domain. However this would be in-efficient on a point by point basis. Consider using GetPointTangents from CTextile instead. A limitation with this function is that it only work for convex sections because of the way the it determines if a point lies within a section or not. Could be updated to work with non-convex sections at the expensive of performance. pTangent, pLoc, pVolumeFraction and pDistanceToSurface are output pointers, they can be NULL where the information is not needed.

Parameters
bSurfaceDefaults to false. Set to true where points are known to be on surface and simply want to return information without PointInside check

Definition at line 1537 of file Yarn.cpp.

References PointInsideYarn().

◆ PointInsideYarn() [2/2]

bool CYarn::PointInsideYarn ( const XYZ Point,
XYZ pTangent = NULL,
XY pLoc = NULL,
double *  pVolumeFraction = NULL,
double *  pDistanceToSurface = NULL,
double  dTolerance = 1e-9,
XYZ pOrientation = NULL,
XYZ pUp = NULL,
bool  bSurface = false 
) const

Determine if the given point lies within the yarn (this function doesn't take the repeats into account).

A limitation with this function is that it only work for convex sections because of the way the it determines if a point lies within a section or not. Could be updated to work with non-convex sections at the expensive of performance.

Definition at line 1336 of file Yarn.cpp.

References BuildYarnIfNeeded(), TexGen::CMesh::ConvertElementListToVector(), TexGen::DotProduct(), TexGen::YARN_POSITION_INFORMATION::dSectionPosition, FindClosestEdgeDistance(), FindPlaneContainingPoint(), TexGen::CSlaveNode::Get2DSectionPoints(), TexGen::CNode::GetAngle(), TexGen::CProperties::GetFibreArea(), TexGen::CSlaveNode::GetIndex(), GetMeshPoint(), TexGen::GetMinMaxXY(), TexGen::CMesh::GetNode(), TexGen::CMesh::GetNumNodes(), TexGen::CNode::GetPosition(), TexGen::CSlaveNode::GetSectionMesh(), TexGen::CNode::GetSide(), TexGen::CSlaveNode::GetT(), TexGen::CNode::GetTangent(), TexGen::CNode::GetUp(), TexGen::YARN_POSITION_INFORMATION::iSection, m_AABB, m_iNumSectionPoints, m_MasterNodes, m_pFibreDistribution, m_pInterpolation, m_pParent, m_pYarnSection, m_SectionAABBs, m_SectionLengths, TexGen::Max(), TexGen::Min(), TexGen::Normalise(), TexGen::CMesh::NUM_ELEMENT_TYPES, TexGen::PointInside(), TexGen::PointInsideBox(), TexGen::YARN_POSITION_INFORMATION::SectionLengths, SURFACE, TexGen::CSlaveNode::UpdateSectionMesh(), TexGen::CSlaveNode::UpdateSectionPoints(), VOLUME, TexGen::XYZ::x, TexGen::XY::x, TexGen::XYZ::y, TexGen::XY::y, and TexGen::XYZ::z.

Referenced by TexGen::CGeometrySolver::AssignFibreDirectionToElements(), TexGen::CDomainPrism::ClipMeshToDomain(), TexGen::CMesher::FillYarnTangentsData(), and PointInsideYarn().

◆ PopulateTiXmlElement()

void CYarn::PopulateTiXmlElement ( TiXmlElement &  Element,
OUTPUT_TYPE  OutputType 
)
virtual

◆ RepeatMatchesEnds()

bool CYarn::RepeatMatchesEnds ( XYZ  Repeat) const

Check if the repeat vector is the same as the last master node - first master node.

This function determines if the repeat vector will result in the origin of the repeated yarn to be connected to the end of the non-repeated yarn.

Definition at line 1268 of file Yarn.cpp.

References TexGen::GetLength(), and m_MasterNodes.

◆ ReplaceNode()

bool CYarn::ReplaceNode ( int  iIndex,
CNode  NewNode 
)

Replace an existing node with given node.

Parameters
NewNodeThe new node which will be replacing the existing node
iIndexThe index of the node to replace
Returns
false if the index is out of range

Definition at line 261 of file Yarn.cpp.

References ALL, TexGen::CNode::GetPosition(), m_iNeedsBuilding, m_MasterNodes, and TGERROR.

◆ ResetAlphaX()

void TexGen::CProperties::ResetAlphaX ( )
inlineinherited

Definition at line 165 of file Properties.h.

◆ ResetAlphaY()

void TexGen::CProperties::ResetAlphaY ( )
inlineinherited

Definition at line 166 of file Properties.h.

◆ ResetAlphaZ()

void TexGen::CProperties::ResetAlphaZ ( )
inlineinherited

Definition at line 167 of file Properties.h.

◆ ResetFibreArea()

void TexGen::CProperties::ResetFibreArea ( )
inlineinherited

Definition at line 158 of file Properties.h.

◆ ResetFibreDensity()

void TexGen::CProperties::ResetFibreDensity ( )
inlineinherited

Definition at line 155 of file Properties.h.

◆ ResetFibreDiameter()

void TexGen::CProperties::ResetFibreDiameter ( )
inlineinherited

Definition at line 156 of file Properties.h.

◆ ResetFibresPerYarn()

void TexGen::CProperties::ResetFibresPerYarn ( )
inlineinherited

Definition at line 157 of file Properties.h.

◆ ResetPoissonsRatioX()

void TexGen::CProperties::ResetPoissonsRatioX ( )
inlineinherited

Definition at line 168 of file Properties.h.

◆ ResetPoissonsRatioY()

void TexGen::CProperties::ResetPoissonsRatioY ( )
inlineinherited

Definition at line 169 of file Properties.h.

◆ ResetPoissonsRatioZ()

void TexGen::CProperties::ResetPoissonsRatioZ ( )
inlineinherited

Definition at line 170 of file Properties.h.

◆ ResetShearModulusXY()

void TexGen::CProperties::ResetShearModulusXY ( )
inlineinherited

Definition at line 162 of file Properties.h.

◆ ResetShearModulusXZ()

void TexGen::CProperties::ResetShearModulusXZ ( )
inlineinherited

Definition at line 163 of file Properties.h.

◆ ResetShearModulusYZ()

void TexGen::CProperties::ResetShearModulusYZ ( )
inlineinherited

Definition at line 164 of file Properties.h.

◆ ResetYarnLinearDensity()

void TexGen::CProperties::ResetYarnLinearDensity ( )
inlineinherited

Definition at line 154 of file Properties.h.

◆ ResetYoungsModulusX()

void TexGen::CProperties::ResetYoungsModulusX ( )
inlineinherited

Definition at line 159 of file Properties.h.

◆ ResetYoungsModulusY()

void TexGen::CProperties::ResetYoungsModulusY ( )
inlineinherited

Definition at line 160 of file Properties.h.

◆ ResetYoungsModulusZ()

void TexGen::CProperties::ResetYoungsModulusZ ( )
inlineinherited

Definition at line 161 of file Properties.h.

◆ Rotate()

void CYarn::Rotate ( WXYZ  Rotation,
XYZ  Origin = XYZ(0,0,0) 
)

Rotate the Yarn by given quaternion.

Definition at line 663 of file Yarn.cpp.

References ALL, m_iNeedsBuilding, m_MasterNodes, and m_Repeats.

◆ SetAlphaX()

void CProperties::SetAlphaX ( double  dValue,
string  Units = "/K" 
)
inherited

Set the coefficients of thermal expansion for a yarn.

Definition at line 204 of file Properties.cpp.

References TexGen::CProperties::m_AlphaX, and TexGen::CProperty::SetValue().

Referenced by TexGen::CProperties::SetDefaultProperties().

◆ SetAlphaY()

void CProperties::SetAlphaY ( double  dValue,
string  Units = "/K" 
)
inherited

◆ SetAlphaZ()

void CProperties::SetAlphaZ ( double  dValue,
string  Units = "/K" 
)
inherited

◆ SetDefaultProperties()

void CProperties::SetDefaultProperties ( )
protectedinherited

◆ SetEquiSpacedSectionMesh()

void CYarn::SetEquiSpacedSectionMesh ( bool  bEquiSpacedSectionMesh)

Meshes of the yarn should be equispaced if true.

When this is set to true, volume meshes of the yarn will be constructed such that the points on a cross-section are equispaced. This should result in higher quality volume meshes. Otherwise the spacing between the nodes is determined by the CSection parametric function.

Definition at line 315 of file Yarn.cpp.

References ALL, m_bEquiSpacedSectionMesh, and m_iNeedsBuilding.

◆ SetFibreArea()

void CProperties::SetFibreArea ( double  dValue,
string  Units = "m^2" 
)
inherited

Set the area occupied by fibres in a yarn cross-section.

If not set it can be calculated from the yarn linear density and fibre density.

Definition at line 140 of file Properties.cpp.

References TexGen::CProperties::m_FibreArea, and TexGen::CProperty::SetValue().

Referenced by TexGen::CTextile3DWeave::SetFibreArea(), and TexGen::CTextile3DWeave::SetYarnProperties().

◆ SetFibreDensity()

void CProperties::SetFibreDensity ( double  dValue,
string  Units = "kg/m^3" 
)
inherited

◆ SetFibreDiameter()

void CProperties::SetFibreDiameter ( double  dValue,
string  Units = "m" 
)
inherited

◆ SetFibresPerYarn()

void CProperties::SetFibresPerYarn ( int  iValue)
inherited

◆ SetNodes()

void CYarn::SetNodes ( const vector< CNode > &  Nodes)

Set the nodes for this yarn given as an ordered list of nodes.

Definition at line 188 of file Yarn.cpp.

References ALL, m_iNeedsBuilding, and m_MasterNodes.

◆ SetParent()

void CYarn::SetParent ( const CTextile pParent)
protected

Set the yarn parent.

Definition at line 1872 of file Yarn.cpp.

References m_pParent.

◆ SetPoissonsRatio()

void CProperties::SetPoissonsRatio ( double  dValue)
inherited

◆ SetPoissonsRatioX()

void CProperties::SetPoissonsRatioX ( double  dValue)
inherited

◆ SetPoissonsRatioY()

void CProperties::SetPoissonsRatioY ( double  dValue)
inherited

◆ SetPoissonsRatioZ()

void CProperties::SetPoissonsRatioZ ( double  dValue)
inherited

◆ SetRepeats()

void CYarn::SetRepeats ( const vector< XYZ > &  Repeats)

Set the repeat vectors.

Definition at line 1263 of file Yarn.cpp.

References m_Repeats.

Referenced by TexGen::CTextileDeformer::DeformTextile().

◆ SetResolution() [1/2]

bool CYarn::SetResolution ( int  iNumSectionPoints)

Set the resolution of the mesh created.

The number of slave nodes is calculated such that the distance between nodes is equal to the average distance between section points. This is done in an iterative manner, since the average distance between section points and length of the yarn is not known until the yarn is built.

Parameters
iNumSectionPointsThe number of points defining the section

Definition at line 323 of file Yarn.cpp.

References BuildYarnIfNeeded(), TexGen::CSection::GetCircumference(), GetRawYarnLength(), m_iNumSlaveNodes, m_SlaveNodes, SetResolution(), SURFACE, TGERROR, TGLOG, and TGLOGINDENT.

◆ SetResolution() [2/2]

void CYarn::SetResolution ( int  iNumSlaveNodes,
int  iNumSectionPoints 
)

Set the resolution of the mesh created.

Parameters
iNumSlaveNodesThe number of slave nodes to create
iNumSectionPointsThe number of points defining the section

Definition at line 306 of file Yarn.cpp.

References ALL, m_iNeedsBuilding, m_iNumSectionPoints, and m_iNumSlaveNodes.

Referenced by AssignDefaults(), TexGen::CDomainPrism::CDomainPrism(), and SetResolution().

◆ SetShearModulusXY()

void CProperties::SetShearModulusXY ( double  dValue,
string  Units = "MPa" 
)
inherited

Set the Shear modulus for a yarn.

Definition at line 189 of file Properties.cpp.

References TexGen::CProperties::m_ShearModulusXY, and TexGen::CProperty::SetValue().

Referenced by TexGen::CProperties::SetDefaultProperties().

◆ SetShearModulusXZ()

void CProperties::SetShearModulusXZ ( double  dValue,
string  Units = "MPa" 
)
inherited

◆ SetShearModulusYZ()

void CProperties::SetShearModulusYZ ( double  dValue,
string  Units = "MPa" 
)
inherited

◆ SetYarnLinearDensity()

void CProperties::SetYarnLinearDensity ( double  dValue,
string  Units = "kg/m" 
)
inherited

Set the fibre linear density, i.e. the mass per unit length of fibre.

Suppose 1 meter length of yarn weighs X kg, it's linear density is X kg/m

Definition at line 120 of file Properties.cpp.

References TexGen::CProperty::GetSIValue(), TexGen::CProperty::IsSet(), TexGen::CProperties::m_CalculatedArea, TexGen::CProperties::m_FibreDensity, TexGen::CProperties::m_YarnLinearDensity, and TexGen::CProperty::SetValue().

Referenced by TexGen::CTextile3DWeave::SetYarnLinearDensity(), and TexGen::CTextile3DWeave::SetYarnProperties().

◆ SetYoungsModulus()

void CProperties::SetYoungsModulus ( double  dValue,
string  Units = "MPa" 
)
inherited

◆ SetYoungsModulusX()

void CProperties::SetYoungsModulusX ( double  dValue,
string  Units = "MPa" 
)
inherited

◆ SetYoungsModulusY()

void CProperties::SetYoungsModulusY ( double  dValue,
string  Units = "MPa" 
)
inherited

◆ SetYoungsModulusZ()

void CProperties::SetYoungsModulusZ ( double  dValue,
string  Units = "MPa" 
)
inherited

◆ StraightenYarn()

void CYarn::StraightenYarn ( double  dStraightness = 1)

Straighten the yarn.

The master nodes are adjusted to vary between a completely straight yarn and yarn that is crimped as much as before calling this function. This is used for finite element code to adjust initial strains stored in the yarn.

Parameters
dStraightnessA value of 1 represents a completely straight yarn, a value of 0 represents an unchanged yarn. Values in between represent various degrees of flatness.

Definition at line 1293 of file Yarn.cpp.

References ALL, TexGen::CrossProduct(), TexGen::DotProduct(), m_iNeedsBuilding, m_MasterNodes, TexGen::Normalise(), and TGLOG.

◆ Translate()

void CYarn::Translate ( XYZ  Vector)

Translate the Yarn by given vector.

Definition at line 684 of file Yarn.cpp.

References ALL, m_iNeedsBuilding, and m_MasterNodes.

Referenced by TexGen::CTextileLayered::AddLayer(), and TexGen::CTextileLayered::ApplyLayerOffset().

Friends And Related Function Documentation

◆ CTextile

friend class CTextile
friend

Definition at line 50 of file Yarn.h.

Member Data Documentation

◆ m_AABB

pair<XYZ, XYZ> TexGen::CYarn::m_AABB
mutableprotected

An axis aligned bounding box containing the full unrepeated yarn.

Will be populated when the yarn surface is built.

Definition at line 514 of file Yarn.h.

Referenced by BuildSections(), CYarn(), GetAABB(), PointInsideYarn(), and PopulateTiXmlElement().

◆ m_AlphaX

CProperty TexGen::CProperties::m_AlphaX
inherited

◆ m_AlphaY

CProperty TexGen::CProperties::m_AlphaY
inherited

◆ m_AlphaZ

CProperty TexGen::CProperties::m_AlphaZ
inherited

◆ m_bEquiSpacedSectionMesh

bool TexGen::CYarn::m_bEquiSpacedSectionMesh
protected

Whether or not volume meshes of the yarn should be equispaced.

Definition at line 502 of file Yarn.h.

Referenced by BuildSectionMeshes(), and SetEquiSpacedSectionMesh().

◆ m_CalculatedArea

CProperty TexGen::CProperties::m_CalculatedArea
inherited

◆ m_FibreArea

CProperty TexGen::CProperties::m_FibreArea
inherited

◆ m_FibreDensity

CProperty TexGen::CProperties::m_FibreDensity
inherited

◆ m_FibreDiameter

CProperty TexGen::CProperties::m_FibreDiameter
inherited

◆ m_iFibresPerYarn

int TexGen::CProperties::m_iFibresPerYarn
protectedinherited

◆ m_iNeedsBuilding

int TexGen::CYarn::m_iNeedsBuilding
mutableprotected

Variable used to keep track of wether the yarn needs to be rebuilt or not and what part needs rebuilding.

Definition at line 507 of file Yarn.h.

Referenced by AddNode(), AssignInterpolation(), AssignSection(), BuildSectionMeshes(), BuildSections(), BuildSlaveNodes(), BuildYarnIfNeeded(), CYarn(), DeleteNode(), InsertNode(), PopulateTiXmlElement(), ReplaceNode(), Rotate(), SetEquiSpacedSectionMesh(), SetNodes(), SetResolution(), StraightenYarn(), and Translate().

◆ m_iNumSectionPoints

int TexGen::CYarn::m_iNumSectionPoints
protected

Number of section points to create.

Definition at line 501 of file Yarn.h.

Referenced by AddCentrePlaneToMesh(), BuildSectionMeshes(), BuildSections(), CYarn(), PointInsideYarn(), PopulateTiXmlElement(), and SetResolution().

◆ m_iNumSlaveNodes

int TexGen::CYarn::m_iNumSlaveNodes
protected

Number of slave nodes to create.

Definition at line 500 of file Yarn.h.

Referenced by BuildSlaveNodes(), CYarn(), PopulateTiXmlElement(), and SetResolution().

◆ m_MasterNodes

vector<CNode> TexGen::CYarn::m_MasterNodes
protected

◆ m_pFibreDistribution

CObjectContainer<CFibreDistribution> TexGen::CYarn::m_pFibreDistribution
protected

Fibre distribution given to the yarn, used for getting Fibre Volume Fraction.

Definition at line 497 of file Yarn.h.

Referenced by AssignFibreDistribution(), CYarn(), PointInsideYarn(), and PopulateTiXmlElement().

◆ m_pInterpolation

CObjectContainer<CInterpolation> TexGen::CYarn::m_pInterpolation
protected

Interpolation applied to smooth the yarn paths.

Definition at line 495 of file Yarn.h.

Referenced by AssignInterpolation(), BuildSlaveNodes(), CYarn(), FindClosestSurfacePoint(), FindPlaneContainingPoint(), PointInsideYarn(), and PopulateTiXmlElement().

◆ m_PoissonsRatioX

double TexGen::CProperties::m_PoissonsRatioX
protectedinherited

◆ m_PoissonsRatioY

double TexGen::CProperties::m_PoissonsRatioY
protectedinherited

◆ m_PoissonsRatioZ

double TexGen::CProperties::m_PoissonsRatioZ
protectedinherited

◆ m_pParent

CWeakPointer<const CTextile> TexGen::CYarn::m_pParent
protected

Stores a pointer to the CTextile it belongs to.

Note: This can be dangerous when a yarn is copy constructed. The copied version will retain a pointer to the parent textile. If that textile then gets deleted the pointer will become invalid.

Definition at line 539 of file Yarn.h.

Referenced by GetFibreVolume(), GetFibreVolumePerUnitArea(), GetFibreYarnVolumeFraction(), GetRealYarnLength(), GetRealYarnVolume(), GetYarnLengthPerUnitArea(), GetYarnVolumePerUnitArea(), PointInsideYarn(), and SetParent().

◆ m_pYarnSection

CObjectContainer<CYarnSection> TexGen::CYarn::m_pYarnSection
protected

Section applied to this yarn, with possibility of a varying cross-section.

Definition at line 496 of file Yarn.h.

Referenced by AddCentrePlaneToMesh(), AssignSection(), BuildSectionMeshes(), BuildSections(), CYarn(), DeleteNode(), FindClosestSurfacePoint(), InsertNode(), PointInsideYarn(), and PopulateTiXmlElement().

◆ m_Repeats

vector<XYZ> TexGen::CYarn::m_Repeats
protected

List of infinite repeat vectors, yarns will be repeated to infinite displaced by the specified vector multiplied integer values.

Definition at line 499 of file Yarn.h.

Referenced by AddAABBToMesh(), AddRepeat(), AddSurfaceToMesh(), AddVolumeToMesh(), ClearRepeats(), CYarn(), GetRawRepeatArea(), PopulateTiXmlElement(), Rotate(), and SetRepeats().

◆ m_SectionAABBs

vector<pair<XYZ, XYZ> > TexGen::CYarn::m_SectionAABBs
mutableprotected

An axis aligned bounding box containing each section of the yarn.

A section is defined as the part of the yarn between master nodes. The first section refers to the section between the first two nodes and so on. The size of the vector is one less than the number of master nodes. Will be populated when the yarn surface is built.

Definition at line 523 of file Yarn.h.

Referenced by CreateSectionAABBs(), CYarn(), GetSectionAABB(), PointInsideYarn(), and PopulateTiXmlElement().

◆ m_SectionLengths

vector<double> TexGen::CYarn::m_SectionLengths
mutableprotected

The length of each of the sections in the yarn.

Will be populated when yarn surface is built.

Definition at line 529 of file Yarn.h.

Referenced by AddCentrePlaneToMesh(), BuildSectionMeshes(), BuildSections(), BuildSlaveNodes(), CYarn(), FindClosestSurfacePoint(), GetRawYarnLength(), GetRawYarnSectionLength(), GetYarnSectionLengths(), PointInsideYarn(), and PopulateTiXmlElement().

◆ m_ShearModulusXY

CProperty TexGen::CProperties::m_ShearModulusXY
inherited

◆ m_ShearModulusXZ

CProperty TexGen::CProperties::m_ShearModulusXZ
inherited

◆ m_ShearModulusYZ

CProperty TexGen::CProperties::m_ShearModulusYZ
inherited

◆ m_SlaveNodes

vector<CSlaveNode> TexGen::CYarn::m_SlaveNodes
mutableprotected

◆ m_YarnLinearDensity

CProperty TexGen::CProperties::m_YarnLinearDensity
inherited

◆ m_YoungsModulusX

CProperty TexGen::CProperties::m_YoungsModulusX
inherited

◆ m_YoungsModulusY

CProperty TexGen::CProperties::m_YoungsModulusY
inherited

◆ m_YoungsModulusZ

CProperty TexGen::CProperties::m_YoungsModulusZ
inherited

The documentation for this class was generated from the following files: