ScriptSpot

Forum topic · Scripts Wanted

Remove Spikes in Mesh. Select by longest edge?

By jininjin · 2013-06-16

Description

I haven't found anything on Scriptspot that you can select by edge length. I am trying to delete large spikes in a mesh that were generated from an autoretopo. I think the easiest way is to select long edges based on a threshold. Anyway to do this? I found one by Bobo but the link is dead.....

Comments (5)

miauu · 2013-06-18

Select some faces and run the script. It will remove all non quads from the selection, so only quad faces will remains selected.


(
	if selection.count == 1 and classof (curO = selection[1]) == Editable_Poly then
	(
		local selFacesBA = polyop.getFaceSelection curO
		local poGetFaceDeg = polyop.getFaceDeg
		polyop.setFaceSelection curO (for f in selFacesBA where (poGetFaceDeg curO f) == 4 collect f)
		redrawViews()
	)
	else
		messagebox "Select only one Editable Poly object" title:"Invalid Selection"
)

This will remove all quads from the selection, so only the non quads will remains selected:


(
	if selection.count == 1 and classof (curO = selection[1]) == Editable_Poly then
	(
		local selFacesBA = polyop.getFaceSelection curO
		local poGetFaceDeg = polyop.getFaceDeg
		polyop.setFaceSelection curO (for f in selFacesBA where (poGetFaceDeg curO f) != 4 collect f)
		redrawViews()
	)
	else
		messagebox "Select only one Editable Poly object" title:"Invalid Selection"
)

jininjin · 2013-06-18

Thanks again Miauu. This helps alot.

jininjin · 2013-06-18

Thanks Miauu. This is exactly what I was looking for. Now I just need subtract quads from the selection and I should be good to go.

miauu · 2013-06-18

You wants a script that will get selected faces and will remove the quad polygons from the selection, so at the end only tris and n-gons will remains selcted?
I can write this script, but will do it tonight.
Someone else can do it earlier. :)