AreaMassProperties fails for surface but not brep

What causes AreaMassProperties to not compute for some surfaces even though it can be computed for the breps that they derive from and breps that are derived from them? The red and cyan breps were _ExtendSrf _Type=Line of the green, but only the AreaMassProperties of the underlying surface of the red one cannot be computed.

This also occurs in Rhino 5.

Thank you,

import Rhino
import rhinoscriptsyntax as rs

def main():
    idBrep = rs.GetObject("Select surface", rs.filter.surface, preselect=True)
    if idBrep is None: return
    rgBrep0 = rs.coercebrep(idBrep)
    s = 'Rhino.Geometry.AreaMassProperties.Compute(rgBrep0)'; print s+':',eval(s)
    rgSrf = rgBrep0.Faces[0].UnderlyingSurface()
    s = 'rgSrf.IsValid'; print s+':',eval(s)
    s = 'Rhino.Geometry.AreaMassProperties.Compute(rgSrf)'; print s+':',eval(s)
    rgBrep1 = rgSrf.ToBrep()
    s = 'Rhino.Geometry.AreaMassProperties.Compute(rgBrep1)'; print s+':',eval(s)

if __name__ == '__main__': main()
Rhino.Geometry.AreaMassProperties.Compute(rgBrep0): <Rhino.Geometry.AreaMassProperties object at 0x000000000000013F [Rhino.Geometry.AreaMassProperties]>
rgSrf.IsValid: True
Rhino.Geometry.AreaMassProperties.Compute(rgSrf): None
Rhino.Geometry.AreaMassProperties.Compute(rgBrep1): <Rhino.Geometry.AreaMassProperties object at 0x0000000000000140 [Rhino.Geometry.AreaMassProperties]>

AreaMassProperties.3dm (44.9 KB)

To answer this, we will need to see the geometry that isn’t working. Can you post this?

The link is at the end of the post.

This is a bit odd, as calculating the area of the BrepFace seems to work. I’ve added an item for this.

– Dale

Looks like the above is fixed for this week’s WIP release

It was fixed in last week’s WIP. Thanks.

Something else I had noticed after my post was that the area for some surfaces, like the cyan one of my upload, was slightly different than that of the brep (61.1445972120 vs. 61.1446010326). Now, they are the same (61.1446010326).