Using Rhino.Input.Custom.GetObject. Filtering by surface and polysurface. When the user selects a single surface within a polysurface, the GeometryComponentIndex.Index is returned as a number > -1. Does this index correspond to BOTH objO.Faces AND objO.Surfaces every single time, meaning face 0 always corresponds to surface 0 and face 99 always corresponds to surface 99. Could face 0 ever correspond to a difference surface number other than 0?
What I am wanting to do is manipulate the face colors based on calculations done on the corresponding surface normal. So if the faces and surface indexes don’t always correspond to the same object with the same index, then I need to know how to be able to gain access to a surface based on the face the user selected (component index).
i = Rhino.Input.Custom.GetObject()
i.SetCommandPrompt('Select at least one surface.')
i.GeometryFilter = ot.Surface | ot.PolysrfFilter
i.GroupSelect = True
i.DisablePreSelect()
i.GetMultiple(1, 0)
if i.ObjectCount == 0:
print 'No surfaces selected.'
return
for o in i.Objects():
objO = rs.coercebrep(o.ObjectId)
print 'Component Index: ' + str(o.GeometryComponentIndex.Index)