How to extract points of areas for pathfinding algorithm

How to extract points of areas for pathfinding algorithm

Anonymous
Not applicable
2,363 Views
6 Replies
Message 1 of 7

How to extract points of areas for pathfinding algorithm

Anonymous
Not applicable

I  want to find shortest safefty path from any room to the exit in Revit.

 

Thus, I plan to divide areas (like rooms, exit, floor, doors) into two-dimensional grids to form vertex or nodes, so that I can apply them in pathfinding algorithm like A*.

 

I noticed that Revit has provided coordinates in floats number which cannot be used directly, though. Is there some similar functionality which can achieve my plan in Revit API?

 

If any of you have some tips for me, please help me.

 

Thank you.

0 Likes
Accepted solutions (1)
2,364 Views
6 Replies
Replies (6)
Message 2 of 7

jeremytammik
Autodesk
Autodesk

Here is a Revit add-in that prompts the user to select a model curve representing the optimal exit path:

 

http://thebuildingcoder.typepad.com/blog/2016/09/hololens-escape-path-waypoint-json-exporter.html

 

Do you know what a Voronoi diagram is?

 

It might help generate the optimal path automatically.

 

Check out Max Thumfart's sample using the C++ Boost library Voronoi implementation in a Revit add-in:

 

http://thebuildingcoder.typepad.com/blog/2015/07/grevit-firerating-in-the-cloud-demo-deployment-vaca...

 

I also was told that Adam Sheather presented an example of wrapping the A* algorithm in a Dynamo node at AU 2016; I don't see it in his material, though:

 

http://au.autodesk.com/au-online/classes-on-demand/class-catalog/classes/year-2016/dynamo-studio/sd2...

 

https://royalexander.wordpress.com/2009/07/07/new-version-a-pathfinding-in-3d/

 

Regarding tips about handling the Revit floating point coordinates: That is pretty trivial. I suggest that you convert them to millimetres, store those in integer numbers, and base your calculations on that. Then you can convert the results back to the Revit imperial coordinates when needed.

 

Cheers,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 3 of 7

jeremytammik
Autodesk
Autodesk

An update on the use of the A* algorithm for pathfinding in a Revit model:

 

Here is the link to the A* C# library code you can use:

 

 

You can use the geometry library in Dynamo or C# to check whether Revit elements intersect with the A* voxel space and use that to blank out that area.

 

With that in hand, you can specify a box and how many items you want to check against for the pathfinding.

 

Cheers,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 4 of 7

Anonymous
Not applicable

Thank you very much for your reply! The A* for 3D in C# is of great help in my furutre work.

 

I also found another simple path algorithm using dynamo which extract points in grid. And a Dynamo package called lunch box would find the shortest It will give much inspiration for the pathfinding algorithm.

 

https://revitbeyondbim.wordpress.com/2017/01/03/fire-exit-risk-assessment-with-revit-and-dynamo/

 

Terry

0 Likes
Message 5 of 7

jeremytammik
Autodesk
Autodesk

Dear Teryy,

 

Thank you for the link and glad to hear it is looking good.

 

I look forward very much to hearing how you end up implementing your solution.

 

Thank you!

 

Cheers,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes
Message 6 of 7

jeremytammik
Autodesk
Autodesk
Accepted solution

I summarised our discussion and added some extra notes here:

 

http://thebuildingcoder.typepad.com/blog/2017/06/finding-an-exit-path-and-elementid-parameter-values...

 

Cheers,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Message 7 of 7

boostyourbim
Advocate
Advocate

Hi,

 

Boost Your BIM, a software consulting firm, did a project called "Pathfinder" for Stantec that might be of interest. We presented it a BIMForum a few years ago and you can learn more about it at these links:

 

http://bimforum.org/wp-content/uploads/2014/04/OptimizingBuildingLayouttoMinimizeWalkingDistances-Ab...

http://bimforum.org/wp-content/uploads/2014/04/5-Boston-BIMForum-Optimizing-building-layout-to-minim...

http://www.globalpres.com/Mediasite/Play/084e3ac57c0848e5b3869db310db1afc1d

 

Regards

Harry Mattison

Owner, Boost Your BIM

0 Likes