Notifications
Clear all

[Closed] mesh edge cleaner

basically I would like to figure out how to do this with a script:

take a mesh object (or more then one), check the angle between faces sharing at least one edge, make all the edges between faces with an angle close enough to 180 degrees (with an adjustable tolerance value) invisible.

just a tool to clean up imported meshes from other applications.

any suggestments are greatly appreciated.

Thank you,

4 Replies

Ciao Marcello,

Max will already do this for you! look in the MXS help for:

meshop.autoedge

Cheers,

Josh.

ok ok, try this:


[left]tol=10 -- the angle tolerence, change this as required[/left]
sel=selection as array -- the selection as an array (der!)
for s in sel do
(
if classof s==editable_mesh do
(
[left]edg=for i in s.edges collect i.index -- collect the objects edges into an array (is this necessary, seems more reliable!)[/left]
meshop.autoedge s edg tol -- perform the autoedge
update s -- update the mesh after autoedge
)
)

nb: untested!!!

Cheers,

Josh.

hi Josh,

thanks a lot for your reply. :bounce:
I will try that right now.

Best,

very strange: it does not work with my mesh… is there a limit in the number of faces for the target object?

Sotty, there is a typo in my code (now fixed!)

No there is no limit (except memory!). It will only work on an editable mesh and only on the baseobject, not on any modifiers so if you have an emesh modifier on top it probably wont work.

J.