@@ -528,28 +528,48 @@ def detect_helixes(
528528 ]
529529 }
530530
531- def is_body_sweepable (self , body : "Body" , get_source_target_faces : bool ) -> bool :
531+ @min_backend_version (26 , 1 , 0 )
532+ def is_body_sweepable (
533+ self ,
534+ body : "Body" ,
535+ get_source_target_faces : bool = False ,
536+ ) -> tuple [bool , list ["Face" ]]:
532537 """Check if a body is sweepable.
533538
534539 Parameters
535540 ----------
536541 body : Body
537542 Body to check.
538543 get_source_target_faces : bool
539- Whether to get source and target faces.
544+ Whether to get source and target faces. By default, ``False``.
540545
541546 Returns
542547 -------
543- bool
544- True if the body is sweepable, False otherwise.
548+ tuple[bool, list[Face]]
549+ Tuple containing a boolean indicating if the body is sweepable and
550+ a list of source and target faces if requested.
545551 """
546552 from ansys .geometry .core .designer .body import Body
553+ from ansys .geometry .core .designer .face import Face , SurfaceType
547554
548555 # Verify inputs
549556 check_type_all_elements_in_iterable ([body ], Body )
550557
551558 response = self ._grpc_client ._services .prepare_tools .is_body_sweepable (
552559 body_id = body .id ,
560+ get_source_target_faces = get_source_target_faces ,
553561 )
554562
555- return response .get ("is_sweepable" )
563+ faces = []
564+ if get_source_target_faces :
565+ faces = [
566+ Face (
567+ face .get ("id" ),
568+ SurfaceType (face .get ("surface_type" )),
569+ self ,
570+ self ._grpc_client ,
571+ )
572+ for face in response .get ("faces" )
573+ ]
574+
575+ return (response .get ("result" ), faces )
0 commit comments