I'm trying to do something fairly simple - read a tg3 file, assign a section mesh to the yarns and save the textile. I'm having a bit of a struggle to do this. My approach is:
Code: Select all
from TexGen.Core import *
path = 'c:/'
input = path+'old.tg3'
output = path+'new.tg3'
ReadFromXML(input)
textile = GetTextile()
mesh = CSectionMeshRectangular(2, True)
#textile.AssignSectionMesh(mesh) # I tried this, but no luck
for i in range(textile.GetNumYarns()):
yarn=textile.GetYarn(i)
yarnSection = yarn.GetYarnSection()
section = yarnSection.GetSection() # It fails here
section.AssignSectionMesh(mesh)
SaveToXML(output)
Code: Select all
const CSection & GetSection () const to be able to get access to the section itself. I always end up with this error:
Code: Select all
NotImplementedError: Wrong number of arguments for overloaded function 'CYarnSection_GetSection'.
Possible C/C++ prototypes are:
GetSection(TexGen::YARN_POSITION_INFORMATION const,int,bool)
GetSection(TexGen::YARN_POSITION_INFORMATION const,int)In the longer term, if I want to use non-constant sections will I have to assign the section mesh when I create the yarns, or is there some other way around this problem? It seems that AssignSectionMesh() can be used on the textile if it's a CTextileWeave, but mine is a CTextile. Is it this which needs to change?
Cheers,
Jon.