ex:
Shape.select('E|Z') - Edges parallel to Z axis
Shape.select('V<<Z') - Vertex with smallest Z coordinate
Shape.select('V<X=10') - Vertex with X coordinate smaller than 10
subselect:
Shape.select('F||top).select('V||front')
addselections:
Shape.select('F||top and F||front')
How to add new selectors:
There is a configuration based scaffolding to easy parse the selectors.
Parsing selection strings is done in these phases:
What are we looking for and how many: scan for target Shape (_setSelectionTargetShape)
ex: F == Faces = return all Faces, Face = return first Face -
Which selector and parameters: _executeSelectString
_executeSelectString contains all parsing logic and is the place where you add new selectors.
!!!! IMPORTANT !!!! Parsing order of selector regular expressions is important:
Place the more complex ones first and simple ones (that might overlap with complex ones) later.
Parsed selector and parameters are forwarded to specific selector method on Shape class as defined in _executeSelectString
that returns the real Shapes or ShapeCollection based on number of results a selector is suppose to return
Class for selecting parts of Shapes
ex: Shape.select('E|Z') - Edges parallel to Z axis Shape.select('V<<Z') - Vertex with smallest Z coordinate Shape.select('V<X=10') - Vertex with X coordinate smaller than 10
How to add new selectors:
There is a configuration based scaffolding to easy parse the selectors. Parsing selection strings is done in these phases:
What are we looking for and how many: scan for target Shape (_setSelectionTargetShape) ex: F == Faces = return all Faces, Face = return first Face -
Which selector and parameters: _executeSelectString _executeSelectString contains all parsing logic and is the place where you add new selectors. !!!! IMPORTANT !!!! Parsing order of selector regular expressions is important: Place the more complex ones first and simple ones (that might overlap with complex ones) later.
Parsed selector and parameters are forwarded to specific selector method on Shape class as defined in _executeSelectString that returns the real Shapes or ShapeCollection based on number of results a selector is suppose to return