Building TexGen

General discussion about TexGen.

Moderators: Martin, Developers

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

Re: Building TexGen

Post by louisepb »

Glad you've got it working. The Export is used for creating IGES and STEP file so, as long as you're not wanting to export these it shouldn't be an issue for you. (The files are smaller than the Core and Renderer. Not sure why they're not loading).

Louise
David
Regular
Posts: 20
Joined: Tue Apr 12, 2011 4:03 pm

Re: Building TexGen

Post by David »

Louise,

A quick question from the documentation, put here as it relates to the TexGen-Abaqus linking.

Under Documentation > Scripting Guide > Scripting Examples > ABAQUS Dry Fabric Simulation
it says: "Some of this information cannot be determined automatically by TexGen, in these cases they must be specified by the user. These are material definitions, loading steps and initial gap between compression plates if they are to be included."

I assumed all loading steps were defined in Abaqus, but my reading of the above line suggests these are defined in TexGen, but I can't see how. Am I just reading it wrong?

BTW - I discovered the Textile Composites Archive, and I'm reading through them to get a more thorough understanding of this modelling process. It might be good to mention this archive in the documentation to give folk more worked examples.

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

Re: Building TexGen

Post by louisepb »

Hi David,
The example you are looking at in the documentation uses the code in Abaqus.py to automatically launch Abaqus from TexGen. In this case the steps need to be defined within TexGen and this can be done using the deformer.AddDeformationStep(tension) function as shown in the example. (This is in the CSimulation class in the TexGen C++ code)

Louise
David
Regular
Posts: 20
Joined: Tue Apr 12, 2011 4:03 pm

Re: Building TexGen

Post by David »

Lousie,

I'm getting the following error when I try to run the Abaqus Dry Fabric Simulation example script given in the documentation, with polyester.tg3 (also from the documentation). It seems Scale is not being properly called. (Note: "from TexGen.Abaqus import *" works fine, so it seems to link to Abaqus's .py files)

Code: Select all

Traceback (most recent call last):
  File "gui", line 1, in <module>
  File "C:\Program Files\TexGen\DeformerScript.py", line 6, in <module>
    tension.Scale(1.01)
  File "C:\Program Files\Abaqus\6.10-1\Python\Lib\TexGen\Core.py", line 1506, in <lambda>
    __getattr__ = lambda self, name: _swig_getattr(self, CLinearTransformation, name)
  File "C:\Program Files\Abaqus\6.10-1\Python\Lib\TexGen\Core.py", line 34, in _swig_getattr
    raise AttributeError,name
AttributeError: Scale
Any ideas what's wrong here? I don't know if it's in my building of TexGen or somewhere else.

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

Re: Building TexGen

Post by louisepb »

Hi David,

I think that the error is in the script. A look at the CLinearTransformation class shows that there is no Scale function. It should be AddScale which takes 3 parameters: scalex, scaley, scalez.

Hopefully if you change your script accordingly it should work.

Louise
David
Regular
Posts: 20
Joined: Tue Apr 12, 2011 4:03 pm

Re: Building TexGen

Post by David »

Hi Louise,

Thanks for the info. I was trying to understand the use of (*args) in the Core.py script until I realised that was for passing between Python and C++. Now I know where to look up the expected arguments (in the C++ file) it's a lot easier :)

That said I'm getting another error:

Code: Select all

Traceback (most recent call last):
  File "gui", line 1, in <module>
  File "C:\Program Files\TexGen\DeformerScript.py", line 18, in <module>
    deformer.DeformTextile(textile)
  File "C:\Program Files\Abaqus\6.10-1\Python\Lib\TexGen\Abaqus.py", line 284, in DeformTextile
    if not self.CreateAbaqusInputFile(textile, name + '.inp'):
  File "C:\Program Files\Abaqus\6.10-1\Python\Lib\TexGen\Core.py", line 2508, in CreateAbaqusInputFile
    def CreateAbaqusInputFile(*args): return _Core.CSimulationAbaqus_CreateAbaqusInputFile(*args)
NotImplementedError: Wrong number of arguments for overloaded function 'CSimulationAbaqus_CreateAbaqusInputFile'.
  Possible C/C++ prototypes are:
    CreateAbaqusInputFile(TexGen::CSimulationAbaqus *,TexGen::CTextile &,std::string,bool,int,bool,double)
    CreateAbaqusInputFile(TexGen::CSimulationAbaqus *,TexGen::CTextile &,std::string,bool,int,bool)
    CreateAbaqusInputFile(TexGen::CSimulationAbaqus *,TexGen::CTextile &,std::string,bool,int)
    CreateAbaqusInputFile(TexGen::CSimulationAbaqus *,TexGen::CTextile &,std::string,bool) 
As far as I can tell, it's not detecting that polyester.inp exists in this directory (it does), so it's trying to create an Abaqus .inp file from the loaded textile. It seems that the funtion "CreateAbaqusInputFile" is only being given two arguments (textile and name.inp) rather than the three to six that're expected. The "bool " seems to be missing.

Is there a way to fix this?

Thanks,
David

P.S. As mentioned earlier in this thread, _Export still doesn't load in TexGen. You said this wouldn't be a problem as I'm not creating IGES or STEP files. Just thought I should mention it in case it's related here.
louisepb
Project Leader
Posts: 998
Joined: Tue Dec 08, 2009 2:27 pm
Location: Nottingham

Re: Building TexGen

Post by louisepb »

Hi David,

You're obviously the first person to use this script for some time! If you look in the API documentation here http://texgen.sourceforge.net/api/class ... baqus.html you'll see the parameters required for CreateAbaqusInputFile. You need to edit the Abaqus.py script so that the call to CreateAbaqusInputFile sends a third parameter, false, for RegenerateMesh. Just leave the others and the default parameters will be used. I'll correct the script in the version that gets downloaded with the TexGen installation.

Hopefully that will sort things out for you as I'm off work next week (and don't work Fridays so won't be in tomorrow).

Louise
dyeyanie
Regular
Posts: 154
Joined: Thu Oct 06, 2011 10:39 am

Re: Building TexGen

Post by dyeyanie »

Hi Louise,

I'm creating my geometry via previous steps before you launched the latest version which consists 3Dweave. My question is, how to identify the gap / spacing between yarns (I mean for top and lower yarns)? Is it the same as the side by side yarns?

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

Re: Building TexGen

Post by louisepb »

Hi Yanie,

Sorry not to have replied sooner - I missed this question.

I'm not really sure what you're asking here. Could you be more specific please? (Also does it have anything to do with building TexGen? If not I'll move it to a separate thread)

Louise
Post Reply