-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Su Tian
committed
Jul 27, 2021
1 parent
79a2f54
commit 31e8bf5
Showing
2 changed files
with
54 additions
and
44 deletions.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
|
|
||
|
|
||
| class Layer(object): | ||
| def __init__(self): | ||
| self.material = '' | ||
| self.thickness = 0 | ||
| self.lamina = None | ||
| self.angle = 0 | ||
| self.begin = 0 | ||
| self.end = 0 | ||
|
|
||
| def __str__(self): | ||
| return 'begin: {0}, end: {1}, material: {2}, thickness: {3}, angle: {4}'.format( | ||
| self.begin, self.end, self.material, self.thickness, self.angle | ||
| ) | ||
|
|
||
| def readIXGENLine(self, line, cs, fmt=0, tb=''): | ||
| line = line.split() | ||
| if (fmt == 0): | ||
| self.material = ' '.join(line[5:-3]) | ||
| self.thickness = line[-3] | ||
| self.angle = float(line[-2]) | ||
| if (cs == 1): | ||
| self.begin = float(line[1]) | ||
| self.end = float(line[2]) | ||
| elif (cs == 2): | ||
| self.begin = float(line[3]) | ||
| self.end = float(line[4]) | ||
| elif (fmt == 1): | ||
| self.material = ' '.join(line[4:-1]) | ||
| self.thickness = line[-1] | ||
| if (cs == 1): | ||
| if (tb == 'top'): | ||
| self.end = float(line[0]) | ||
| elif (tb == 'bottom'): | ||
| self.end = float(line[1]) | ||
| elif (cs == 2): | ||
| if (tb == 'top'): | ||
| self.end = float(line[2]) | ||
| elif (tb == 'bottom'): | ||
| self.end = float(line[3]) | ||
| elif (fmt == 2): | ||
| self.material = ' '.join(line[1:-2]) | ||
| self.thickness = line[-2] | ||
| self.angle = float(line[-1]) | ||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
| class Layup(object): | ||
| def __init__(self, name=''): | ||
| self.name = name | ||
| self.layers = [] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters