|02 February 2013||#1|
Join Date: Feb 2013
Hey there-- I'm a rookie to MaxScript. I did a semester of programming a year ago but it's fair to say that I'm very new to that, too, and with this in mind I'd like a bit of help...
I've got a situation wherein I want to make a box, then make another box above it, convert them both to editable poly and attach one to the other, delete the adjacent faces and then weld those boxes together. I can do this by specifying the exact edges to weld together after deleting specific faces by name(because the edges on the bottom of the top box will always be edges 5 to 8, and the edges on top of the bottom box will always be edges 13 to 16 or something similar, and the bottom face of the box is always face 2, etc), so that works okay. I can then extrapolate from there to make it so I can run a for loop and continually stack and weld boxes together.
Firstly, this just feels messy, and secondly when you start attaching more geometry to the object the names (or rather, the numbers) attributed to edges and faces change-- so when you go to weld together edge 5 and 13, the edges that stick together are not the ones you were expecting. So is there a better way to select faces, i.e. a way to select only the topmost face, or the face on the top tier facing left, for instance?
Perhaps there's a kind of naming scheme that doesn't change for every new piece of geometry added?
|02 February 2013||#2|
Join Date: May 2006
Im sure there are other ways of doing this but this is the way that popped into my head when i read your post.
1st, Dont rely on vertex/faces numbering when doing mesh ops, this is because max may reorder them at its own will so when you get to box 17 the numbers may not be what you expect
I don't know of any data that holds the mesh faces independently of the naming seen in max`s UI
2nd, If you stack boxes the way you are talking about just use 1 box and when making the box taller add an extra division minus 1 for the box cap. ie the box is two units high make it have 1 division, 9 high, 8 divisions etc, will give you the same result with a lot less hassle providing you want a uniform distribution of divisions.
3. If you do need to to delete faces that are opposing you can check the face normals with
coupling this with a height check of the face canter will allow you to get the face facing in a particular direction at a certain height for you to extrude, and extruding would also give you the same result without attaching, AND extruding will allow you to have non-uniform distribution of divisions. There are scripts on the interweb to show how to find a face centre
hope that helps
|02 February 2013||#3|
Join Date: Aug 2011
To get a face's center, use -
From the reference -
Here's a way of getting faces that are between 1 and 5 in the z position -
Last edited by Ian31R : 02 February 2013 at 10:37 PM.
|02 February 2013||#5|
Join Date: Sep 2003
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.
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
|Thread Closed share thread|