Anim8or Community

Please login or register.

Login with username, password and session length
Advanced search  

News:

An update to Anim8or, v1.00b, is available with a few bug fixes. Get your copy HERE. See the "ReadMe" file for details.

Author Topic: Measuring objects  (Read 3001 times)

AlecJames

  • Jr. Member
  • **
  • Posts: 87
    • View Profile
Measuring objects
« on: February 27, 2014, 04:51:15 pm »

Has anyone ever requested a measure distance facility in at least object mode?  I quite often want to sketch things to scale.  When I want to measure the length of a mesh I draw a cylinder from A to B and then open its properties to see the length.  Or is there already a quick trick for measuring objects?

Thanks
A
Logged

Raxx

  • Administrator
  • Hero Member
  • *****
  • Posts: 1446
    • View Profile
Re: Measuring objects
« Reply #1 on: February 27, 2014, 05:29:33 pm »

Sounds like you want the bounding box dimensions. I whipped up a quick script attached (updated in post further down). You can limit the output to whatever shapes you have selected. Accessible from the Scripts menu when installed in your scripts directory, and prints it in the console window.

Only works on mesh objects (not things like splines).

If you want to just measure the distance between two points (not connected by an edge), you can try the Two Point Distance script.

[edit]I realized that you could want either the relative dimensions (stays the same regardless of rotation), or the absolute dimensions (as if locked in to the world coordinates). Both types are attached.
« Last Edit: March 01, 2014, 12:51:52 am by Raxx »
Logged

AlecJames

  • Jr. Member
  • **
  • Posts: 87
    • View Profile
Re: Measuring objects
« Reply #2 on: February 28, 2014, 12:19:19 am »

Thanks Raxx I'll try with your scripts.
A
Logged

Water Music

  • Jr. Member
  • **
  • Posts: 86
    • View Profile
Re: Measuring objects
« Reply #3 on: February 28, 2014, 01:27:17 am »

Also, while I don't think he's mentioned it, with one of the current releases Steve has included edge length in the edge properties properties box. Thank you for that Steve, by the by. Very useful.
Logged

AlecJames

  • Jr. Member
  • **
  • Posts: 87
    • View Profile
Re: Measuring objects
« Reply #4 on: February 28, 2014, 09:32:23 pm »

Hi Raxx

Tried the scripts.  Local gives me 'strange' results.  If I draw a cylinder under my mesh with the same width as the mesh (front view width is x) and run the script it shows different results for the x dimension of the mesh and the cylinder.  I think that I have rotated the mesh at some point and the local script gets the dimension from the original orientation. 
So I switched to the absolute script.
This got me closer to a result but my object that I am trying to measure consists of three meshes so I'd have to add the results together.  I moved
                            $maxx = 0;
      $maxy = 0;
      $maxz = 0;
      $minx = 0;
      $miny = 0;
      $minz = 0;
out of the loop so that the bounding box would contain all the selected meshes.  The output now shows the size of the bounding box increasing as the shapes are consumed:

 "mesh01" -> 49.826 x 95.323 x 81.620
 "mesh02" -> 99.652 x 95.323 x 81.620               Is located to the right of mesh01
 "cylinder01" -> 113.936 x 95.323 x 100.991        Protrudes to the right of mesh02
 "cylinder02" -> 122.219 x 95.323 x 119.994        Protrudes to the right of cylinder01

(Print result statement $shape.name should be $shapes[$i].name in both scripts as all shapes were reporting the same name.)

Thanks for your help with this, I would never have got that far without your scripts as a starting point. 
A
Logged

Steve

  • Administrator
  • Hero Member
  • *****
  • Posts: 1523
    • View Profile
Re: Measuring objects
« Reply #5 on: February 28, 2014, 10:51:31 pm »

One of the upcoming features for Anim8or is a simple CAD mode. I haven't finished the design but it is a setting that you enable to show object dimensions on the screen, labels on the grid, perhaps some form of units, thing like that. It's too buggy to demonstrate yet, but stay tuned.
Logged

AlecJames

  • Jr. Member
  • **
  • Posts: 87
    • View Profile
Re: Measuring objects
« Reply #6 on: February 28, 2014, 11:28:54 pm »

That would be perfect. :)
Thanks for all the effort you put into Anim8or.
A
Logged

Raxx

  • Administrator
  • Hero Member
  • *****
  • Posts: 1446
    • View Profile
Re: Measuring objects
« Reply #7 on: March 01, 2014, 12:50:42 am »

Whoops, silly me. I tacked on that "name" thing at the last second, wasn't thinking straight when I implemented it. Haste makes waste ::)

Now, the local script is doing exactly what it should. For a cylinder parametric shape, "up" is in the direction of the end cap. So when you create it horizontal, and run the local script, it's still going to show it as if you went to Edit->Rotate->Rotate None.

I updated the scripts, attached below. I also included a feature in the absolute script that adds all the dimensions of the shapes together and outputs them at the end, and fixed an inherit problem with initializing the min and max to 0 instead of the first point value.
Logged

Water Music

  • Jr. Member
  • **
  • Posts: 86
    • View Profile
Re: Measuring objects
« Reply #8 on: March 01, 2014, 01:13:55 am »

Being able to change units would be awesome. Even just being able to set precise scaling would help with large backdrops (model small, re-size large).

Of course, volume displays would also be useful (if I'm using Anim8or to plan a custom sword hilt or something it would be nice to get a prediction of weight), but the math for that gets pretty scary so I personally wouldn't bother.
Logged

cooldude234

  • Sr. Member
  • ****
  • Posts: 901
  • You know what I realized, I dont have an avatar :\
    • View Profile
Re: Measuring objects
« Reply #9 on: March 01, 2014, 07:26:39 pm »

One of the upcoming features for Anim8or is a simple CAD mode. I haven't finished the design but it is a setting that you enable to show object dimensions on the screen, labels on the grid, perhaps some form of units, thing like that. It's too buggy to demonstrate yet, but stay tuned.
YEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEESSSSSSSSSSSSSSSSSSSSSSSSSSSSS!!!!!!!!!!!!!! (<- not very subtle is it :P)
Logged

ronaldefarmer

  • Sr. Member
  • ****
  • Posts: 293
    • View Profile
    • Ron's Website
Re: Measuring objects
« Reply #10 on: March 01, 2014, 11:56:29 pm »

I don't know much about CAD in general, but an architectural modeling program that I use for work allows the user to input  construction lines using dimensions and the arrow keys. Something like that in Anim8or would be nice.

Ron
Logged

cooldude234

  • Sr. Member
  • ****
  • Posts: 901
  • You know what I realized, I dont have an avatar :\
    • View Profile
Re: Measuring objects
« Reply #11 on: March 02, 2014, 01:30:57 am »

I don't know much about CAD in general, but an architectural modeling program that I use for work allows the user to input  construction lines using dimensions and the arrow keys. Something like that in Anim8or would be nice.

Ron
^pretty much what cad is (but with more math)
Logged