@@ -71,31 +71,27 @@ def add_femelement_geometry(commtxt, ca_writer):
7171
7272 geoms = []
7373 i = 0
74- for ref in shelllam_obj .References : #TODO: work out how to create group of all elements and apply to that in case where len(shelllam_obj.References) == 0.
75- for geom in ref [1 ]:
76- geoms .append (geom )
77- matname = "LAYUP" + str (i )
78- i += 1
79- commtxt += "# Composite layup detected, added to shell\n "
80- commtxt += "{} = DEFI_COMPOSITE(COUCHE=(_F(EPAIS={},\n " .format (matname ,thicknesses [0 ])
81- commtxt += " MATER={},\n " .format (matnames [0 ])
82- commtxt += " ORIENTATION = {}),\n " .format (orientations [0 ])
83- for j in range (1 ,len (thicknesses )):
84- commtxt += " _F(EPAIS={},\n " .format (thicknesses [j ])
85- commtxt += " MATER={},\n " .format (matnames [j ])
86- commtxt += " ORIENTATION = {}),\n " .format (orientations [j ])
87- commtxt += " ))\n \n "
88-
89- ca_writer .elemprops .append ("elemprop{}" .format (len (ca_writer .elemprops )))
90- commtxt += "# Shell elements detected, thickness {}mm on item {}\n " .format (thicktot , (ref [0 ].Name ,geom ))
91- commtxt += "{} = AFFE_CARA_ELEM(COQUE=_F(COQUE_NCOU = {},\n " .format (ca_writer .elemprops [- 1 ], len (thicknesses ))
92- commtxt += " EPAIS={},\n " .format (thicktot )
93- commtxt += " GROUP_MA=('{}', ),\n " .format (ref [0 ].Name )
94- commtxt += " VECTEUR=(1.0, 0.0, 0.0)),\n "
95- commtxt += " MODELE=model)\n \n "
74+ if len (shelllam_obj .Windall ['elements' ]) > 0 :
75+ print ('*********************OI**********************' )
76+ print ('TODO WINDING STUFF' )
77+ else :
78+ for ref in shelllam_obj .References :
79+ #TODO: work out how to create group of all elements and apply to that in case where len(shelllam_obj.References) == 0.
80+ for geom in ref [1 ]:
81+ geoms .append (geom )
82+ matname = "LAYUP" + str (i )
83+ i += 1
84+ commtxt += add_layup (matname , matnames , thicknesses , orientations )
9685
97-
98- ca_writer .tools .group_elements [ref [0 ].Name ] = [g for g in geoms ]
86+ commtxt += "# Shell elements detected, thickness {}mm on item {}\n " .format (thicktot , (ref [0 ].Name ,geom ))
87+ commtxt += "elemprop = AFFE_CARA_ELEM(COQUE=_F(COQUE_NCOU = {},\n " .format (len (thicknesses ))
88+ commtxt += " EPAIS={},\n " .format (thicktot )
89+ commtxt += " GROUP_MA=('{}', ),\n " .format (ref [0 ].Name )
90+ commtxt += " VECTEUR=(1.0, 0.0, 0.0)),\n "
91+ commtxt += " MODELE=model)\n \n "
92+
93+
94+ ca_writer .tools .group_elements [ref [0 ].Name ] = [g for g in geoms ]
9995 FreeCAD .Console .PrintMessage ("Shell of thickness {}mm added.\n " .format (thicktot ))
10096
10197 elif ca_writer .member .geos_shellthickness :
@@ -128,4 +124,15 @@ def add_femelement_geometry(commtxt, ca_writer):
128124
129125 return commtxt , matname
130126
127+ def add_layup (LUname , matnames , thicknesses , orientations ):
128+ commtxt = "# Composite layup detected, added to shell\n "
129+ commtxt += "{} = DEFI_COMPOSITE(COUCHE=(_F(EPAIS={},\n " .format (LUname ,thicknesses [0 ])
130+ commtxt += " MATER={},\n " .format (matnames [0 ])
131+ commtxt += " ORIENTATION = {}),\n " .format (orientations [0 ])
132+ for j in range (1 ,len (thicknesses )):
133+ commtxt += " _F(EPAIS={},\n " .format (thicknesses [j ])
134+ commtxt += " MATER={},\n " .format (matnames [j ])
135+ commtxt += " ORIENTATION = {}),\n " .format (orientations [j ])
136+ commtxt += " ))\n \n "
137+ return commtxt
131138## @}
0 commit comments