MXS How to get area of an object

Hey guys,

I was wondering how to get the area of an object. The obj.min obj.max will get us the bounding box size of the obj but not exact area. For eg:
if we have to get the actual volume of the sphere (diameter), how to go about it??

Thanks in advance

can i go about it like calculating the distance from the pivot to ( obj.max.x or .y or .z )^3pi(4/3) like in actual math or is there any inbuilt fn for it???

You can sum the face areas, check this snippet from Marco Brunneta:

FOR faceIndex = 1 to numFaces DO
(
objectArea = objectArea + (meshop.getFaceArea o.mesh faceIndex) --get the object’s full area by adding the faces
)

Taken from here: http://forums.cgsociety.org/showpost.php?p=5463676&postcount=7

Thanks alot Kameleon :slight_smile:

I have actually tried it before but it was not serving my purpose here. What I want to do is to fill up any selected objects with the number of cubes, the cubes not going out the the object.

Well, if you’re just trying to get that done instead of “how to do it” you have this: http://www.erensaritas.net/voxelator.html and you can probably do the same with pflow.

If you need the “how to” a quick search led me to this: https://code.google.com/p/block-creator/ but I haven’t tried it or tested.

IGNORE

Why can’t we delete posts?

Theodox, dint get it. IGNORE??

I started by posting a link to the marching cubes algorithm but then I re-read the OP and realized it was the inverse of what you really wanted (it’s for skinning a voxel cloud instead of turning a skinned mesh into voxels, which was basically what the original post was asking for).

When I realized the link was useless I went to delete it - but too late, vbulletin doesn’t believe in deleting (or at least I don’t know how)

This, OTOH, might be the approach you want:
http://blog.wolfire.com/2009/11/Triangle-mesh-voxelization

That link was cool Theodox. Thanks. :slight_smile:

Hey, dunno if this is what you wanted originally but I started to work on my own thing, this is a very good challenge! http://www.youcandoitvfx.com/voxel-grid-creator/

WOW…thats exactly what I was describing it like… fantastic work Kameleon. I was held up with other stuff and got some time to work on this. Have done the basic stuff with vol.select. need to create it like a proper tool like u did. :slight_smile:

And doing it thru vol.select modifier is faster than ray tracing i believe. think you have also used vol.select.

[QUOTE=Theodox;23512]IGNORE

Why can’t we delete posts?[/QUOTE]

Whoops, you can now :slight_smile:

No, I’m not using volume select, although I’ll have a look into it and check if the results are better (meaning, faster)!

Edit: Gave it a quick try… but seems very very slow!

Oh yeah. It’s too slow. Can you give me a tip of how to go about it ? can you share the script if possible? It wud be a great help for me to learn

Well, I’m thinking about going commercial with this script, but you can definitely use the one I posted before (I’ve been using it to compare times with mine) https://code.google.com/p/block-creator/

If that’s what you’re looking for, I think you don’t need to look further, it works well and it’s a great foundation for you to learn.

Oh… thats gr8. Hope you make good amount of money. :slight_smile: will chk ou the link. Thanks Kameleon

You’re welcome! I’m sure I won’t get rich, but it’s good to get some money back from the time invested :slight_smile: Anyway, I’ll be sure to send you over a copy of what I have as soon as it’s stable :slight_smile: Good luck and keep posting if you have any doubts, I already learned a lot from your questions.

I’ve reached a point where I can call this a product, so here it’s: http://www.youcandoitvfx.com/tools/voxel-creator/

KiTechie, please send me your e-mail so I can send you a copy of this :slight_smile: