BoundingBox

Next
 From:  Barry-H
7881.1 
Hi Michael,
shown are the dimensions of the bounding box of a control point curve.
One set works on the control points the other on the curve which your
edit sizes show.
Karsten was kind enough to create a node for me that outputs the dimensions
based on the control points that I can use within Max's Node Editor.
I would like to work with the bounding box based on the curve as per your
edit sizes and I do this by rebuilding the curve but there is still a small difference.
So if possible can you tell me what I need to alter in the code to get the edit sizes.

Thanks
Barry.


Attachments:

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
7881.2 In reply to 7881.1 
Hi Barry, sorry it's not entirely clear to me what you're asking for there.

Do you want a way for a script to obtain the "tight bounding box" that hugs the curve rather than going around it's control points?

Or is it that you want to do the same kind of editing task as the "Edit size" menu does?



For the first one, you can get a tight bounding box on an object by calling something like this:

var bbox = obj.getBoundingBox( true /*Parameter for "Use high accuracy bounds" */ )

Then on the bounding box you can call methods like this:

var xsize = bbox.xLength;
var ysize = bbox.yLength;
var zsize = bbox.zLength;



For the edit size menu, that one interfaces through a PropertiesPanel object. If you take a look at the file EditSizeMenu.htm you can see the code that gets values from the PropertiesPanel object like this:
code:
			function GetValues()
			{
				var pp = moi.ui.propertiesPanel;
				
				g_hasLength = pp.hasLength;
				g_hasRadius = pp.hasRadius;
				g_useDiameter = pp.useDiameter;
				g_length = pp.length;
				g_radius = pp.radius;
				g_box = pp.highAccuracyBoundingBox;
			}



Hope this helps!

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
 From:  Barry-H
7881.3 In reply to 7881.2 
Hi Michael.
thanks for answering so quickly. It's the first option
I want which is to work with a tight bounding box.
I will try the code you gave me.
Many thanks
Barry
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged
 

Reply to All Reply to All