Detect if a surface is a full sphere

I would like to detect if a closed surface is an exact sphere.

There is a TryGetSphere function in the API, but it also returns true if this is a portion of a sphere, which is not OK in my case. Is there any way to check it is complete?


You could compare the area of the surface in question to what you would expect from a full sphere.

There is a TryGetSphere function in the API

Use that, in combination with a test to see if the object is trimmed. Easiest is to do this:

trimmed = rs.IsSurfaceTrimmed(id)

If the surface is not trimmed and a sphere, it is a full sphere.

Revolving an arc less than 360 degrees will produce an untrimmed surface that passes the TryGetSphere test.

But in this case it is not a single, closed surface. So if I test all these

  • Object is closed
  • Object is made of a single surface (not joined)
  • This single surface passes the TryGetSphere test
  • And is untrimmed

Can I assume this is a full sphere?


Sounds reasonable.

– Dale

As long as you are using Closed in the polysurface sense, as in no naked edges, rather than in the surface sense meaning that there is a seam.