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

Function test_rarray

tests/test_sketch.py:207–223  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

205
206
207def test_rarray():
208
209 with raises(ValueError):
210 Sketch().rarray(2, 2, 3, 0).rect(1, 1)
211
212 s1 = Sketch().rarray(2, 2, 3, 3).rect(1, 1)
213
214 assert s1._faces.Area() == approx(9)
215 assert len(s1._faces.Faces()) == 9
216
217 s2 = Sketch().push([(0, 0), (1, 1)]).rarray(2, 2, 3, 3).rect(0.5, 0.5)
218
219 assert s2._faces.Area() == approx(18 * 0.25)
220 assert len(s2._faces.Faces()) == 18
221 assert s2.reset().vertices(">(1,1,0)")._selection[0].toTuple() == approx(
222 (3.25, 3.25, 0)
223 )
224
225
226def test_parray():

Callers

nothing calls this directly

Calls 9

SketchClass · 0.90
pushMethod · 0.80
resetMethod · 0.80
rectMethod · 0.45
rarrayMethod · 0.45
AreaMethod · 0.45
FacesMethod · 0.45
toTupleMethod · 0.45
verticesMethod · 0.45

Tested by

no test coverage detected