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

Function rect

cadquery/occ_impl/shapes.py:6292–6299  ·  view source on GitHub ↗

Construct a rectangle.

(w: float, h: float)

Source from the content-addressed store, hash-verified

6290
6291
6292def rect(w: float, h: float) -> Wire:
6293 """
6294 Construct a rectangle.
6295 """
6296
6297 return polygon(
6298 (-w / 2, -h / 2, 0), (w / 2, -h / 2, 0), (w / 2, h / 2, 0), (-w / 2, h / 2, 0)
6299 )
6300
6301
6302@multimethod

Callers 13

test_dxf_shapeFunction · 0.90
test_toVTKFunction · 0.90
test_extrude_faceMethod · 0.85
make_modelFunction · 0.85
test_utilsFunction · 0.85
test_rectFunction · 0.85
test_fillFunction · 0.85
test_extrudeFunction · 0.85
test_revolveFunction · 0.85
test_sweepFunction · 0.85
test_loftFunction · 0.85
test_loft_vertexFunction · 0.85

Calls 1

polygonFunction · 0.85

Tested by 13

test_dxf_shapeFunction · 0.72
test_toVTKFunction · 0.72
test_extrude_faceMethod · 0.68
make_modelFunction · 0.68
test_utilsFunction · 0.68
test_rectFunction · 0.68
test_fillFunction · 0.68
test_extrudeFunction · 0.68
test_revolveFunction · 0.68
test_sweepFunction · 0.68
test_loftFunction · 0.68
test_loft_vertexFunction · 0.68