Figuring out what kind of surface I have?

Dear All,

I’m trying to figure out, if given an arbitrary surface, what kind of surface it is. So, for instance, is it closed in one direction but not the other (a cone or cylinder)? Or is it open in all directions? Or closed in both (like a sphere)? Is there already an easy way to do this in Grasshopper or GHPython that I just haven’t found? Or is the best way to look at its isocurves and try to figure out their curvature?

My apologies if this is a topic already covered, but my searches didn’t seem to turn it up!

Thanks so much,
Mary

There is a rhino common method for checking if it is closed. I think pufferfish offers also a component for checking this

As @Baris said…


IsSurfaceClosed_re.gh (147.3 KB)

1 Like

Those are actually quite distinct concerns (that may or may not be related depending on your specific cases):

Use the Python function type() to determine explicitly which RhinoCommon geometry type it is.

A closed cylinder/would be a Brep, not any of the surface types. Have a look at this old post by David that explains the different types and how they relate.

You can check if a surface is closed using IsClosed, and if a brep is closed/solid using IsSolid.

I’m not sure how that might help, but again probably depends on exactly what it is you’re trying to determine. Anywho, hope this at least helped point in the right direction.

Edit: Sorry think I misunderstood, you probably meant a single surface cone/cylinder that is not capped. Surface.IsClosed should do the trick then. Always good to provide example files.

4 Likes

Ah, I’m so sorry I missed the Rhino IsClosed method for surfaces. I haven’t a clue how I managed to miss that in my searches, and it’s very embarrassing! (I found the one for curves which is why I thought I might have to look at the isocurves to figure it out for surfaces…)

And thank you so much for the Pufferfish recommendation and examples. Wow – that plugin includes many things I was about to need. I am so grateful you pointed it out to me.

Thank you all for your kind help!

Best wishes,
Mary

1 Like

Ah, yes, sorry about the ambiguity, Anders. I was thinking the uncapped variety of cone. Next time I will remember to include an example file since I can never tell when my description alone is ambiguous!

Best wishes,
Mary

1 Like