intersect and match ruby routines are taking long time to execute. Any help/suggestion in optimizing them would be great.

asked 2018-10-10 23:46:21 -0600

Karthick gravatar image

updated 2018-12-18 21:46:09 -0600

I am passing the building model for intersection and matching and it takes around 60 secs complete it on unix env with ruby 1.9. Any suggestion on how to improve execution time would be greatly appreciated.

Thanks Karthick

Modifying the question. I can get around the time of execution but the intersection routines are shattering surfaces into many random surfaces. Not sure how to make sure the intersection is regular and not random surface shapes. Any help would be greatly appreciated.

C:\fakepath\Shattering of floor surfaces.png

edit retag flag offensive close merge delete


@Karthick what version of OpenStudio are you using. We are currently using Ruby 2.2.4. It has been a long time since we used a 1.x ruby so that could certainly create issues in trying to use the SDK. If you call the OpenStudio CLI to run the measure, it will use our built in Ruby, so that may a good idea. It is also hard to know if the time seems long without knowing more about the complexity of the model. Is the time an issue because you are running a large parametric analysis? You could always pre-intersect.match the seed, you can also turn of intersect in measure unless needed.

David Goldwasser gravatar imageDavid Goldwasser ( 2018-10-11 12:30:11 -0600 )edit

Sorry David, Somehow missed your comment.

I am on Ruby 2.2 now. I can work around the time but the surfaces are getting shattered instead of getting intersected in regular shapes. I am not sure what is happening there. Any suggestion please.

Karthick gravatar imageKarthick ( 2018-12-18 21:32:00 -0600 )edit

Have you tried using the surface matching measure and not the SketchUp plugin for intersection?

David Goldwasser gravatar imageDavid Goldwasser ( 2018-12-19 01:10:19 -0600 )edit

I am using the ruby shared lib using the .intersect method. I mean not using sketchup.

Karthick gravatar imageKarthick ( 2018-12-20 18:22:52 -0600 )edit

@Karthick so when did it start going faster, when you switched from ruby 1.0 to 2.2? Is that also when it started created un-expected surfaces on intersection? What version of OpenStudio are you using? Since you are still not using Ruby 2.2.4, consider this approach. The OpenStudio CLI has a built in ruby 2.24. interpreter. When running the measure instead of ruby measure.rb call openstudio measure.rb. If this still doesn't work as expected you can send the model to and we can take a look at it.

David Goldwasser gravatar imageDavid Goldwasser ( 2018-12-21 14:31:32 -0600 )edit