Objects bounding box

Discussion in 'AutoCAD' started by bhl, Jul 16, 2004.

  1. bhl

    bhl Guest

    I am using an objects bounding box to place a figure in one of 4 corners.
    This works fine when object is rotated 90 degrees or 0 degrees.

    But how can find these cornes when object i rotated between 0 and 90?
    Can i still use bounding box or another method to calculated these 4
    corners?

    Birger
     
    bhl, Jul 16, 2004
    #1
  2. bhl

    antmjr Guest

    since "the corners are returned in WCS coordinates with the box edges parallel to the WCS X, Y, and Z axes" (from autocad help), you have to translate your figure (or a copy of it) to origin (0,0,0) with the main edge of your figure parallel to the wcs X axis

    in 3d you needs the transformation matrix associated with your figure/3dsolid, then you have to inverse it (i.e. to get the transpose matrix) and to apply it to your figure via .TransformBy; at this point the volume is translated and rotated to the right position for .GetBoundingBox;

    if you aren't able to calculate the transformationmatrix from scratch, you can set a new UCS on your figure and get the transformation matrix from it

    in 2d you can perform simple transformations via .move and .rotate in order to get your figure in the right position for .GetBoundingBox
     
    antmjr, Jul 16, 2004
    #2
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.