Karamba3D 2.2.0
3.1.15: Dispatch Elements
All structural elements can be given identifiers, i.e. names. Names are case sensitive and need to start with a letter or underscore. After the first initial letter numbers and letters may follow. Names need not be unique: Two elements can have the same name without Karamba3D complaining. Each element has a default identifier: its index. This is the reason why it is not allowed to have an integer number as an element identifier. Fig. shows how a list of elements can be split into two data trees using their identifiers. The β€œDispatch Elements"-component expects a list of elements in β€œElems” as well as a list of identifiers or regular expressions in β€œId”. Regular expressions need to be prefixed by a β€œ&”. They represent a very mighty selection tool. In fig. one can see three use-cases:
  • β€œ&.[1-2]”: a β€œ.” matches any character; β€œ[1-2]” matches one character in the range of β€œ1” to β€œ2”. This is equivalent to β€œ[12]”.
  • β€œ&b.”: matches any identifier that starts with β€œb” followed by an arbitrary character.
  • β€œ&.[13]”: matches any identifier that starts with an arbitrary character followed either by β€œ1” or β€œ3”.
Fig. Elements can be selected by using their identifiers
There are two output-plugs on the β€œSelect Beam”-component: β€œSElem” renders the selected elements which match the selection criteria, β€œRElem” returns the rest. The entries of the β€œSElem” and β€œRElem” output data remember their spot in the original list of elements. Joining them results in the original order of elements.
Last modified 2mo ago
Copy link