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

Function torus

cadquery/occ_impl/shapes.py:6448–6462  ·  view source on GitHub ↗

Construct a solid torus.

(d1: float, d2: float)

Source from the content-addressed store, hash-verified

6446
6447
6448def torus(d1: float, d2: float) -> Solid:
6449 """
6450 Construct a solid torus.
6451 """
6452
6453 return _shape(
6454 BRepPrimAPI_MakeTorus(
6455 gp_Ax2(Vector(0, 0, 0).toPnt(), Vector(0, 0, 1).toDir()),
6456 d1 / 2,
6457 d2 / 2,
6458 0,
6459 2 * pi,
6460 ).Shape(),
6461 Solid,
6462 )
6463
6464
6465@multidispatch

Callers 8

test_normalsFunction · 0.90
test_approximate2DFunction · 0.85
torus_faceFunction · 0.85
test_ctrlPtsFunction · 0.85
test_styleFunction · 0.85
test_constructorsFunction · 0.85
test_edgeOnFunction · 0.85
test_torusFunction · 0.85

Calls 4

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

Tested by 8

test_normalsFunction · 0.72
test_approximate2DFunction · 0.68
torus_faceFunction · 0.68
test_ctrlPtsFunction · 0.68
test_styleFunction · 0.68
test_constructorsFunction · 0.68
test_edgeOnFunction · 0.68
test_torusFunction · 0.68