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

Method testWorkplaneFromTagged

tests/test_cadquery.py:4307–4332  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

4305 self.assertTupleAlmostEquals((0, 0, 5), obj1.val().Center().toTuple(), 9)
4306
4307 def testWorkplaneFromTagged(self):
4308
4309 # create a flat, wide base. Extrude one object 4 units high, another
4310 # object on top of it 6 units high. Go back to base plane. Extrude an
4311 # object 11 units high. Assert that top face is 11 units high.
4312 result = (
4313 Workplane("XY")
4314 .box(10, 10, 1, centered=(True, True, False))
4315 .faces(">Z")
4316 .workplane()
4317 .tag("base")
4318 .center(3, 0)
4319 .rect(2, 2)
4320 .extrude(4)
4321 .faces(">Z")
4322 .workplane()
4323 .circle(1)
4324 .extrude(6)
4325 .workplaneFromTagged("base")
4326 .center(-3, 0)
4327 .circle(1)
4328 .extrude(11)
4329 )
4330 self.assertTupleAlmostEquals(
4331 result.faces(">Z").val().Center().toTuple(), (-3, 0, 12), 9
4332 )
4333
4334 def testWorkplaneOrientationOnVertex(self):
4335

Callers

nothing calls this directly

Calls 14

WorkplaneClass · 0.85
extrudeMethod · 0.80
centerMethod · 0.80
workplaneFromTaggedMethod · 0.80
workplaneMethod · 0.80
boxMethod · 0.80
circleMethod · 0.45
facesMethod · 0.45
rectMethod · 0.45
tagMethod · 0.45
toTupleMethod · 0.45

Tested by

no test coverage detected