@@ -2357,12 +2357,14 @@ def shell(
2357
2357
kind : Literal ["arc" , "intersection" ] = "arc" ,
2358
2358
) -> Any :
2359
2359
"""
2360
- make a shelled solid of given by removing the list of faces
2360
+ Make a shelled solid of self.
2361
2361
2362
- :param faceList: list of face objects, which must be part of the solid.
2363
- :param thickness: floating point thickness. positive shells outwards, negative shells inwards
2364
- :param tolerance: modelling tolerance of the method, default=0.0001
2365
- :return: a shelled solid
2362
+ :param faceList: List of faces to be removed, which must be part of the solid. Can
2363
+ be an empty list.
2364
+ :param thickness: Floating point thickness. Positive shells outwards, negative
2365
+ shells inwards.
2366
+ :param tolerance: Modelling tolerance of the method, default=0.0001.
2367
+ :return: A shelled solid.
2366
2368
"""
2367
2369
2368
2370
kind_dict = {
@@ -2371,45 +2373,38 @@ def shell(
2371
2373
}
2372
2374
2373
2375
occ_faces_list = TopTools_ListOfShape ()
2376
+ shell_builder = BRepOffsetAPI_MakeThickSolid ()
2374
2377
2375
- if faceList :
2376
- for f in faceList :
2377
- occ_faces_list .Append (f .wrapped )
2378
+ for f in faceList :
2379
+ occ_faces_list .Append (f .wrapped )
2378
2380
2379
- shell_builder = BRepOffsetAPI_MakeThickSolid (
2380
- self .wrapped ,
2381
- occ_faces_list ,
2382
- thickness ,
2383
- tolerance ,
2384
- Intersection = True ,
2385
- Join = kind_dict [kind ],
2386
- )
2381
+ shell_builder .MakeThickSolidByJoin (
2382
+ self .wrapped ,
2383
+ occ_faces_list ,
2384
+ thickness ,
2385
+ tolerance ,
2386
+ Intersection = True ,
2387
+ Join = kind_dict [kind ],
2388
+ )
2389
+ shell_builder .Build ()
2387
2390
2388
- shell_builder . Build ()
2389
- rv = shell_builder .Shape ()
2391
+ if faceList :
2392
+ rv = self . __class__ ( shell_builder .Shape () )
2390
2393
2391
2394
else : # if no faces provided a watertight solid will be constructed
2392
- shell_builder = BRepOffsetAPI_MakeThickSolid (
2393
- self .wrapped ,
2394
- occ_faces_list ,
2395
- thickness ,
2396
- tolerance ,
2397
- Intersection = True ,
2398
- Join = kind_dict [kind ],
2399
- )
2400
-
2401
- shell_builder .Build ()
2402
2395
s1 = self .__class__ (shell_builder .Shape ()).Shells ()[0 ].wrapped
2403
2396
s2 = self .Shells ()[0 ].wrapped
2404
2397
2405
2398
# s1 can be outer or inner shell depending on the thickness sign
2406
2399
if thickness > 0 :
2407
- rv = BRepBuilderAPI_MakeSolid (s1 , s2 ). Shape ( )
2400
+ sol = BRepBuilderAPI_MakeSolid (s1 , s2 )
2408
2401
else :
2409
- rv = BRepBuilderAPI_MakeSolid (s2 , s1 ). Shape ( )
2402
+ sol = BRepBuilderAPI_MakeSolid (s2 , s1 )
2410
2403
2411
- # fix needed for the orientations
2412
- return self .__class__ (rv ) if faceList else self .__class__ (rv ).fix ()
2404
+ # fix needed for the orientations
2405
+ rv = self .__class__ (sol .Shape ()).fix ()
2406
+
2407
+ return rv
2413
2408
2414
2409
def isInside (
2415
2410
self : ShapeProtocol , point : VectorLike , tolerance : float = 1.0e-6
0 commit comments