Anim8or Community
May 21, 2013, 03:10:22 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: The v0.97d Preview is now available!  See the "Anim8or v0.97 Preview" Forum for details.
 
   Home   Help Search Login Register  
Pages: [1] 2
  Print  
Author Topic: Script Request: untriangulate faces  (Read 7568 times)
neirao
Sr. Member
****
Posts: 348


Neirao


View Profile
« on: August 15, 2008, 10:55:08 am »

Hello all,

some one can  maker this plugin?
untriangulate faces of mesh..for 3ds objects import..etc..



i think then if to change parameters of the "Remove useless points.a8s by Kubajzz" can work...

I use another application for make this..but be cool if Anim8or has this plugin script.. Wink

thanks All! Cheesy

Neirão - Brazil
« Last Edit: August 15, 2008, 11:09:26 am by neirao » Logged
Kubajzz
Flying Platypus
Global Moderator
Sr. Member
*****
Posts: 548


Little doggie ate my avatar...


View Profile
« Reply #1 on: August 16, 2008, 02:08:20 pm »

Hi Neirao,
I've heard about somebody trying to make that script before, but I guess he was not succesfull Huh It would be really nice to have that feature in Anim8or...
Unfortunately a script like this is much more complicated than "Remove Useless Points" script, it would take a while to write this one... I added it to my "TryIt" list, but I think this one is too difficult for me...
Logged
neirao
Sr. Member
****
Posts: 348


Neirao


View Profile
« Reply #2 on: August 17, 2008, 08:23:23 pm »

Thanks Kubajzz,

your script is excellent!

i´m work with others languagens of programation but i´m newbie in as8.. Smiley

possibly you or other member will obtain this too.
 
thanks  again. you are great!  Wink


Neirao - Brazil


Logged
NickE
Full Member
***
Posts: 103



View Profile
« Reply #3 on: September 15, 2008, 09:09:14 pm »

Attached is a script for untriangulating faces.

It uses a parameter called "tolerance" that should be added by Object->Attributes... Click the "new" button, type "tolerance" (case is important), select float, and put a suitably small value like 0.5 as the value.  The tolerance parameter is the measure of how "non-planar" the four points in the un-trianglulated face are.

The script creates a copy of the original mesh that is untriangulated.  On the console output, it will output a list of all the tolerances found in the mesh to help you select the correct value for your mesh.  If you select a tolerance that is too low, simply delete the created mesh copy, change the tolerance value by going to Objects->Attributes..., and re-run the script.  Or you can delete the original mesh, change the tolerance value and re-run the script.

The script is not perfect.  It often cannot determine the best adjacent face to combine with if the tolerance values are too high.  It is often necessary to use repeated applications of the script with ever increasing tolerance values.

Please let me know your feedback.
Logged
hihosilver
Global Moderator
Hero Member
*****
Posts: 1294


View Profile
« Reply #4 on: September 16, 2008, 12:55:39 am »

Awesome script NickE!
That looks like a great script.  I'm not sure it'll be the most useful for me, since I'm not often converting triangulated meshes to untriangulated since I haven't found a need yet, but that looks like a great addition to the Anim8or toolset Smiley
Logged
Kubajzz
Flying Platypus
Global Moderator
Sr. Member
*****
Posts: 548


Little doggie ate my avatar...


View Profile
« Reply #5 on: September 16, 2008, 02:29:04 am »

NickE, you rock! This script is really great, it works perfectly even with huge models!

I have only one minor suggestion - if there are more meshes in your object, the script will untriangulate one of them, but as far as I understand the code, it will choose the mesh to untriangulate no matter what user wants. It's really just a detail, but I think it would be better if it worked with a mesh selected by user. I personally would do this on line 79:
Code:
if ($shape.GetKind() == SHAPE_KIND_MESH)    -->    if ($shape.GetKind() == SHAPE_KIND_MESH && $shape.Selected)
Logged
NickE
Full Member
***
Posts: 103



View Profile
« Reply #6 on: September 16, 2008, 09:18:11 am »

Kubajzz,

Excellent suggestion!  I have made the change and have attached the updated script.

Add to the instructions posted earlier:
"Select the mesh you would like to untriangulate."
Logged
neirao
Sr. Member
****
Posts: 348


Neirao


View Profile
« Reply #7 on: September 16, 2008, 10:40:32 am »

Perfect!! Cheesy

congratulations..!!!! Shocked

neirão Brazil..
Logged
Kubajzz
Flying Platypus
Global Moderator
Sr. Member
*****
Posts: 548


Little doggie ate my avatar...


View Profile
« Reply #8 on: September 17, 2008, 03:27:01 am »

To make the toolbox kinda complete, here's a link to old triangulation plugin written by Claude:
http://www.anim8or.com/ubb/Forum6/HTML/000143.html
Logged
headwax
Sr. Member
****
Posts: 581



View Profile WWW
« Reply #9 on: September 18, 2008, 10:43:12 pm »

thanks nicke  well done. Smiley
Logged

NickE
Full Member
***
Posts: 103



View Profile
« Reply #10 on: September 20, 2008, 08:49:36 am »

Attached is an updated version of the script that fixed the issue that Kreator found where a model has no joined triangles.

Your feedback is appreciated!
Logged
benzjie
Jr. Member
**
Posts: 89


View Profile
« Reply #11 on: February 04, 2009, 05:06:29 am »

i am getting an error " error on line 155: index value out of bounds '$faceref[5]

any ideas?
Logged
Tanzim
Guest
« Reply #12 on: February 05, 2009, 02:49:15 am »

Try using the latest version of Anim8or (0.97)
If you already are, then I'm not so sure about the problem.
Logged
benzjie
Jr. Member
**
Posts: 89


View Profile
« Reply #13 on: February 05, 2009, 06:04:55 am »

too many faces was the problem....after manually untriangulating some faces the script worked
Logged
captaindrewi
Full Member
***
Posts: 159



View Profile WWW
« Reply #14 on: February 06, 2009, 04:57:51 am »

i have tried to untriangulate a mesh.but havent succeeded yet.
i get  this.
source points=7008
faces=12446, edges=19519.
analysing shape...Tolerance: 0.500

but cant see any new mesh anywhere
Logged

ANIM8OR...double click!
Pages: [1] 2
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!