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

Function sphere

cadquery/occ_impl/shapes.py:6435–6445  ·  view source on GitHub ↗

Construct a solid sphere.

(d: float)

Source from the content-addressed store, hash-verified

6433
6434
6435def sphere(d: float) -> Solid:
6436 """
6437 Construct a solid sphere.
6438 """
6439
6440 return _shape(
6441 BRepPrimAPI_MakeSphere(
6442 gp_Ax2(Vector(0, 0, 0).toPnt(), Vector(0, 0, 1).toDir()), d / 2,
6443 ).Shape(),
6444 Solid,
6445 )
6446
6447
6448def torus(d1: float, d2: float) -> Solid:

Callers 4

test_solidFunction · 0.85
test_faceOnFunction · 0.85
test_sphereFunction · 0.85
test_movedFunction · 0.85

Calls 4

_shapeFunction · 0.85
VectorClass · 0.85
toPntMethod · 0.80
toDirMethod · 0.80

Tested by 4

test_solidFunction · 0.68
test_faceOnFunction · 0.68
test_sphereFunction · 0.68
test_movedFunction · 0.68