Box extrude direction

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Search this Thread Display Modes
  07 July 2013
How to change a Box width direction ?

Hey, guys!

I have to build an object from several boxes with the help of maxscript and I have a problem.

I need to align a box in a fixed point and modify it ( to change the thickness ) in only one direction.
As you know, 3ds max change the size boxes from middle, in two directions.

It is possible to change a box size in only one direction?

I attached a picture - in top view ( see here ).



Thanks, miauu! You are right, is not about extrude here (was just only in my mind) - i edit the post.

I try your solution, but is not what i want, or maybe I don't understood what you said.
I don't want to scale the box, just to change the size direction.
I change the picture too, now maybe is not so confused.

Last edited by versusfx : 07 July 2013 at 09:22 AM. Reason: Now it is more expressly
  07 July 2013
What is shown in the image is not extrude, but is how max changes the box width/length/height.
If you don't want to convert the box to editable poly/mesh object try with this:
	delete $*
	b = box width:100 height:100 length:100 isSelected:true
	--	set the pivot to the point from where you want to start to "extrude"
	b.pivot = b.min
	--	this will "extrude" along X, Y and Z
	b.scale.x *= 2
	b.scale.y *= 3
	b.scale.z *= 4
  07 July 2013
If you are working with Box primitives, then this little script may help you. Be aware that it will align the pivot point to the node.
try (destroyDialog RO_BOX_SIZE) catch()
rollout RO_BOX_SIZE "Change Box Size" width:200 height:104
	GroupBox grp1 "Box Size Offset:" pos:[8,8] width:136 height:92
	spinner spn_l "Length:" pos:[16,28] width:120 height:16 range:[-1E+010,1E+010,0] scale:0.1 fieldwidth:72
	spinner spn_w "Width:"  pos:[16,52] width:120 height:16 range:[-1E+010,1E+010,0] scale:0.1 fieldwidth:72
	spinner spn_h "Heigth:" pos:[16,76] width:120 height:16 range:[-1E+010,1E+010,0] scale:0.1 fieldwidth:72
	label lbl_l "" pos:[150,28] width:44 height:16
	label lbl_w "" pos:[150,52] width:44 height:16
	label lbl_h "" pos:[150,76] width:44 height:16
	local oldwidth
	local oldheigth
	local oldlength
	local oldpos
	fn update dir arg = if (classof $ == Box) do (
		case dir of
				$.width = amax #((abs arg)-oldwidth, oldwidth+arg)
				$.objectOffsetPos.x = oldpos.x + arg*0.5
				lbl_w.text = $.width as string
				$.length = amax #((abs arg)-oldlength, oldlength+arg)
				$.objectOffsetPos.y = oldpos.y + arg*0.5
				lbl_l.text = $.length as string
				$.height = oldheigth+arg
				lbl_h.text = $.height as string
	fn getParams = (
		if (classof $ == Box) then (
			AlignPivot $
			oldwidth  = $.width
			oldlength = $.length			
			oldheigth = $.height
			oldpos	= $.objectOffsetPos
			print "Node is not a Box primitive!"
			lbl_w.text = ""
			lbl_l.text = ""
			lbl_h.text = ""
	fn resetSpinners = (
		spn_w.value = 0.0
		spn_l.value = 0.0
		spn_h.value = 0.0
	on spn_w buttondown do getParams()
	on spn_w buttonup arg do resetSpinners()

	on spn_l buttondown do getParams()
	on spn_l buttonup arg do resetSpinners()
	on spn_h buttondown do getParams()
	on spn_h buttonup arg do resetSpinners()

	on spn_w entered do (
		update 1 spn_w.value
	on spn_l entered do (
		update 2 spn_l.value
	on spn_h entered do (
		update 3 spn_h.value
	on spn_w changed arg inSpin do if inSpin do update 1 arg
	on spn_l changed arg inSpin do if inSpin do update 2 arg
	on spn_h changed arg inSpin do if inSpin do update 3 arg

createDialog RO_BOX_SIZE

Last edited by PolyTools3D : 07 July 2013 at 04:27 AM. Reason: bugs fixed
  07 July 2013
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
Thread Closed share thread

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Society of Digital Artists

Powered by vBulletin
Copyright ©2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 04:12 PM.

Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.