Faster Computation

I have two lists of bounding box each 300 and 700 counts, I want to run a bounding box intersects to find if they intersect ,

What trick should i use to make the process faster,Is there a way to allocate some resources ect…?

From my point of view when using high density of geometry i would see the following being the way i would take things to reduce computation(Higher compute time to lowest)

Out of the box
Code Block
C# Node

It is also sometimes better to utilise revit geometry in python/c# instead of re-creating them in dynamo as this will help with compute resources.
For python and c# do not forget to dispose!

Are you using Revit elements for this because have a look at BimMorph package because it has a intersect node within that will help to reduce computation workload.



check out element filter collection in the revit api, they have some sick built in class detection function that are the fastest way to check if element is clashing. thats what bimorph nodes are built from :smiley: i think.

I have already tried Bimorph nodes and python too,both gave a significant difference yet what I have is a dynamo geometry and I don’t want to create unnecessary revit elements just for the sake of clash detection,Also I couldn’t find any node that does this faster calculation on dynamo geometries,let me know if there is any.

No worries I was highlighting the revit and dynamo geometry because sometimes people will grab geometry from revit with a node which will re-create it as a dynamo geometry and create a memory overhead. then they would re-create the changes in revit but if you can code it all with just revit api this will help with computation overheads.

Just to help of something i do even if it is dynamo geometry to then create something, it may be best to use python to limit all the preview/creation overheads for each node and each item in the node.

Lets say you are after using numbers to create a box and a set of numbers to create a ball, they are all positioned on set coordinates with what is not clashing being the out put therefore you would do the following in python:

  1. Create the points from coordinates.
  2. Create rectangle from points and numbers.
  3. Create ball from coordinates and numbers.
  4. Dispose all point info
  5. Get the geometry that is left.
  6. Dispose rectangle and ball geometric information
  7. Repeat steps 1 to 6 for each time it is needed
  8. Output all the geometry for each instance that is being checked
1 Like

Sorry i have made you to make so many assumptions,I should have added some more information,my bad.

This can be treated as a continuation to my post here:

The Actual problem here is i had to cross product lacing to find adjacent lines (connected lines) of each point which is really a time consuming computation,initially i was searching for some way where i can avoid other lines that are really far from the point.
But realised later that to do so i have to first run distance to node with cross product lacing.

Currently I am using point inside bbox which gives the most faster results among the options i have.

But this node still runs with cross product,since I couldn’t find any better idea i was looking for options for allocating resource
I have learnt sometime back that GPU can perform faster at small calculations that the CPU as the number of cores is large ,so i wanted to know if we have any way to allocate this task to GPU and pipeline it back to the main flow.?

One more question i have is that does dynamo make use of GPU for core computation or just to render the work canvas and such supporting stuffs? Well thats a question for another thread.!

Dynamo only uses the gpu for visualization. If you’d like to look into gpu compute, you’ll first need to pick a platform. If you’ve got an nvidia card, then you should try cuda because it’s more widely used. Otherwise your best bet is OpenCL. Each comes with its own syntax and wrappers for other languages.

The next problem is that there aren’t any open source geometry kernels that I know of, that use gpu compute, so you’ll probably have to write your own.

1 Like

Thats simply beyond my abilities and knowledge for now , thanks for the reply…!