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

subselect:

Shape.select('F||top).select('V||front')

add selections:

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:

  1. What are we looking for and how many: scan for target Shape (_setSelectionTargetShape) ex: F == Faces = return all Faces, Face = return first Face -

  2. 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.

  3. 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

Hierarchy

  • Selector

Constructors

Properties

lastSelection: Selection
parentShape: ShapeCollection | Shape
selectString: string

Methods

  • We allow multiple selections with keyword 'and'

    Parameters

    • selectString: string

    Returns string[]

Generated using TypeDoc