Anim8or Community

Please login or register.

Login with username, password and session length
Advanced search  

News:

An update to Anim8or, v1.00b, is available with a few bug fixes. Get your copy HERE. See the "ReadMe" file for details.

Pages: [1] 2

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

neirao

  • Sr. Member
  • ****
  • Posts: 570
  • Neirao
    • View Profile
Script Request: untriangulate faces
« on: August 15, 2008, 03:55:08 pm »

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, 04: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, 07: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: 570
  • Neirao
    • View Profile
Re: Script Request: untriangulate faces
« Reply #2 on: August 18, 2008, 01:23:23 am »

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: 157
    • View Profile
Re: Script Request: untriangulate faces
« Reply #3 on: September 16, 2008, 02:09:14 am »

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, 05: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, 07: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: 157
    • View Profile
Re: Script Request: untriangulate faces
« Reply #6 on: September 16, 2008, 02:18:11 pm »

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: 570
  • Neirao
    • View Profile
Re: Script Request: untriangulate faces
« Reply #7 on: September 16, 2008, 03:40:32 pm »

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, 08: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 19, 2008, 03:43:12 am »

thanks nicke  well done. :)
Logged

NickE

  • Full Member
  • ***
  • Posts: 157
    • View Profile
Re: Script Request: untriangulate faces
« Reply #10 on: September 20, 2008, 01:49:36 pm »

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, 11: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, 08: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, 12:04:55 pm »

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

captaindrewi

  • Sr. Member
  • ****
  • Posts: 450
  • errm...errr?
    • View Profile
Re: Script Request: untriangulate faces
« Reply #14 on: February 06, 2009, 10: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