1
$\begingroup$

I am using dimensions to get the bounding box dimensions of the object.

me_ob = bpy.data.objects['myobj']
cor = me_ob.dimensions

When i construct a cube with those dimensions, the cube appears to be shifted along the z & y axis. It is good along the x axis.

I am creating the cube from blender wiki

The script and the visualization. See the shift in the two bounding boxes

At first i thought that it be be because of the arbitrary shape than the cube or a cuboid. For cube and cuboid, the center can be found out by dividing the sides into two. but for a arbitary shape it will not always be half. To validate it, i shifted the cube manually. It fits perfectly after this.

enter image description here

Why do we remove the shift ?

$\endgroup$
  • 2
    $\begingroup$ Hi. Please include any relevant code in the question itself as text instead of in an image. $\endgroup$ – Ray Mairlot Feb 22 '17 at 11:13
  • $\begingroup$ I was trying to add a link to the blender wiki but i was not allowed. Check this link.. wiki.blender.org/index.php/Dev:Py/Scraipts/Cookbook/… $\endgroup$ – Sundeep joshi Feb 22 '17 at 14:55
  • 2
    $\begingroup$ There is an error in the url it says 'Scraipts' instead of 'Scripts'. Nevertheless, please take the code you have in the text editor and paste the relevant parts into your question. It makes it easier for people to answer your question if they immediately have access to the code you are using and don't have to type it up from an image or go to a url. $\endgroup$ – Ray Mairlot Feb 22 '17 at 15:25
1
$\begingroup$

Create a cube at the origin point position of the object you took dimensions from. That should help to resolve your issue.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.