Notifications
Clear all

[Closed] Grow face selection in loop or ring

Hi,

When I have 2 faces selected in an EditablePoly, how can I grow the selection with 1 face in loop or ring in maxscript?

I am searching and reading the help file but can’t find the right way to do just that.
Do I really have to code logics to go through all faces and do some trial and error?

Thanks,
Davy

7 Replies

I cannot provide code snippets, but here’s how you do it, assuming you’re working with quads, using polyOp:

  1. get edge that is shared by both selected faces
  2. on one or both faces (depending on if you want to grow in one or both direction) get the edge opposite to the shared edge. do that by finding the edge of the faces that does NOT share a vertex with the shared edges from step 1. OR the edges of a face are sorted so that 1 is opposite to 3, 2 is opposite to 4 etc.so you can use that knowledge, too
  3. each edge connects two faces, so add all faces of your collected edges to the face selection

that’s a quick and dirty solution – don’t quote me on it

…yes, no other other way than coding logics =)

Thanks for the layout of how to do it, gonna try that approach.

Davy

what might also work and require less mesh-fiddling is using the edge ring:

  1. convert faces selection to edge selection so that only fully enclosed (by selected faces) edges are selected
  2. grow edge ring as much as you want
  3. convert edge selection to faces

3dsmax has several functions to mess with edge loops/rings, so it might be easier than manually working with edges and faces.

1 Reply
(@akramparvez)
Joined: 11 months ago

Posts: 0

Here is harefort’s pseudo-code applied in maxscript. Select 2 adjacent faces and run the script:


(
	$.convertselection #Face #Edge
	_edges = (polyop.getEdgeSelection $) as array
	_faces = (polyop.getFaceSelection $) as array
	for i in _edges do 
	(
		if ((($.getEdgeFace i 1) == _faces[1] and ($.getEdgeFace i 2) == _faces[2]))
		then
		(
			polyop.setEdgeSelection $ i
			$.SelectEdgeRing()
			$.convertselection #Edge #Face
		)
	)
)

…yes true, although once you have 4 edges, growing does the same as when a face is selected.

What I want to do is grow ring or loop not both at the same time. So I do need to fiddle a bit by removing faces from the grow method to grow only in a ring or loop.

Davy

You may be able to skip the

if ((($.getEdgeFace i 1) == _faces[1] and ($.getEdgeFace i 2) == _faces[2]))

step if you set the requireAll: paramater to true in the first $.convertSelection.

…thank you!

Now I will write some extra lines for doing a specific selection on the selected ring or loop.

Davy