2 Replies
      Latest reply on Aug 10, 2019 1:22 PM by not-Ian
      not-Ian Level 1 Level 1 (0 points)

        As title says, I have a point cloud gathered from ARKit depth data and I want to 1. Create a mesh, then 2. Calculate the mesh's volume


        I looked into QHull briefly, but the only Swift implemention I found of it was 4 year old, unmaintained code, and it wasn't written straight forward enough for me to feel comfortable using it - I might take another look in the meantime.


        Another thing I tried was Python interoperability and one of the python packages which does this like Scipy, but Python interoperability isn't yet available for iOS.


        I need to show this app to stakeholders in ~2 weeks, and I have a few other things I need to get done besides this.


        Any other ideas? I'm trying to come up with an algorithm but I think this is just a very hard problem. I'm leading towards doing this in the cloud temporarily. I don't think stakeholders will be happy that everything isn't happening on the device, but it might be a saving grace while I find a better solution.


        Also I should note: the real problem here is creating the triangulated mesh, once you have that it's easy to get a mesh's volume



        • Re: Create triangulated mesh and calculate volume from ARKit point cloud?
          Claude31 Level 8 Level 8 (7,795 points)

          I also think it is a very hard problem. In addition, if the mesh is made from disjoint objects, what will volume mean ?


          But thus not the right forum: would be better in an AR section.

          A 4 year old implementation, if it is just the algorithm, should not be a big problem. But integrating everything and testing your code to deliver in 2 weeks will be a challenge!

            • Re: Create triangulated mesh and calculate volume from ARKit point cloud?
              not-Ian Level 1 Level 1 (0 points)

              With regard to your question about disjoint objects, I have groups of objects I'm scanning which are all of a small size, and I have a separate list of SCNVector3 for each object. I'm getting the volume for each object individually.


              My solution as of now is to use an AWSLambda - I send up a JSON array of my 3D points, calculate the volume in 3-4 lines of python code, then return an Int. I'm mostly happy with this solution - it's very performant for the number of 3D points I'm doing, and setting up AWS in the app wasn't too much of a headache.