Skip to content
  • Categories
Collapse
Solibri Society Forum
  1. Home
  2. General Discussion
  3. Wrong calculation about Quantities.Bounding box length/width

Wrong calculation about Quantities.Bounding box length/width

Scheduled Pinned Locked Moved Unsolved General Discussion
6 Posts 3 Posters 1.2k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    HieuVH-FPT
    wrote on last edited by
    #1

    Hi Solibrians,
    I just encountered a bug about Quantities.Bounding box calculations
    The property is shown 856mm as bounding box width and 2.096mm as bounding box length
    c2dba3e7-0455-421f-861f-a413c40a53d9-image.png
    But I used API getBoundingBox().getSizeY() and the code returned 0.876999 as value.
    API getBoundingBox().getSizeX() and the code returned 2.082 as value.
    23361b57-44a9-49f4-aaa5-cc60dd38a342-image.png
    024e4e17-f3ae-4fc7-aeac-a0ee240422ae-image.png
    Let me know if you need the model to investigate.
    Thanks

    1 Reply Last reply
    0
    • N Offline
      N Offline
      Nuno
      wrote on last edited by
      #2

      Hi,

      One thing that can affect quantities in Solibri is the Project Units. I think Solibri always takes the Metric System. I found some cases of other systems that would confuse Solibri.

      Regards

      Nuno

      1 Reply Last reply
      0
      • P Offline
        P Offline
        phuc.nguyen Solibrians
        wrote on last edited by
        #3

        Hi @HieuVH-FPT,

        Component.getBoundingBox() gives you an axis-aligned bounding box. This might be different from the Quantities Bounding Box, which is the “tight”, non axis-aligned bounding box of the component. You can still access these through the API using Component.getBoundingBoxWidth() and getBoundingBoxLength(). These should calculate the same Width and Length in the Quantities tab.

        Hope this helps

        1 Reply Last reply
        1
        • H Offline
          H Offline
          HieuVH-FPT
          wrote on last edited by HieuVH-FPT
          #4

          Hi @phuc-nguyen
          Isn’t non axis-aligned bounding box of the component same as Rectangle2d object?
          I have the Rectangle2d of the component
          image.png
          API getLongerSegmentLength() and getShorterSegmentLength() don’t return values same as properties
          a5ab6ac7-7125-406f-9470-f25a74566bc9-image.png
          e8d51b8d-0d43-48f2-a28c-999b5275e97d-image.png
          So Component.getBoundingBoxWidth() and getBoundingBoxLength() are not related to any geometry APIs?

          1 Reply Last reply
          0
          • P Offline
            P Offline
            phuc.nguyen Solibrians
            wrote on last edited by
            #5

            Yes, Component.getBoundingBoxWidth() and getBoundingBoxLength() are not implemented by the Geometry API, but by internal Solibri library. (Legacy reasons)

            Just to confirm about the Rectangle2d case, I notice that the numbers you show from getLongerRectangleSegmentLength() and getShorterRectangleSegmentLength() are equal (floating) to those from getBoundingBox().getSizeX() and Y(). I’m unclear about which Rectangle2d is being used, axis-aligned or footprint minimum bounding rectangle. Was it component.getFootprint().getArea().getMinimumBoundingRectangle()?

            1 Reply Last reply
            0
            • H Offline
              H Offline
              HieuVH-FPT
              wrote on last edited by
              #6

              @phuc-nguyen yes, it is component.getFootprint().getArea().getMinimumBoundingRectangle()
              Even if it is axis-aligned like getBoundingBox().getSizeX() and Y(), the values are not equal to Component.getBoundingBoxWidth() and getBoundingBoxLength()

              1 Reply Last reply
              0

              Copyright © 2025 Solibri Inc. | Powered by NodeBB

              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories