Filter Content - Geometry

Hi guys,

I’m trying to filter Surfaces by Trimmed or Untrimmed geometry using Filter Content, but it doesn’t seem to work.

I know how to filter this with Match Tex’t or with ‘Contains’ expression, but I’d like to know how to do it with Filter Content itself.

Any idea why it fails?

Filter Content Geometry.gh (18.6 KB)

  1. I think the key should be set in the filter and not with a Model Attribute Key component
  2. Once the surfaces are plugged into the content input, the filter component reads the surfaces as Model Surface. I filtered for “Mod” and all surfaces are returned

Filter Content Geometry mrtn.gh (25.1 KB)

Excited to hear what @Japhy or @kike say about this.

1 Like

These are unreferenced Grasshopper geometries. I don’t think they have attributes.

@howtograsshopper You can use Pufferfish’s Is Surface Trimmed

Or you can compare the regions of the trimmed and untrimmed surfaces if you want to do it with native components:


Filter Content Geometry VR 01.gh (39.1 KB)

Thank Martin. Also curious to hear what they think about this approach.

1 Like

Thanks for replying. Just to clarify, I already know a few different ways to handle this. I was mostly curious whether Filter Content can do it, since I wasn’t sure if I was using it incorrectly or if it’s just a bug.

There are a number of cases where having a component that outputs all possible available options would be helpful.

Similar to Content Identity::Attributes but with various enums

Cyclops’s 'Get Property Value’ component can actually get attributes like ‘IsSurface’. I wonder if can be used in the filter component. I’m out of the studio for the night, I’ll try tomorrow and see.

1 Like

I’m still a bit confused and not sure how this connects to the issue I’m having.

For me the problem happens when using Geometry as the Model Attribute Key with Filter Content. Does that mean I’ve done something wrong or could this be a bug?

Using Geometrytype in a filter there is a list of Enum values that can be filtered. This is part of the Rhinocommon SDK values:

  1. None
  2. Point
  3. PointSet
  4. Curve
  5. Surface
  6. Brep
  7. Mesh
  8. Light
  9. Annotation
  10. InstanceDefinition
  11. InstanceReference
  12. TextDot
  13. Grip
  14. Detail
  15. Hatch
  16. MorphControl
  17. SubD
  18. BrepLoop
  19. BrepVertex
  20. PolysrfFilter
  21. EdgeFilter
  22. PolyedgeFilter
  23. MeshVertex
  24. MeshEdge
  25. MeshFace
  26. Cage
  27. Phantom
  28. ClipPlane
  29. Extrusion
  30. AnyObject

Filtering for a Surface (IsSurface) is easy in this case. But what cannot be filtered is on Surface whether it is Trimmed or untrimmed, because in Rhino trimmed or untrimmed is not a geometry type.

What can be confusing is that in Model objects we do identify Trimmed vs Untrimmed surfaces. But this is not a specific attribute of the object, just a name that it is given. So the best to do is run a Name(string) Match on the name and then cull that list:

Simple Python scripts could be also used to get to any of the SDK Properties.

The Content Matchtext components in the Rhino toolbar are used to get at the attributes of any Model Object. As Basic Grasshopper datatypes do not come with additional attributes.

3 Likes

Hi Scott,

As I mentioned in my first post, I’m familiar with filtering Trimmed and Untrimmed Surfaces using MatchText the way you showed. I was mainly curious if there was a way to achieve the same result using Filter Content directly.

Thanks for the clarification. That explains why it behaves the way it does.

1 Like

I know this is not what you are looking for, but if you want to user filter content then I would do this

also,

This doesn’t work, and also as Scott said, there is no distinction between a trimmed and untrimmed surface anyway.

1 Like