File tree Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Expand file tree Collapse file tree 2 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -2351,7 +2351,7 @@ def chamfer(
2351
2351
2352
2352
def shell (
2353
2353
self : Any ,
2354
- faceList : Iterable [Face ],
2354
+ faceList : Optional [ Iterable [Face ] ],
2355
2355
thickness : float ,
2356
2356
tolerance : float = 0.0001 ,
2357
2357
kind : Literal ["arc" , "intersection" ] = "arc" ,
@@ -2375,8 +2375,9 @@ def shell(
2375
2375
occ_faces_list = TopTools_ListOfShape ()
2376
2376
shell_builder = BRepOffsetAPI_MakeThickSolid ()
2377
2377
2378
- for f in faceList :
2379
- occ_faces_list .Append (f .wrapped )
2378
+ if faceList :
2379
+ for f in faceList :
2380
+ occ_faces_list .Append (f .wrapped )
2380
2381
2381
2382
shell_builder .MakeThickSolidByJoin (
2382
2383
self .wrapped ,
Original file line number Diff line number Diff line change @@ -2290,6 +2290,14 @@ def testClosedShell(self):
2290
2290
s3 = Workplane ().polyline (pts ).close ().extrude (1 ).shell (- 0.05 )
2291
2291
self .assertTrue (s3 .val ().isValid ())
2292
2292
2293
+ s4_shape = Workplane ("XY" ).box (2 , 2 , 2 ).val ()
2294
+ # test that None and empty list both work and are equivalent
2295
+ s4_shell_1 = s4_shape .shell (faceList = None , thickness = - 0.1 )
2296
+ s4_shell_2 = s4_shape .shell (faceList = [], thickness = - 0.1 )
2297
+ # this should be the same as the first shape
2298
+ self .assertEqual (len (s4_shell_1 .Faces ()), s1 .faces ().size ())
2299
+ self .assertEqual (len (s4_shell_2 .Faces ()), s1 .faces ().size ())
2300
+
2293
2301
def testOpenCornerShell (self ):
2294
2302
s = Workplane ("XY" ).box (1 , 1 , 1 )
2295
2303
s1 = s .faces ("+Z" )
You can’t perform that action at this time.
0 commit comments