Export yarn path

General discussion about TexGen.

Moderators: Martin, Developers

Post Reply
UOMO
Regular
Posts: 45
Joined: Tue Feb 24, 2015 10:02 am

Export yarn path

Post by UOMO »

Hi!

Is there any script available to export the yarn paths (and perhaps points of the cross section) of a given textile?

Thanks!.
louisepb
Project Leader
Posts: 998
Joined: Tue Dec 08, 2009 2:27 pm
Location: Nottingham

Re: Export yarn path

Post by louisepb »

Hi,

I don't know of a script that does this but you can use yarn.GetMasterNodes() to get the specified nodes or yarn.GetSlaveNodes() to get the intermediate nodes determined by the interpolation.

From the slave nodes you can use the CSlaveNode::GetSectionPoints function which will return a vector of XYZ points.

I am part way through editing a scripting guide which was started by a colleague last year. I really need to get it finished...

Hope that helps,
Louise
UOMO
Regular
Posts: 45
Joined: Tue Feb 24, 2015 10:02 am

Re: Export yarn path

Post by UOMO »

louisepb wrote:Hi,

I don't know of a script that does this but you can use yarn.GetMasterNodes() to get the specified nodes or yarn.GetSlaveNodes() to get the intermediate nodes determined by the interpolation.

From the slave nodes you can use the CSlaveNode::GetSectionPoints function which will return a vector of XYZ points.

I am part way through editing a scripting guide which was started by a colleague last year. I really need to get it finished...

Hope that helps,
Louise

Thanks. How actually CSlaveNode::GetSectionPoints works? Is it possible to get such a list of points (in the centerline) and export it to text?

Thanks,
/UOMO.
louisepb
Project Leader
Posts: 998
Joined: Tue Dec 08, 2009 2:27 pm
Location: Nottingham

Re: Export yarn path

Post by louisepb »

Hi Uomo,

The yarn.GetSlaveNodes() function will return a list of a set of points along the yarn centreline, created by the interpolation function using the master nodes. The number of slave nodes is determined by the yarn resolution.

The SlaveNode.GetSectionPoints() function returns the yarn cross-section at a given slave node in the form of a set of XYZ points around the perimeter of the section. The cross-section is assumed to be normal to the yarn tangent at that point.

Hope that helps,
Louise
UOMO
Regular
Posts: 45
Joined: Tue Feb 24, 2015 10:02 am

Re: Export yarn path

Post by UOMO »

I will take on that Louis, thank you.
By coincidence, have you ever tried to export the model/geometry to a meshing tool like (e.g. GMSH?) to have more control in the meshing? (add holes, voids, etc.?).
Best,
/UOMO.
louisepb wrote:Hi Uomo,

The yarn.GetSlaveNodes() function will return a list of a set of points along the yarn centreline, created by the interpolation function using the master nodes. The number of slave nodes is determined by the yarn resolution.

The SlaveNode.GetSectionPoints() function returns the yarn cross-section at a given slave node in the form of a set of XYZ points around the perimeter of the section. The cross-section is assumed to be normal to the yarn tangent at that point.

Hope that helps,
Louise
louisepb
Project Leader
Posts: 998
Joined: Tue Dec 08, 2009 2:27 pm
Location: Nottingham

Re: Export yarn path

Post by louisepb »

Hi Uomo,

Some of the researchers here export geometries as stp or iges files and then use Hypermesh to do the meshing. They then use the TexGen model to obtain the Vf and orientation data for the elements generated. I haven't used GMSH but it looks like it could be worth investigating. The problem with generating meshes of composites is always the very small areas created where yarns meet.

Best regards,
Louise
UOMO
Regular
Posts: 45
Joined: Tue Feb 24, 2015 10:02 am

Re: Export yarn path

Post by UOMO »

louisepb wrote:Hi Uomo,

Some of the researchers here export geometries as stp or iges files and then use Hypermesh to do the meshing. They then use the TexGen model to obtain the Vf and orientation data for the elements generated. I haven't used GMSH but it looks like it could be worth investigating. The problem with generating meshes of composites is always the very small areas created where yarns meet.

Best regards,
Louise

Thank you Louis...
I'm very interested in such a procedure... Having a mesh of a woven composite, to obtain the orientation of each element... is it described in any example/manual/thesis?
Thank you!.
/UOMO.
louisepb
Project Leader
Posts: 998
Joined: Tue Dec 08, 2009 2:27 pm
Location: Nottingham

Re: Export yarn path

Post by louisepb »

Hi Uomo,

You can obtain the orientations by using one of the CTextile::GetPointInformation functions shown here: http://texgen.sourceforge.net/api/class ... xtile.html
Given a vector of points the function returns a corresponding vector of point information, one of the members being the orientation at that point.

The way it has been used here (and unfortunately I don't think the script is available to be shared is as follows:
1. Create TexGen model
2. Export as IGES/STP
3. Use exported file to create mesh in Hypermesh
4. Extract the centre points of the mesh element
5. Call TexGen GetPointInformation using list of centre points to get orientations.

I hope that helps,
Louise
UOMO
Regular
Posts: 45
Joined: Tue Feb 24, 2015 10:02 am

Re: Export yarn path

Post by UOMO »

louisepb wrote:Hi Uomo,

You can obtain the orientations by using one of the CTextile::GetPointInformation functions shown here: http://texgen.sourceforge.net/api/class ... xtile.html
Given a vector of points the function returns a corresponding vector of point information, one of the members being the orientation at that point.

The way it has been used here (and unfortunately I don't think the script is available to be shared is as follows:
1. Create TexGen model
2. Export as IGES/STP
3. Use exported file to create mesh in Hypermesh
4. Extract the centre points of the mesh element
5. Call TexGen GetPointInformation using list of centre points to get orientations.

I hope that helps,
Louise

Thank you Louis for your fast response.
Let's assume that I have my mesh done in other software... and I know as well the geometrical center of each element.
With this information, can I get the orientations? Is it necessary to define to which Yarn the element belongs to and if it is orientated parallel to X or Y direction?
Thank you.
/UOMO.
louisepb
Project Leader
Posts: 998
Joined: Tue Dec 08, 2009 2:27 pm
Location: Nottingham

Re: Export yarn path

Post by louisepb »

Hi Uomo,
You can use your list of centre points as the input for the GetPointInformation function. The orientations will be returned in the point information vector that is returned from the function. As you will see there are two versions of the function, one of which sends the yarn number. Use this function if you know which yarn the points are in as it is faster, otherwise it just takes a bit longer to work it out. It doesn't need to know if it's oriented parallel to the x or y direction.

Best regards,
Louise
UOMO
Regular
Posts: 45
Joined: Tue Feb 24, 2015 10:02 am

Re: Export yarn path

Post by UOMO »

louisepb wrote:Hi Uomo,
You can use your list of centre points as the input for the GetPointInformation function. The orientations will be returned in the point information vector that is returned from the function. As you will see there are two versions of the function, one of which sends the yarn number. Use this function if you know which yarn the points are in as it is faster, otherwise it just takes a bit longer to work it out. It doesn't need to know if it's oriented parallel to the x or y direction.

Best regards,
Louise
It sounds great... I'll look at it.
Thanks!
Best,
/UOMO.
Post Reply