how to create the surface yarns

General discussion about TexGen.

Moderators: Martin, Developers

Post Reply
LijunGu
Regular
Posts: 30
Joined: Mon Jun 01, 2020 4:49 am

how to create the surface yarns

Post by LijunGu »

Hello Dr. Louise,

First of all, thank you for your strong support regarding how to get the coordinates of nodes.

There is a simple textile model which include surface yarns. look like:
section.JPG
section.JPG (17.02 KiB) Viewed 4054 times
I have an idea how to setup this textile model. Basically, using Layer to Layer way and add the additional surface yarns.
Scripting looks like:

weave = CTextileLayerToLayer(4, 4, 1, 1, 0.1, 0.5937, 3)
weave.SetWarpRatio( 0)
weave.SetBinderRatio( 1)
weave.SetWarpYarnWidths( 0.8)
weave.SetYYarnWidths( w_weft)
weave.SetBinderYarnWidths( w_warp)
weave.SetupLayers( 3, 4, 3)
weave.SetGapSize( 0 )
weave.SetBinderPosition(0, 0, 0)
...
for i in range(4):
weave.SetXYarnWidths(i, w_warp)
weave.SetXYarnHeights(i, h_warp)
weave.SetXYarnSpacings(i, sy)
for i in range(4):
weave.SetYYarnWidths(i, w_weft)
weave.SetYYarnHeights(i, h_weft)
weave.SetYYarnSpacings(i, sx)
weave.AssignDefaultDomain(False)
AddTextile("test", weave)

# upper yarn
#try 1(failed):
weave.SetBinderPosition(0, 0, 0)
weave.SetBinderPosition(1, 0, 0)
weave.SetBinderPosition(2, 0, 1)
weave.SetBinderPosition(3, 0, 0)
for i in range(4):
weave.SetXYarnWidths(i, w_warp)
weave.SetXYarnHeights(i, h_warp)
weave.SetXYarnSpacings(i, sy)

Due to there is no function like AddYarn according this CTextileLayerToLayer class, so i checked the web: http://texgen.sourceforge.net/api/class ... layer.html
To be honestly, i am not used to check the manual like this, there is not so much explanation.
Anyway I found these below two related commands maybe useful, but it is difficult to use them.
#try 2(failed):
weave.AddXLayers()
#try 3(failed):
weave.AddWarpLayer()

Do you have some ideas regarding this topic?

Have a nice day for all of you!

Best regards!
Post Reply