Problem on modeling the stitch of non-crimp fabric

General discussion about TexGen.

Moderators: Martin, Developers

Post Reply
lomoclarke
Posts: 3
Joined: Fri Sep 19, 2014 5:17 am

Problem on modeling the stitch of non-crimp fabric

Post by lomoclarke »

Hello, everyone
I have a problem when modeling a stitch of a non-crimp fabric. On the node connection point, the stitch deformed which can be seen from the figure below. I don't know why. Could anyone tell me where is wrong? I attached my code below. Thanks very much!

Textile = CTextile()

StitchYarn = CYarn()

w = 2.3
s = 2.4
h = 0.1
w1 = 1.0
s1 = 4.0
h1 = 0.05
a = 0.04
r = 0.025
u = 1.5*h+r
d = -0.5*h-r

StitchYarn.AddNode(CNode(XYZ(2*a, a, u)))
StitchYarn.AddNode(CNode(XYZ(s+a, s1-a, u)))
StitchYarn.AddNode(CNode(XYZ(s+a, s1, d)))
StitchYarn.AddNode(CNode(XYZ(s+2*a, 2*s1-a, d)))
StitchYarn.AddNode(CNode(XYZ(s+a, 2*s1, d+a)))
StitchYarn.AddNode(CNode(XYZ(s-a, 2*s1, d+a)))
StitchYarn.AddNode(CNode(XYZ(s-2*a, 2*s1-a, d)))
StitchYarn.AddNode(CNode(XYZ(s-a, s1, d)))
StitchYarn.AddNode(CNode(XYZ(s-2*a, s1+a, u)))
StitchYarn.AddNode(CNode(XYZ(-a, 2*s1-a, u)))
StitchYarn.AddNode(CNode(XYZ(-a, 2*s1, d)))
StitchYarn.AddNode(CNode(XYZ(-2*a, 3*s1-a, d)))
StitchYarn.AddNode(CNode(XYZ(-a, 3*s1, d+a)))
StitchYarn.AddNode(CNode(XYZ(a, 3*s1, d+a)))
StitchYarn.AddNode(CNode(XYZ(2*a, 3*s1-a, d)))
StitchYarn.AddNode(CNode(XYZ(a, 2*s1, d)))
StitchYarn.AddNode(CNode(XYZ(2*a, 2*s1+a, u)))

StitchYarn.AddRepeat(XYZ(s, 0, 0))
StitchYarn.AddRepeat(XYZ(0, 2*s1, 0))

StitchSection = CSectionEllipse(0.05, 0.05)
StitchYarn.AssignSection(CYarnSectionConstant(StitchSection))

StitchYarn.AssignInterpolation(CInterpolationBezier())

StitchYarn.SetResolution(8)

Textile.AddYarn(StitchYarn)

AddTextile("stitch", Textile)
Attachments
1.jpg
1.jpg (35.85 KiB) Viewed 3932 times
louisepb
Project Leader
Posts: 998
Joined: Tue Dec 08, 2009 2:27 pm
Location: Nottingham

Re: Problem on modeling the stitch of non-crimp fabric

Post by louisepb »

Hi,

The problem with the deformations on the vertical yarn sections should be easy to solve: If you look in section 2.5 of Martin Sherburn’s PhD thesis here http://etheses.nottingham.ac.uk/303/1/thesis-final.pdf you will find a description of the use of an ‘up’ vector used to generate the yarn surface. In the case of vertical yarns the vector needs to be redefined, typically to a unit vector in the x or y directions. If you look in your tg3 file you will see the up vector specified for each node. You can either edit this in the tg3 file or,alternatively, if you’ve written a script to generate your textile you can specify it using the CNode SetUp(XYZ Up) function.

Hope that helps,
Louise
Post Reply