|
2 | 2 | - Che |
3 | 3 | - Fix add_femelemt_geometry for if no groups are selected |
4 | 4 | - allow multiple groups of materials and element types |
5 | | -- Add elasticity as proper equation |
6 | 5 | - Add stress to med reader |
7 | 6 | - Make it possible to have materials as children of ElementGeometryLaminate |
| 7 | +- Run geodesics etc on Femmesh directly |
| 8 | + |
| 9 | +force_objs = [] |
| 10 | +for ref in obj.References: |
| 11 | + for r in ref[1]: |
| 12 | + o = getattr(ref[0].Shape, r) |
| 13 | + force_objs.append(o) |
| 14 | + |
| 15 | +tot = 0 |
| 16 | +for o in force_objs: |
| 17 | + if type(o) == Part.Vertex: |
| 18 | + tot += 1 |
| 19 | + elif type(o) == Part.Edge: |
| 20 | + tot += o.Length |
| 21 | + elif type(o) == Part.Face: |
| 22 | + tot += o.Area |
| 23 | + |
| 24 | +print(tot) |
| 25 | + |
| 26 | + |
| 27 | +for getting fibre directions: |
| 28 | + |
| 29 | +thicknesses = [] |
| 30 | +elements = [] |
| 31 | +angles = [] |
| 32 | +for i in range(1,len(geomesh_obj.TriangleFibreDirectionsIndex)): |
| 33 | + if geomesh_obj.TriangleFibreDirectionsIndex[i-1] != geomesh_obj.TriangleFibreDirectionsIndex[i]: |
| 34 | + ths = [lam_obj.Thicknesses[0]] |
| 35 | + angs = [lam_obj.Orientations[0]] |
| 36 | + elements.append(i) |
| 37 | + for j in range(geomesh_obj.TriangleFibreDirectionsIndex[i-1], geomesh_obj.TriangleFibreDirectionsIndex[i]): |
| 38 | + ths.append(geomesh_obj.TriangleThicknesses[i-1]/(geomesh_obj.TriangleFibreDirectionsIndex[i] - geomesh_obj.TriangleFibreDirectionsIndex[i-1])) |
| 39 | + ang = geomesh_obj.IndexedTriangleFibreDirections[j] |
| 40 | + if ang > 90: |
| 41 | + ang -= 180 |
| 42 | + elif ang < -90: |
| 43 | + ang += 180 |
| 44 | + angs.append(ang) |
| 45 | + thicknesses.append(ths) |
| 46 | + angles.append(angs) |
| 47 | +lam_obj.Windall = {'elements':elements, 'orientationlists':angles, 'thicknesslists':thicknesses} |
| 48 | + |
| 49 | +obj.Windall = {'elements':[364], 'orientationlists':[[0]], 'thicknesslists':[[0.18]]} |
| 50 | +obj.Windall = {'elements':[], 'orientationlists':[], 'thicknesslists':[]} |
| 51 | + |
| 52 | + |
8 | 53 |
|
9 | 54 | Useful code snippets for med file reading: |
10 | 55 | sys.path.append('/home/timbo/anaconda3/lib/python3.12/site-packages') |
|
0 commit comments