-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathCrossSections.py
More file actions
29 lines (22 loc) · 844 Bytes
/
CrossSections.py
File metadata and controls
29 lines (22 loc) · 844 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# CrossSections.py
# Python 3 version used runpy module to execute scripts from TexGen GUI which requires import of library
from TexGen.Core import *
from math import *
# Create textile
textile = CTextile( )
# Create yarn
yarn = CYarn( )
# Add nodes to yarn
yarn.AddNode( CNode(XYZ(0, 0.0, 0)) )
yarn.AddNode( CNode(XYZ(1, 3.5, 0)) )
yarn.AddNode( CNode(XYZ(0, 7.0, 0)) )
#Define three different cross-sectional shapes at the master nodes
section=CYarnSectionInterpNode()
section.AddSection(CSectionEllipse(1, 0.1))
section.AddSection(CSectionRotated(CSectionEllipse(1, 0.1), radians(45)) )
section.AddSection(CSectionPowerEllipse (2, 0.3, 0.1, 0.0))
#Assign the cross-sections to the yarn and add to the textile
yarn.AssignSection(section)
textile.AddYarn(yarn)
#Add the textile to the database
AddTextile("varying shapes", textile)