Grasshopper

algorithmic modeling for Rhino

David et al

can you see if it possible to ask some one to implment a more basic compute method for the areamassproperties class? I only want to return the area of a brep. Its taking almost 15 seconds to calcualte the area mass properties for just 12000 breps. An option where you could have a flag to define that only certain properties are to be cauclated would hopefully really speed this emthod up,

 

cheers

 

Views: 2007

Replies to This Discussion

you can also see the difference in speed if you go to rhino and select the surfaces and go to

 

Analyze>Mass Properties

 

The options are spit up in to Area/Area Centroid/Area Moments

 

Selecting area will be massivly quicker to calculate than Area Centroid and Area Moments.

 

Same applies to Volume/Volume Centroid/Volume Moments

 

 

I think this would be part of a much bigger project, namely the ability to disable certain output parameters for a load of components and then not even bothering to compute the data for those disabled outputs. I think a lot of components could benefit performance (and memory) wise from such a feature. Definitely post 0.9 though.

--

David Rutten

david@mcneel.com

Poprad, Slovakia

If u get areas using ur component it will take much much longer than if done from the rhino vommand line or menu. Im sure its because u dont have a method in the rhinocommon api to compute area. Getting areas and volumes is an everyday thing.

Ah, it's a RhinoCommon wish. I didn't get that. I'll see about adding either more options to AreaMassProperties.Compute or maybe an Area/Volume method to Brep/Mesh etc.

--

David Rutten

david@mcneel.com

Poprad, Slovakia

These values are all calculated at the same time so there really won't be any improvement in speed by breaking things into separate functions.  You may want to consider something like a parallel for loop to compute that many areas at once.

Ok Ill try that.

But, there is definitely a difference in speed in the Rhino 5 environment depending on if you calculate area, centroid or moment. (Analyze > Mass Properties). Typically calculating Area Centroids and Area Moments is much more intensive than just calculating the area. To calculate area centroids and area moments you need to cacualte the area first, hence why i had hoped that there could be an option for just calcualting this. I dont need area moments and centroids.

The Rhino core area/volume solver allows you to limit which properties you want to calculate. The AreaMassProperties.Compute method calculates all of them. I just added two methods to Brep (GetArea and GetVolume) that do not solve first, second and product moments. Also, the function does not return error information. However it is quite a bit faster.

Top VB uses AreaMassProperties.Compute and the bottom one uses Brep.GetArea. They both solve areas for 1000 spheres of radius 1.

--

David Rutten

david@mcneel.com

Poprad, Slovakia

awesome, that is exactl what i was experiencing in that areas were taking a long time to compute. Looks like your new method is x10 quicker.

which name space is the Rhino core area/volume solver in? I cannot find that anywhere in the SDK on-line help

Maybe David means the Rhino C++ SDK?

Ok call me stupid, but i thought rhincocommon was the sdk/api for rhino 5.

There is also the c++ SDK.  The core of Rhino is written in c++, and I have heard other developers refer to the 'internal c++' core which is an area we can probably not touch.

Got it. I dont want to mess with c++ tbh. I guess its possible to reference the c++ dll also. This leads to another interesting point. Is rhinocommon an intermediate layer and for speed should wr be using th c++ sdk instead?

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service