SDK TestClipping3D Python example wrong
-
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)
-
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.