select connecting faces by angle

I have found a few scripts that select polys by a given angle but what I really need is to pick connecting polys only from a select polygon, if there are no more polys that are adajecent (connected) to these polys then ingore other polys on the mesh.

example: I have a plane at z height of 0 with an inner bounding wall of z height of 5 and on the other side of the wall a z height height of 0 again (all this is one mesh). If I select an inner ground poly I want it to select all the connecting polys up to the tolerance of a certain angle (in this case anything below 90 degress because of the bounding wall). Once the poly selection is broken, the tolerence is not met, all other polys will be ignored. Hence only the inner polys would be selected.

I guess the script would have to take into account the face normal and work out the angle tolerence based on this?

Does anyone know of a script available that does such a thing or without being too cheeky if anyone fancies a "quick?" challenge?

Anyone help would be most appreciated.

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
titane357's picture

Thanks miauu, very helpfull

Thanks miauu, very helpfull !!!!
Just one thing : a value of zero don't give any result, need at last 0.001
:-)

miauu's picture

.

This is beacuse MAX have problems comparing float values. To test:

- open Maxscript listener

- type acos 1 and press Numpad enter

- in the next line will be printed 0.0

- now type this on the right side of 0.0  < 0.0 and press numpad enter

The result is FALSE, because acos 1 is not exactly 0, but, may be, 0.0000001

:)

 

titane357's picture

thanks.

thanks.

j_forrester's picture

I have selected 5 areas that

I have selected 5 areas that potentially be an outcome of running such a script.
So if one polygon was selected in any of the selected areas then this group of polygons would be selected.

Really when it hits a polygon out of tolerence stop selecting. Although i'm not sure if this is possible as you say you cannot measure the angle betwwen two polygons.

I'm hoping this is all makes sense.

AttachmentSize
mockup_test_file.max 636 KB
miauu's picture

.

Try the attached script.

I was meaning that you can't measeure tghe angles between the face's normals. The script can. You can select more than one polygon in different areas - the script will do the rest.

AttachmentSize
selectconnectedneighborfacesbyanglethreshold.ms 1.54 KB
potomek's picture

Thanks a lot !

Thanks a lot !

j_forrester's picture

Miauu, Thank you very much!

Miauu,

Thank you very much! That works perfectly!

Very much appreciated.

miauu's picture

.

There is one selected polygon. Can you show an image or upload another scene where the polygons, that the script have to select are visible/selected. Since you can't measure the degree between polygons - just make a sample selection.

j_forrester's picture

Thanks miauu, I have attached

Thanks miauu,

I have attached a test file as requested. I have thought that it would need to check for new connecting polygons based on the previous connected ploygon and not just the first selected polygons normal.

So if the first selected polygons connecting faces are say less that 10 degrees select these. Then based on the outter selected polygons (latest selected), if there connecting polygons are less than 10 degrees select these until the it reaches a point where these is no longer the case.

Hope this makes sense, although i'm starting to think it's not all that stright forward!

Thanks again for looking into this.

AttachmentSize
mockup_test_file.max 632 KB
miauu's picture

.

Upload a test scene.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.