-
Notifications
You must be signed in to change notification settings - Fork 39
Question about CDomainPrism(points, XYZ(x1, y1, z1), XYZ(x2, y2, z2)) #66
Description
Dear Professor:
Recently, I am reading "TexGen Scripting Guide_V3.1". I have a problem in replicate the code in page 17.
Example: Creating a prism domain with a T-shaped cross-section
#Create a textile
textile = CTextile()
Create vector for domain polygon points
points = XYVector()
Add points to polygon and create prism domain using
the vector of points and start and end point of prism
#T domain
points.push_back(XY(1,0))
points.push_back(XY(0.4,0))
points.push_back(XY(0.3,0.05))
points.push_back(XY(0.15,0.2))
points.push_back(XY(0.1,0.3))
points.push_back(XY(0.1,1))
points.push_back(XY(-0.1,1))
points.push_back(XY(-0.1,0.3))
points.push_back(XY(-0.15,0.2))
points.push_back(XY(-0.3,0.05))
points.push_back(XY(-0.4,0))
points.push_back(XY(-1,0))
points.push_back(XY(-1,-0.1))
points.push_back(XY(1,-0.1))
domain = CDomainPrism(points,XYZ(0,0,0), XYZ(0,2,0))
Add the domain to the textile
textile.AssignDomain(domain)
Create a yarn passing through the domain
yarn = CYarn()
yarn.AddNode( CNode(XYZ(0,-0.2,0)))
yarn.AddNode( CNode(XYZ(0, 2.2,0)))
section = CSectionEllipse(0.1,0.1)
yarn.AssignSection( CYarnSectionConstant(section))
yarn.SetResolution(10)
textile.AddYarn(yarn)
AddTextile('test', textile)
When I use Texgen previous version, it shows "NameError: name 'CDomainPrism' is not defined".
When I use Texgen 3.13.1, it shows "Error compiling code!".
I want to know whether the Texgen has the ability to achieve a prism domain?
Sincerely!