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

Method testAndSelector

tests/test_selectors.py:1012–1029  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1010 )
1011
1012 def testAndSelector(self):
1013 c = CQ(makeUnitCube())
1014
1015 S = selectors.StringSyntaxSelector
1016 BS = selectors.BoxSelector
1017
1018 el = c.edges(
1019 selectors.AndSelector(S("|X"), BS((-2, -2, 0.1), (2, 2, 2)))
1020 ).vals()
1021 self.assertEqual(2, len(el))
1022
1023 # test 'and' (intersection) operator
1024 el = c.edges(S("|X") & BS((-2, -2, 0.1), (2, 2, 2))).vals()
1025 self.assertEqual(2, len(el))
1026
1027 # test using extended string syntax
1028 v = c.vertices(">X and >Y").vals()
1029 self.assertEqual(2, len(v))
1030
1031 def testSumSelector(self):
1032 c = CQ(makeUnitCube())

Callers

nothing calls this directly

Calls 6

makeUnitCubeFunction · 0.90
SFunction · 0.85
BSFunction · 0.85
valsMethod · 0.45
edgesMethod · 0.45
verticesMethod · 0.45

Tested by

no test coverage detected