Yarn Interpolation Fuctions

General discussion about TexGen.

Moderators: Martin, Developers

Post Reply
myapa2
Regular
Posts: 21
Joined: Mon Apr 16, 2018 5:35 pm

Yarn Interpolation Fuctions

Post by myapa2 »

Hello,

I am trying to model individual fibers of a composite that follows the path of some TexGen models I generated. The model in consideration is a one-ply plain weave and I want to extract the path of the yarns from TexGen so I can create my own model for fibers that follow the same path. Is there a way to obtain the control points of the interpolation function?

Thank you,
Milinda
louisepb
Project Leader
Posts: 998
Joined: Tue Dec 08, 2009 2:27 pm
Location: Nottingham

Re: Yarn Interpolation Fuctions

Post by louisepb »

Hi Milinda,

There are a couple of ways you could do this:
1. Use the CInterpolation::GetSlaveNodes function from within a Python script or C++ program
2. Save the model in TexGen using the Full option. This then saves all of the slave node information. The .tg3 file is basically a renamed xml file so you can open this in an editor and then extract the slave node coordinates from the file.

Hope that helps,
Louise
myapa2
Regular
Posts: 21
Joined: Mon Apr 16, 2018 5:35 pm

Re: Yarn Interpolation Fuctions

Post by myapa2 »

Hello Louise,

Thank you for the reply.
I did try the following lines using a python script and I keep getting an error.

Code: Select all

textile = GetTextile()
yarn = textile.GetYarn(0)
nodes = yarn.GetSlaveNodes(LINE)
error: nodes = yarn.GetSlaveNodes(LINE)
NameError: name 'LINE' is not defined

I thought LINE was the correct argument input to use.
Am I doing something wrong here?

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

Re: Yarn Interpolation Fuctions

Post by louisepb »

Hi Milinda,

You're nearly there. The LINE is part of an enumerator in the CYarn class so you just need to use CYarn.LINE and then it should work.

Best wishes,
Louise
myapa2
Regular
Posts: 21
Joined: Mon Apr 16, 2018 5:35 pm

Re: Yarn Interpolation Fuctions

Post by myapa2 »

Okay. That works. Thank you!

Milinda
Post Reply