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

    SDK TestClipping3D Python example wrong

    Scheduled Pinned Locked Moved Bugs
    2 Posts 0 Posters 755 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 08/11/2017 at 14:43, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:    
      Platform:      
      Language(s) :       PYTHON  ;

      ---------
      Example provided in TestClipping3D is wrong (tuple don't have append command) and mp, rad and mg are not provided so it can be confusing for new learner.

      So maybe something like this?

          mp = op.GetMp()
          rad = op.GetRad()
          mg = op.GetMg()
        
          # This part is really needed in the example?
          p = list()
          p.append(c4d.Vector(mp.x + rad.x, mp.y + rad.y, mp.z + rad.z) * mg)
          p.append(c4d.Vector(mp.x + rad.x, mp.y + rad.y, mp.z - rad.z) * mg)
          p.append(c4d.Vector(mp.x + rad.x, mp.y - rad.y, mp.z + rad.z) * mg)
          p.append(c4d.Vector(mp.x + rad.x, mp.y - rad.y, mp.z - rad.z) * mg)
          p.append(c4d.Vector(mp.x - rad.x, mp.y + rad.y, mp.z + rad.z) * mg)
          p.append(c4d.Vector(mp.x - rad.x, mp.y + rad.y, mp.z - rad.z) * mg)
          p.append(c4d.Vector(mp.x - rad.x, mp.y - rad.y, mp.z + rad.z) * mg)
          p.append(c4d.Vector(mp.x - rad.x, mp.y - rad.y, mp.z - rad.z) * mg)
          
          result = bd.TestClipping3D(mp, rad, mg)
      
      1 Reply Last reply Reply Quote 0
      • H Offline
        Helper
        last edited by

        On 09/11/2017 at 09:13, xxxxxxxx wrote:

        Hi,

        Yes the documentation of BaseView.TestClipping3D() needs some fixes and improvements.
        Thanks for reporting the issues in the code snippet.

        The 8 points calculation in the code snippet is useful to show how the passed mp, rad and mg are used internally to build the bounding box.

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