Giter VIP home page Giter VIP logo

Comments (2)

leomariga avatar leomariga commented on July 2, 2024

Hi Fabian, nice to hear you are trying new things in pyRANSAC3D library =)

Restricting the volume from a cuboid seems to be a simple mathematical problem, but for most cases it isn't. Your solution as you presented above will only work if the faces of the cuboid are perfectly aligned to the inertial frame (the length of the cuboid is in the X axis, for example). If this condition is not met, you will measure a 3d kind-of-diagonal of the cuboid which will definitely give you the wrong volume.

The problem you are facing can be solved with minimum bounded rectangle (MBR) (https://en.wikipedia.org/wiki/Minimum_bounding_rectangle) algorithm or, in your case, minimum volume cuboid. A possible way to solve is to make a projection of the points with the candidate plane equation, and transform this in a 2d problem which can apply a MBR algorithm to calculate the width and height of a rectangle. Using the three different dimensions from this algorithm you can calculate its approximate volume.

There might be other solutions such as working with the face's equation to rotate the cuboid to the inertial frame but it seems to be more complicated. I recomend the MBR algorithm by dbworth to start with:

https://github.com/dbworth/minimum-area-bounding-rectangle

from pyransac-3d.

FabianSchuetze avatar FabianSchuetze commented on July 2, 2024

Thanks, Leonardo for your kind and informative reply! Your explanation for why specifying volumes is not that straightforward makes a lot of sense. I am trying to look a bit more into the MBR and also into other possibilities.

from pyransac-3d.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.