Merge pull request #704 from CadQuery/assy-selectors-fix

Use expression grammar for assy selectors
This commit is contained in:
Jeremy Wright
2021-03-29 07:02:00 -04:00
committed by GitHub
2 changed files with 8 additions and 1 deletions

View File

@ -14,7 +14,7 @@ from .occ_impl.solver import (
)
from .occ_impl.exporters.assembly import exportAssembly, exportCAF
from .selectors import _grammar as _selector_grammar
from .selectors import _expression_grammar as _selector_grammar
# type definitions
AssemblyObjects = Union[Shape, Workplane, None]

View File

@ -218,3 +218,10 @@ def test_empty_solve(nested_assy):
with pytest.raises(ValueError):
nested_assy.solve()
def test_expression_grammar(nested_assy):
nested_assy.constrain(
"TOP@faces@>Z", "SECOND/BOTTOM@vertices@>X and >Y and >Z", "Point"
)