Hey Guys,
I want bild up a 4 layer weave with twill structure and rectangle section. However I didn't find a way to set up my geometry at first, only modify my section from ellipse to rectangle after I bild up the structure. Is It possible to set up the rectangle section at the beginning? It would be very helpful.
Best Regards,
Sissy
Bild up a 4 layer Köperbindung rechtangle
Moderators: Martin, Developers
-
scalelovesun
- Posts: 3
- Joined: Thu May 04, 2023 8:26 am
Re: Bild up a 4 layer Köperbindung rechtangle
Hi Sissy,
How are you creating your textile? If you are using the wizard then it will automatically create ellipse sections which you will then need to modify. If you're creating the textile using a script then you can just assign the sections to be rectangular when you create the yarns.
If you need to change the cross-sections after creating the textile you can either do this using the user interface or you could use Python commands. You could do this either using the Python console or write a short script which gets the yarns and assigns the sections which could be run this using the Run Python option.
Information on Python scripting is given in the Scripting Guide here: https://github.com/louisepb/TexGenScriptingGuide
Hope that helps,
Louise
How are you creating your textile? If you are using the wizard then it will automatically create ellipse sections which you will then need to modify. If you're creating the textile using a script then you can just assign the sections to be rectangular when you create the yarns.
If you need to change the cross-sections after creating the textile you can either do this using the user interface or you could use Python commands. You could do this either using the Python console or write a short script which gets the yarns and assigns the sections which could be run this using the Run Python option.
Information on Python scripting is given in the Scripting Guide here: https://github.com/louisepb/TexGenScriptingGuide
Hope that helps,
Louise
-
scalelovesun
- Posts: 3
- Joined: Thu May 04, 2023 8:26 am
Re: Bild up a 4 layer Köperbindung rechtangle
Hallo Louise,louisepb wrote:Hi Sissy,
How are you creating your textile? If you are using the wizard then it will automatically create ellipse sections which you will then need to modify. If you're creating the textile using a script then you can just assign the sections to be rectangular when you create the yarns.
If you need to change the cross-sections after creating the textile you can either do this using the user interface or you could use Python commands. You could do this either using the Python console or write a short script which gets the yarns and assigns the sections which could be run this using the Run Python option.
Information on Python scripting is given in the Scripting Guide here: https://github.com/louisepb/TexGenScriptingGuide
Hope that helps,
Louise
I used the wizard, but I think with the script I have more possibilities modifing my structure. I will try it. Thanks a lot for the help!
Yuanxi
-
scalelovesun
- Posts: 3
- Joined: Thu May 04, 2023 8:26 am
Re: Bild up a 4 layer Köperbindung rechtangle
Hey Louise,louisepb wrote:Hi Sissy,
How are you creating your textile? If you are using the wizard then it will automatically create ellipse sections which you will then need to modify. If you're creating the textile using a script then you can just assign the sections to be rectangular when you create the yarns.
If you need to change the cross-sections after creating the textile you can either do this using the user interface or you could use Python commands. You could do this either using the Python console or write a short script which gets the yarns and assigns the sections which could be run this using the Run Python option.
Information on Python scripting is given in the Scripting Guide here: https://github.com/louisepb/TexGenScriptingGuide
Hope that helps,
Louise
I just tried with the Python and I used the command CTextileWeave2D to create my twill weave. However, it seems that the Section can't be changed. Is that in the core code demanded?
here ist my coding, could you please have a look:
Code: Select all
# 2DTextile.py
# Specify weave parameters
nwarp=4 #Number of weft yarns in the unit cell
nweft=4 #Number of warp yarns in the unit cell
s=1 #Spacing between the yarns
t=0.1 #Thickness of the fabric (sum of two yarn heights)
ref=True #Refine model (True/False)
# Create 2D textile
weave = CTextileWeave2D( nweft, nwarp, s, t, ref )
section = CYarnSectionConstant (CSectionRectangle( 1, 0.2))
yarn.AssignSection(section)
# Set the weave pattern
weave.SwapPosition(0, 0)
weave.SwapPosition(0, 1)
weave.SwapPosition(1, 1)
weave.SwapPosition(1, 2)
weave.SwapPosition(2, 2)
weave.SwapPosition(2, 3)
weave.SwapPosition(3, 3)
weave.SwapPosition(3, 0)
weave.SetYarnWidths( 0.8 )
weave.SetYarnHeights( 0.05 )
#A default model domain
weave.AssignDefaultDomain()
#Add to the textile database
AddTextile(weave)
Regards, Sissy
Re: Bild up a 4 layer Köperbindung rechtangle
Hi Sissy,
Many apologies for the slow reply - I only just noticed your message. You have done the right thing to assign a section to a yarn but you need to do this to one of the yarns in the textile that you have created.
Use yarn = weave.GetYarn(0) (or whichever yarn index you're trying to change) and then do your two lines to create and assign the section. In this case it would make the change for yarn 0.
Hope that helps,
Louise
Many apologies for the slow reply - I only just noticed your message. You have done the right thing to assign a section to a yarn but you need to do this to one of the yarns in the textile that you have created.
Use yarn = weave.GetYarn(0) (or whichever yarn index you're trying to change) and then do your two lines to create and assign the section. In this case it would make the change for yarn 0.
Hope that helps,
Louise