Hi Steve, looks slightly buggy to me. If i _ShrinkTrimmedSrf i got this in V5:
0.2855 seconds for Rhino.RhinoApp.RunScript("_Area", False)
0.0126 seconds for Rhino.Geometry.AreaMassProperties.Compute(brep)
but this in the WIP:
21.5226 seconds for Rhino.RhinoApp.RunScript("_Area", False)
214.3793 seconds for Rhino.Geometry.AreaMassProperties.Compute(brep)
i think the reason is the crazy parameterisation of the surface. If you use _Reparameterize with the _Automatic option, i get this in the WIP:
0.0878 seconds for Rhino.RhinoApp.RunScript("_Area", False)
0.02 seconds for Rhino.Geometry.AreaMassProperties.Compute(brep)
You may check both domains of the surface (or of a virtual copy) and set them with surface.SetDomain() to an interval from 0 to a value optained by surface.GetSurfaceSize()…
I just realized that the surface has 6 columns of control points spanning less than 0.0003. (ModelAbsoluteTolerance is 0.0002). The surface has a fully-multiple knot relative to this set of control points.
V5’s _ShrinkTrimmedSrfToEdge reduces the 6 columns to 1, but
V6’s _ShrinkTrimmedSrfToEdge leaves them at 6 but at a span of 9e-8.
V5, V6 times (s) for _Area
10.6672, 10.336: No modification
10.5569, 10.3338: _ShrinkTrimmedSrf only
0.1257, 12.9157: _ShrinkTrimmedSrfToEdge only
0.1272, 10.3923: _Reparameterize _Automatic only
(-1.9e-11 to 1.0) (-2.3e-07 to 1.0): Original surface domains (u) (v)
(-1.9e-11 to 0.9996) (-2.3e-07 to 0.7851): _ShrinkTrimmedSrfToEdge only in V5 & V6
(0.0 to 0.4598) (0.0 to 1.3104): _Reparameterize _Automatic only in V5 & V6
if you have many of these i would just detect them by the uv domain values and if one is negative, create a virtual copy and proceed as described above.
btw. _RemoveMultiKnot did not found any multiple knots, i’ve tried that first.
Thanks for looking at this. From analyzing domains, knots, and control points before and after the aforementioned commands, I think the answer is to address the almost stacked control points.
Regardless, a timeout parameter for AreaMassProperties.Compute would be beneficial. The area mass properties UI commands have “Press Esc to cancel”.
_RemoveMultiKnot does not report fully-multiple knots.
The Area command and AreaMassProperties.Compute do very different things. Yes, they both compute the area. But AreaMassProperties.Compute also calculates area first moments, area second moments, and area product moments. This probably accounts for the difference in speed.
@dale, please see my first reply, i think this thread is less about the difference between both commands but about a possible bug. Changing the bogus parameterisation of the surface caused that:
Rhino.Geometry.AreaMassProperties.Compute(brep)
time changed from 214 seconds to 0.02 seconds using the WIP.