008 – Using a cull pattern component
Updated: May 16
What is a cull pattern and why is it useful?
A cull pattern component allows you to keep and discard data based on a given pattern. In this example, we will use a Cull Pattern on a set of different geometries.
Prerequisite: Make a list of 8 to 10 geometries in a row.
Steps:
Step 1: We want to remove (cull) all the geometries that are not a sphere. First you need to select all of the geometry ‘items’.

Step 2: Then use the ‘match text’ component for the list of items to determine which are spheres and which are not.

Step 3: Each item is compared against the word “sphere”. You need to add a panel and connect it to the pattern node of the ‘match text’ component. You also need to connect a panel to the match node on the right. If it matches then the output is True, if it doesn’t match then the output is False.

Step 4: We use this pattern to determine which geometries need to be culled. You now need to add a ‘cull pattern’ below the ‘True/ False panel’. And add the ‘items’ to the list node on the ‘cull pattern’. Then connect ‘match’ to ‘cull pattern’. Now only the spheres should remain.

Step 5: To go a step further and compare the items against the word “cylinder”, you need to remove the ‘cull pattern’ component and add another ‘match text’. Connect the new ‘match text’ with the ‘my items’ panel and “cylinder” word panel.

Step 6: Next you should add a ‘gate or’ component. The “sphere” panel should connect to ‘A’ and the “cylinder” panel should connect to ‘B’. The result can then be connected to the ‘True/ False panel’.

Step 7: Lastly, add a ‘cull pattern’ component and connect ‘items’ with the list node. The result node from the ‘gate or’ component should be connected to ‘cull pattern’. Now only spheres and cylinders remain.

This helps you to add more logic to the geometry you have chosen: like calculating the area, changing the colour or continuing to model with the chosen geometry.
Learn more
Read our previous blog post or sign up to our platform here to put your Grasshopper models online and share them.