Anim8or Community

Please login or register.

Login with username, password and session length
Advanced search  

News:

Ian Ross has just released a book on Anim8or. It's perect for a beginner and a good reference for experienced users. It contains detailed chapters on every aspect, with many examples. Get your own copy here: "Anim8or Tutorial Book"

Pages: [1] 2

Author Topic: Script Request: untriangulate faces  (Read 31881 times)

neirao

  • Sr. Member
  • ****
  • Posts: 624
  • Neirao
    • View Profile
Script Request: untriangulate faces
« on: August 15, 2008, 11: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.. ;)

thanks All! :D

Neirão - Brazil
« Last Edit: August 15, 2008, 12:09:26 pm by neirao »
Logged

Kubajzz

  • Flying Platypus
  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 548
  • Little doggie ate my avatar...
    • View Profile
Re: Script Request: untriangulate faces
« Reply #1 on: August 16, 2008, 03:08:20 pm »

Hi Neirao,
I've heard about somebody trying to make that script before, but I guess he was not succesfull ??? 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: 624
  • Neirao
    • View Profile
Re: Script Request: untriangulate faces
« Reply #2 on: August 17, 2008, 09:23:23 pm »

Thanks Kubajzz,

your script is excellent!

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

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


Neirao - Brazil


Logged

NickE

  • Full Member
  • ***
  • Posts: 167
    • View Profile
Re: Script Request: untriangulate faces
« Reply #3 on: September 15, 2008, 10: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
Re: Script Request: untriangulate faces
« Reply #4 on: September 16, 2008, 01: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 :)
Logged

Kubajzz

  • Flying Platypus
  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 548
  • Little doggie ate my avatar...
    • View Profile
Re: Script Request: untriangulate faces
« Reply #5 on: September 16, 2008, 03: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: [Select]
if ($shape.GetKind() == SHAPE_KIND_MESH)    -->    if ($shape.GetKind() == SHAPE_KIND_MESH && $shape.Selected)
Logged

NickE

  • Full Member
  • ***
  • Posts: 167
    • View Profile
Re: Script Request: untriangulate faces
« Reply #6 on: September 16, 2008, 10: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: 624
  • Neirao
    • View Profile
Re: Script Request: untriangulate faces
« Reply #7 on: September 16, 2008, 11:40:32 am »

Perfect!! :D

congratulations..!!!! :o

neirão Brazil..
Logged

Kubajzz

  • Flying Platypus
  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 548
  • Little doggie ate my avatar...
    • View Profile
Re: Script Request: untriangulate faces
« Reply #8 on: September 17, 2008, 04: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: 600
    • View Profile
    • Headwax's Website
Re: Script Request: untriangulate faces
« Reply #9 on: September 18, 2008, 11:43:12 pm »

thanks nicke  well done. :)
Logged

NickE

  • Full Member
  • ***
  • Posts: 167
    • View Profile
Re: Script Request: untriangulate faces
« Reply #10 on: September 20, 2008, 09: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: 95
    • View Profile
Re: Script Request: untriangulate faces
« Reply #11 on: February 04, 2009, 06:06:29 am »

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

any ideas?
Logged

Tanzim

  • Guest
Re: Script Request: untriangulate faces
« Reply #12 on: February 05, 2009, 03: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: 95
    • View Profile
Re: Script Request: untriangulate faces
« Reply #13 on: February 05, 2009, 07:04:55 am »

too many faces was the problem....after manually untriangulating some faces the script worked
Logged

captaindrewi

  • Sr. Member
  • ****
  • Posts: 490
  • errm...errr?
    • View Profile
Re: Script Request: untriangulate faces
« Reply #14 on: February 06, 2009, 05: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
!
Pages: [1] 2