MCPcopy
hub / github.com/CadQuery/cadquery / shell

Method shell

cadquery/cq.py:1183–1217  ·  view source on GitHub ↗

Remove the selected faces to create a shell of the specified thickness. To shell, first create a solid, and *in the same chain* select the faces you wish to remove. :param thickness: thickness of the desired shell. Negative values shell inwards, positive values

(
        self: T, thickness: float, kind: Literal["arc", "intersection"] = "arc"
    )

Source from the content-addressed store, hash-verified

1181 )
1182
1183 def shell(
1184 self: T, thickness: float, kind: Literal["arc", "intersection"] = "arc"
1185 ) -> T:
1186 """
1187 Remove the selected faces to create a shell of the specified thickness.
1188
1189 To shell, first create a solid, and *in the same chain* select the faces you wish to remove.
1190
1191 :param thickness: thickness of the desired shell.
1192 Negative values shell inwards, positive values shell outwards.
1193 :param kind: kind of join, arc or intersection (default: arc).
1194 :raises ValueError: if the current stack contains objects that are not faces of a solid
1195 further up in the chain.
1196 :returns: a CQ object with the resulting shelled solid selected.
1197
1198 This example will create a hollowed out unit cube, where the top most face is open,
1199 and all other walls are 0.2 units thick::
1200
1201 Workplane().box(1, 1, 1).faces("+Z").shell(0.2)
1202
1203 You can also select multiple faces at once. Here is an example that creates a three-walled
1204 corner, by removing three faces of a cube::
1205
1206 Workplane().box(10, 10, 10).faces(">Z or >X or <Y").shell(1)
1207
1208 **Note**: When sharp edges are shelled inwards, they remain sharp corners, but **outward**
1209 shells are automatically filleted (unless kind="intersection"), because an outward offset
1210 from a corner generates a radius.
1211 """
1212 solidRef = self.findSolid()
1213
1214 faces = [f for f in self.objects if isinstance(f, Face)]
1215
1216 s = solidRef.hollow(faces, thickness, kind=kind)
1217 return self.newObject([s])
1218
1219 def fillet(self: T, radius: float) -> T:
1220 """

Callers 10

test_single_ent_selectorFunction · 0.45
testLegoBrickMethod · 0.45
testOccBottleMethod · 0.45
testSimpleShellMethod · 0.45
testClosedShellMethod · 0.45
testOpenCornerShellMethod · 0.45

Calls 3

findSolidMethod · 0.95
newObjectMethod · 0.95
hollowMethod · 0.80

Tested by 7

test_single_ent_selectorFunction · 0.36
testLegoBrickMethod · 0.36
testOccBottleMethod · 0.36
testSimpleShellMethod · 0.36
testClosedShellMethod · 0.36
testOpenCornerShellMethod · 0.36