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

Function make_model

tests/test_assembly.py:1238–1256  ·  view source on GitHub ↗
(name: str, COPY: bool)

Source from the content-addressed store, hash-verified

1236
1237 # prepare the model
1238 def make_model(name: str, COPY: bool):
1239
1240 b = box(1, 1, 1)
1241
1242 assy = Assembly(name="test_assy")
1243 assy.add(box(1, 2, 5), color=Color("green"))
1244
1245 for i, v in enumerate(rect(10, 10).vertices()):
1246 assy.add(
1247 b.copy() if COPY else b,
1248 name=f"element_{i}",
1249 loc=Location(v.Center()),
1250 color=Color("red"),
1251 )
1252
1253 with chdir(tmpdir):
1254 assy.export(name)
1255
1256 return assy
1257
1258 make_model("test_assy_copy.step", True)
1259 make_model("test_assy.step", False)

Callers 1

Calls 10

addMethod · 0.95
exportMethod · 0.95
AssemblyClass · 0.90
ColorClass · 0.90
LocationClass · 0.90
boxFunction · 0.85
rectFunction · 0.85
verticesMethod · 0.45
copyMethod · 0.45
CenterMethod · 0.45

Tested by

no test coverage detected