Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    Primitive Bounding Box

    Scheduled Pinned Locked Moved PYTHON Development
    3 Posts 0 Posters 502 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H Offline
      Helper
      last edited by

      On 03/12/2017 at 18:02, xxxxxxxx wrote:

      Is it possible to get information about Bounding Box of a primitive object?
      In the documentation, I found information about a radius of object's bounding box.

      1 Reply Last reply Reply Quote 0
      • H Offline
        Helper
        last edited by

        On 04/12/2017 at 01:26, xxxxxxxx wrote:

        What informations you need?
        Actually you get all informations needed
        Through BaseObject.GetMp() and BaseObject.GetRad()
        Here is the bouding box size (remember we are in local space) simply do

        mp = op.GetMp()
        rad = op.GetRad()
        mg = op.GetMg()
          
        xMax = mp.x + rad.x
        yMax = mp.y + rad.y
        zMax = mp.z + rad.z
        xMin = mp.x - rad.x
        yMin = mp.y - rad.y
        zMin = mp.z - rad.z
          
        # Just an exemple to get in worldspace
        zMinWorldSpace = (mp.z - rad.z) * mg
        
        1 Reply Last reply Reply Quote 0
        • H Offline
          Helper
          last edited by

          On 04/12/2017 at 02:25, xxxxxxxx wrote:

          Hi,

          the function's name BaseObject.GetRad() may be a bit misleading, but it's exactly what you are looking for. GetRad() returns a vector, defining the size of the bounding box in each direction around the center. BaseObject.GetMp() returns the center of the bounding box.

          1 Reply Last reply Reply Quote 0
          • First post
            Last post