Mapping a solid model into a 3D array

Anonymous

Mapping a solid model into a 3D array

Anonymous
Not applicable

Problem:

  • I am trying to implement a path-finding algorithm capable of traversing space within a solid model. 
    In order to do this I first need to define the space that the algorithm would traverse. I was thinking of representing this space as a weighted 3D array/matrix. "Weighted" means that every coordinate has a certain "value" that would allow the algorithm to discriminate between good and bad moves. 

Idea: 

  1. Somehow getting the greatest and smallest X, Y, and Z coordinates in use. With "in use" I mean that the coordinate forms part of the model. These values would be used to define the dimensions of the 3D array/matrix. 
  2. Traversing the model millimeter by millimeter and accessing the "contents" of each coordinate. In other words, I want to be able to identify if the coordinate is empty space or part of the solid model. This would allow me to determine if the coordinate can be traversed by the algorithm. Moreover, with this information I can determine the weight of the coordinate in the 3d array/matrix. 

Approach: 

  • I know sketches in a construction plane can be traversed millimeter by millimeter. I have used this to map the contents of a construction plane into a 2d array/matrix. This is where the nature of my solution comes from.  

 


I apologize in advance for the ambiguity of my idea, I can clarify any ambiguities if necessary. I am also very new to Fusion 360s API and Fusion 360 in general, so I apologize if the answer is trivial. 


Summary: Is there a way to map a Fusion 360 model into a 3D array/matrix through the API? 

 

0 Likes
Reply
903 Views
4 Replies
Replies (4)

goyals
Autodesk
Autodesk

If I understood the problem well then there is already a property BoundingBox on body that should server the same purpose.



Shyam Goyal
Sr. Software Dev. Manager
0 Likes

Anonymous
Not applicable

Thank you so much, I'm currently reading into it, it is exactly what I needed for the initial mapping portion of the project. After obtaining the dimensions, is there a way of knowing the contents of each coordinate? 
For example, knowing that the point (40, 30, 10) is empty space whereas point (55, 60, 3) is part of a solid model.

0 Likes

BrianEkins
Mentor
Mentor

You can use the BRepBody.pointContainment method to find out if any point is inside, outside, or on the body.

---------------------------------------------------------------
Brian Ekins
Inventor and Fusion 360 API Expert
Website/Blog: https://EkinsSolutions.com
0 Likes

goyals
Autodesk
Autodesk

BoundingBox3D also have a method,'contains', to verify whether an input point is part of it or not.



Shyam Goyal
Sr. Software Dev. Manager
0 Likes