Notifications
Clear all

[Closed] selecting flipped faces

I have tons of meshes with flipped faces and I have problem to detect – select this faces in order to flip it.
In spite of many threats about this there is nothing working.
I found script which select all faces not faced to camera but I have to select only flipped faces. Using unify don`t help because some of objects are editpoly. Xview also not help it’s hard to explain but in a word it indicate 25% selected objects has flipped faces which is incorrect in my situation.

Is there any way to detect flipped faces?

6 Replies

are the meshes continuous ie no open edges ?

I attached file, This is one of models, first frame illustrate faces I have to reach, second what xview show. Models are different but situation is always this same, x view show me all bunch of faces but not exactly flipped. I would be thankful for any clue with this. Thanks.

that doesn’t answer the question.

whats wrong with something quick and dirty like?

for i in $selection do
 (
 	ispoly = classof i == Editable_Poly;
 	converttoMesh i
 	meshOp.unifyNormals  i #all
 	if ispoly then converttoPoly i
 )

Thanks for code but I already write smimilar function yesterday when I noticed it’s limited to only edit mesh.

3 things.
1 – there are various meshes, usually there is no open edges.
2 – when you use your code on editable_poly it broke polygones
3 – i want also detect if mesh/polygones are flipped – for my toll which make mesh override.

fn getPolysUsingTri node tri mesh: = if iskindof node editable_poly do 
(
	if mesh == unsupplied do mesh = snapshotasmesh node
	pp = meshop.getpolysusingface mesh tri
	vv = meshop.getvertsusingface mesh pp
	ff = polyop.getfacesusingvert node vv
	ff - polyop.getfacesusingvert node (polyop.getvertsusingface node ff - vv)
)
fn findFlippedTri mesh =
(
	nn = for f=1 to mesh.numfaces collect getfacenormal mesh f
	meshop.unifynormals mesh #all
	ff = #{}
	for f=1 to mesh.numfaces where dot (getfacenormal mesh f) nn[f] < 0 do append ff f
	ff
)
fn findFlippedFaces node = if iskindof node editable_poly do 
(
	mesh = snapshotasmesh node
	tt = findFlippedTri mesh
	ff = #{}
	for t in tt do join ff (getPolysUsingTri node t mesh:mesh)
	ff
)
/*
findFlippedFaces $ -- where $ single selected editable poly
*/

it works. i am leaving the code not optimized to be clearer for understanding.
(and to give you a chance to practice in mxs code optimization :))

edited… for resolving some situations (when non-flipped face fully edged by only flipped)