.. _selector_reference: String Selectors Reference ============================= CadQuery selector strings allow filtering various types of object lists. Most commonly, Edges, Faces, and Vertices are used, but all objects types can be filtered. String selectors are simply shortcuts for using the full object equivalents. If you pass one of the string patterns in, CadQuery will automatically use the associated selector object. * :py:meth:`cadquery.CQ.faces` * :py:meth:`cadquery.CQ.edges` * :py:meth:`cadquery.CQ.vertices` * :py:meth:`cadquery.CQ.solids` * :py:meth:`cadquery.CQ.shells` .. note:: String selectors are shortcuts to concrete selector classes, which you can use or extend. See :ref:`classreference` for more details If you find that the built-in selectors are not sufficient, you can easily plug in your own. See :ref:`extending` to see how. Combining Selectors ========================== Selectors can be combined arithmetically and logically, so that it is possible to do intersection, union, and other combinations. For example:: box = cadquery.Workplane("XY").box(10,10,10) s = selectors.StringSyntaxSelector ### select all edges on right and left faces #box = box.edges((s("|Z") + s("|Y"))).fillet(1) ### select all edges on top and bottom #box = box.edges(-s("|Z")).fillet(1) #box = box.edges(s('|X')+s('Y')).fillet(1) box = box.faces(s('>Z')+s('Z')+s('Y Face farthest in the positive y dir :py:class:`cadquery.DirectionMinMaxSelector` 0 or 1 Y Edges farthest in the positive y dir :py:class:`cadquery.DirectionMinMaxSelector` 0 or 1 Y Vertices farthest in the positive y dir :py:class:`cadquery.DirectionMinMaxSelector` 0 or 1