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

Method fillet

cadquery/cq.py:1219–1245  ·  view source on GitHub ↗

Fillets a solid on the selected edges. The edges on the stack are filleted. The solid to which the edges belong must be in the parent chain of the selected edges. :param radius: the radius of the fillet, must be > zero :raises ValueError: if at least one ed

(self: T, radius: float)

Source from the content-addressed store, hash-verified

1217 return self.newObject([s])
1218
1219 def fillet(self: T, radius: float) -> T:
1220 """
1221 Fillets a solid on the selected edges.
1222
1223 The edges on the stack are filleted. The solid to which the edges belong must be in the
1224 parent chain of the selected edges.
1225
1226 :param radius: the radius of the fillet, must be > zero
1227 :raises ValueError: if at least one edge is not selected
1228 :raises ValueError: if the solid containing the edge is not in the chain
1229 :returns: CQ object with the resulting solid selected.
1230
1231 This example will create a unit cube, with the top edges filleted::
1232
1233 s = Workplane().box(1, 1, 1).faces("+Z").edges().fillet(0.1)
1234 """
1235 # TODO: ensure that edges selected actually belong to the solid in the chain, otherwise,
1236 # TODO: we segfault
1237
1238 solid = self.findSolid()
1239
1240 edgeList = cast(List[Edge], self.edges().vals())
1241 if len(edgeList) < 1:
1242 raise ValueError("Fillets requires that edges be selected")
1243
1244 s = solid.fillet(radius, edgeList)
1245 return self.newObject([s.clean()])
1246
1247 def chamfer(self: T, length: float, length2: Optional[float] = None) -> T:
1248 """

Callers 13

testWireFilletMethod · 0.45
test_modifiersFunction · 0.45
test_missing_selectionFunction · 0.45
test_splineMethod · 0.45
testDXFMethod · 0.45
test_dxf_approxFunction · 0.45
testFilletMethod · 0.45
testTopFaceFilletMethod · 0.45
testEnclosureMethod · 0.45
testRadiusNthSelectorMethod · 0.45

Calls 5

findSolidMethod · 0.95
edgesMethod · 0.95
newObjectMethod · 0.95
valsMethod · 0.45
cleanMethod · 0.45

Tested by 10

testWireFilletMethod · 0.36
test_modifiersFunction · 0.36
test_missing_selectionFunction · 0.36
test_splineMethod · 0.36
testDXFMethod · 0.36
test_dxf_approxFunction · 0.36
testFilletMethod · 0.36
testTopFaceFilletMethod · 0.36
testEnclosureMethod · 0.36
testRadiusNthSelectorMethod · 0.36