It is currently Wed Oct 18, 2017 3:00 pm


Latest GIMP Scripts & Plug-ins

All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 59 posts ]  Go to page 1, 2, 3, 4, 5, 6  Next
Author Message
 Post subject: Need Help Testing A Simple Script
PostPosted: Sat Mar 14, 2015 11:43 pm  (#1) 
Offline
GimpChat Founder
User avatar

Joined: May 22, 2008
Posts: 5207
Location: Gimpville
This script calculates the horiz and vert direction based on the angle. I think we are seeing different results from different PCs. This test will allow us to check to see if the math is consistent across GIMP installs, OS, & Hardware.

1) Install the attached test-calc.scm script
2) Open any image and run Script-Fu/Test Calc
3) Post the results displayed on error console back to this thread.

Here are the results of my tests.

Image

Thanks!


Attachments:
File comment: Test Calc
test-calc.scm [3.84 KiB]
Downloaded 77 times

_________________
“If you reach for the stars, you just might land on a decently sized hill.” - Stuart Hill
Share on Facebook Share on Twitter Share on Orkut Share on Digg Share on MySpace Share on Delicious Share on Technorati
Top
 Post subject: Re: Need Help Testing A Simple Script
PostPosted: Sun Mar 15, 2015 12:04 am  (#2) 
Offline
GimpChat Member
User avatar

Joined: Oct 02, 2014
Posts: 1928
Location: Sydney Australia
Here are my test calc results -

Intel Celeron N282 Intel HD graphics 4GB memory Windows 8.1 64 bit GIMP 2.8.14

Image

_________________
Image

All life is reflected in glass but encased in wire


Last edited by oldmangrumpy on Sun Mar 15, 2015 1:19 am, edited 1 time in total.

Top
 Post subject: Re: Need Help Testing A Simple Script
PostPosted: Sun Mar 15, 2015 1:01 am  (#3) 
Offline
Global Moderator
User avatar

Joined: Nov 16, 2011
Posts: 5130
Location: Metro Vancouver, BC
Gimp 2.8.14, Ubuntu 14.10
Memory: 2.0 GiB
Processor: Intel Core 2 Duo CPU T5550 @ 1.83GHz
Graphics: Intel GM965/GL960 x86/MMX/SSE2
OS type: 32-bit

Test Calc Warning
Angle(0) horz: 1 vert: 0

Test Calc Warning
Angle(45) horz: 1 vert: 1

Test Calc Warning
Angle(90) horz: 0 vert: 1

Test Calc Warning
Angle(135) horz: 0 vert: 1

Test Calc Warning
Angle(180) horz: 0 vert: 0

Test Calc Warning
Angle(225) horz: 0 vert: 0

Test Calc Warning
Angle(270) horz: 0 vert: 0

Test Calc Warning
Angle(315) horz: 1 vert: 0


Attachments:
File comment: Test results
obc-test-calc.txt.7z [226 Bytes]
Downloaded 52 times

_________________
Image
Gimp 2.8.18, Linux, median user
Gimp Chat Tutorials Index
Spirit Bear (Kermode)
Top
 Post subject: Re: Need Help Testing A Simple Script
PostPosted: Sun Mar 15, 2015 1:05 am  (#4) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4694
Location: Bendigo Vic. Australia
Here you are GnuTux

Test Calc Warning
Angle(0) horz: 1.0 vert: 0.0

Test Calc Warning
Angle(45) horz: 1.0 vert: 1.0

Test Calc Warning
Angle(90) horz: 0.0 vert: 1.0

Test Calc Warning
Angle(135) horz: -1.0 vert: 1.0

Test Calc Warning
Angle(180) horz: -1.0 vert: 0.0

Test Calc Warning
Angle(225) horz: -1.0 vert: -1.0

Test Calc Warning
Angle(270) horz: -0.0 vert: -1.0

Test Calc Warning
Angle(315) horz: 1.0 vert: -1.0

_________________
Image
No matter how much you push the envelope, it'll still be stationery.


Top
 Post subject: Re: Need Help Testing A Simple Script
PostPosted: Sun Mar 15, 2015 1:18 am  (#5) 
Offline
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 10185
Below's my result Tux. :)

  Test Calc Warning
Angle(0)   horz: 1.0  vert: 0.0

  Test Calc Warning
Angle(45)   horz: 1.0  vert: 1.0

  Test Calc Warning
Angle(90)   horz: 0.0  vert: 1.0

  Test Calc Warning
Angle(135)   horz: -1.0  vert: 1.0

  Test Calc Warning
Angle(180)   horz: -1.0  vert: 0.0

  Test Calc Warning
Angle(225)   horz: -1.0  vert: -1.0

  Test Calc Warning
Angle(270)   horz: -0.0  vert: -1.0

  Test Calc Warning
Angle(315)   horz: 1.0  vert: -1.0

_________________
Lyle

Psalm 109:8

Image


Top
 Post subject: Re: Need Help Testing A Simple Script
PostPosted: Sun Mar 15, 2015 1:26 am  (#6) 
Offline
GimpChat Founder
User avatar

Joined: May 22, 2008
Posts: 5207
Location: Gimpville
Thanks for the tests.

So far, I see Odin is the odd man out. His system does not output the same values as the other results. I'll bet this will be the same as Issabella's results, when she has a chance to post them.

When I released the 3D Extrusion script, I certainly didn't expect that the internal calculations would yield different values across different PCs, but there it is. :(

(set! hpos (round (cos (* 225 (/ 3.14 180)))))
(set! vpos (round (sin (* 225 (/ 3.14 180)))))


On the machines in question, like Odin's, negative values end up being zero, instead of -1.

Anyone have any suggestions as to why this would be the case on certain machines?

_________________
“If you reach for the stars, you just might land on a decently sized hill.” - Stuart Hill


Top
 Post subject: Re: Need Help Testing A Simple Script
PostPosted: Sun Mar 15, 2015 1:41 am  (#7) 
Offline
GimpChat Member
User avatar

Joined: Sep 24, 2010
Posts: 10185
Math Co-Processor error? I heard that there might be one on new Intel processors. See link below Tux. :)

https://randomascii.wordpress.com/2014/ ... intillion/

_________________
Lyle

Psalm 109:8

Image


Top
 Post subject: Re: Need Help Testing A Simple Script
PostPosted: Sun Mar 15, 2015 3:12 am  (#8) 
Offline
Script Coder
User avatar

Joined: Jun 22, 2010
Posts: 1068
Location: Here and there
Looks like the round function isn't doing what's expected of it: http://www.scheme.com/tspl3/objects.html#./objects:s93

And I think the lack of decimal points is indicative of something being different.

If Odin would like to try opening the script-fu console and trying this:
(round -0.7)

I get the answer -1.0 on GIMP 2.8.14 on my Windows 8.1 machine
I get the answer -1 on GIMP 2.6.7 on my Windows 8.1 machine
I get the answer -1.0 on GIMP 2.8.14 on my Ubuntu 14.04 LTS virtual machine

Kevin

p.s. Script-Fu has a constant: *pi*

And just to throw in a possible reason for the different behaviour. If I add this to your test_calc script:
(define (round value)
  (* value 2)
)

I can redefine what the round function returns:
  Test Calc Warning
Angle(0)   horz: 2.0  vert: 0.0

  Test Calc Warning
Angle(45)   horz: 1.414776538  vert: 1.413650362

  Test Calc Warning
Angle(90)   horz: 0.001592653421  vert: 1.999999366

  Test Calc Warning
Angle(135)   horz: -1.41252329  vert: 1.415901817

  Test Calc Warning
Angle(180)   horz: -1.999997463  vert: 0.003185305833

  Test Calc Warning
Angle(225)   horz: -1.417026198  vert: -1.411395321

  Test Calc Warning
Angle(270)   horz: -0.004777956225  vert: -1.999994293

  Test Calc Warning
Angle(315)   horz: 1.410266458  vert: -1.418149681


So it could be another script redefining round for it's own purpose.


Last edited by paynekj on Sun Mar 15, 2015 4:04 am, edited 1 time in total.

Top
 Post subject: Re: Need Help Testing A Simple Script
PostPosted: Sun Mar 15, 2015 3:44 am  (#9) 
Offline
GimpChat Member
User avatar

Joined: Mar 01, 2014
Posts: 5184
Location: Spain, Aragón
Here my test Calc. Thanks GnuTux :)


Attachments:
Results-Issa.JPG
Results-Issa.JPG [ 73.39 KiB | Viewed 1621 times ]

_________________
Image
"Your vision becomes clearer only when you look into your heart. Who looks outside, dreams. Who looks inside, awakens". Carl G. Jung.
Top
 Post subject: Re: Need Help Testing A Simple Script
PostPosted: Sun Mar 15, 2015 4:05 am  (#10) 
Offline
Script Coder
User avatar

Joined: Dec 27, 2014
Posts: 508
@GnuTux
looks like Issabella and Odin's machines are truncating rather than rounding ..hence the lack of decimal places as well.


Top
Post new topic Reply to topic  [ 59 posts ]  Go to page 1, 2, 3, 4, 5, 6  Next

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Attachment(s) Need Assistance Testing Another Simple Script

90

No new posts Attachment(s) Add Guides In Range (.py script). Super simple script

2

No new posts Attachment(s) Script-fu simple crystallize

9

No new posts Attachment(s) very simple script example needed

12

No new posts Attachment(s) Simple script-fu to create new RGB image

1



* Login  



Powered by phpBB3 © phpBB Group