@@ -1307,6 +1307,68 @@ def face_closest_to_bounding_box(self):
1307
1307
f_val = p_dist
1308
1308
return f_id
1309
1309
1310
+ @pyaedt_function_handler ()
1311
+ def largest_face (self , n = 1 ):
1312
+ """Return only the face with the greatest area.
1313
+
1314
+ Returns
1315
+ -------
1316
+ List of :class:`pyaedt.modeler.Object3d.FacePrimitive`
1317
+ """
1318
+ f = []
1319
+ for face in self .faces :
1320
+ f .append ((face .area , face ))
1321
+ f .sort (key = lambda tup : tup [0 ], reverse = True )
1322
+ f_sorted = [x for y , x in f ]
1323
+ return f_sorted [:n ]
1324
+
1325
+ @pyaedt_function_handler ()
1326
+ def longest_edge (self , n = 1 ):
1327
+ """Return only the edge with the greatest length.
1328
+
1329
+ Returns
1330
+ -------
1331
+ List of :class:`pyaedt.modeler.Object3d.EdgePrimitive`
1332
+ """
1333
+ e = []
1334
+ for edge in self .edges :
1335
+ e .append ((edge .length , edge ))
1336
+ e .sort (key = lambda tup : tup [0 ], reverse = True )
1337
+ e_sorted = [x for y , x in e ]
1338
+ return e_sorted [:n ]
1339
+
1340
+ @pyaedt_function_handler ()
1341
+ def smallest_face (self , n = 1 ):
1342
+ """Return only the face with the smallest area.
1343
+
1344
+ Returns
1345
+ -------
1346
+ List of :class:`pyaedt.modeler.Object3d.FacePrimitive`
1347
+ """
1348
+ f = []
1349
+ for face in self .faces :
1350
+ f .append ((face .area , face ))
1351
+ f .sort (key = lambda tup : tup [0 ])
1352
+ f_sorted = [x for y , x in f ]
1353
+ return f_sorted [:n ]
1354
+
1355
+ @pyaedt_function_handler ()
1356
+ def shortest_edge (self , n = 1 ):
1357
+ """Return only the edge with the smallest length.
1358
+
1359
+ Returns
1360
+ -------
1361
+ List of :class:`pyaedt.modeler.Object3d.EdgePrimitive`
1362
+ """
1363
+ e = []
1364
+ for edge in self .edges :
1365
+ e .append ((edge .length , edge ))
1366
+ e .sort (
1367
+ key = lambda tup : tup [0 ],
1368
+ )
1369
+ e_sorted = [x for y , x in e ]
1370
+ return e_sorted [:n ]
1371
+
1310
1372
@property
1311
1373
def top_face_z (self ):
1312
1374
"""Top face in the Z direction of the object.
0 commit comments