How to use graphic.draw_filled_polygon?
08-23-2021, 08:09 PM
Post: #1
 jfelten Junior Member Posts: 34 Joined: May 2021
How to use graphic.draw_filled_polygon?
Whenever I try to run a command like
Code:
>from graphic import * >draw_filled_polygon([[0,0,0], [0,240,0], [160, 120, 0]], 0)
it just draws nothing and prints "False" to the console. Any other form on syntax either gives me an error or crashes the calculator. I could not find any documentation for this module, so I have no idea how the command works.
08-26-2021, 02:23 AM (This post was last modified: 08-26-2021 11:43 AM by Gene.)
Post: #2
 pol95 Junior Member Posts: 1 Joined: Nov 2020
RE: How to use graphic.draw_filled_polygon?
(08-23-2021 08:09 PM)jfelten Wrote:  Whenever I try to run a command like
Code:
>from graphic import * >draw_filled_polygon([[0,0,0], [0,240,0], [160, 120, 0]], 0)
it just draws nothing and prints "False" to the console. Any other form on syntax either gives me an error or crashes the calculator. I could not find any documentation for this module, so I have no idea how the command works.
Lo leí en TI planet y funciona.

MODERATOR NOTE: English please in the forums. Google translation: "I read it on TI planet and it works."

Code:
>from graphic import * >draw_filled_polygon([[0,0], [0,240], [160, 120]], magenta)
08-26-2021, 02:50 AM
Post: #3
 jfelten Junior Member Posts: 34 Joined: May 2021
RE: How to use graphic.draw_filled_polygon?
So I did manage to find the official documentation for this library after digging through TI Planet forums a bit, and I found out the the correct syntax was
Code:
draw_filled_polygon([[x1, y1], [x2, y2], ..., [xn, yn]], couleur)
although whenever I try that, it crashes the calculator. Is this a bug with the python interpreter or is it just picky about which values or how many values I use?
08-31-2021, 08:01 PM
Post: #4
 albud44 Junior Member Posts: 5 Joined: Jul 2021
RE: How to use graphic.draw_filled_polygon?
(08-26-2021 02:50 AM)jfelten Wrote:  So I did manage to find the official documentation for this library after digging through TI Planet forums a bit, and I found out the the correct syntax was
Code:
draw_filled_polygon([[x1, y1], [x2, y2], ..., [xn, yn]], couleur)
although whenever I try that, it crashes the calculator. Is this a bug with the python interpreter or is it just picky about which values or how many values I use?

Hello,

Sorry, in french, m'y english is little.

Et avec couleur=(r,g,b) ?

Ça donne quoi ?
09-04-2021, 07:43 PM
Post: #5
 jfelten Junior Member Posts: 34 Joined: May 2021
RE: How to use graphic.draw_filled_polygon?
(08-31-2021 08:01 PM)albud44 Wrote:
(08-26-2021 02:50 AM)jfelten Wrote:  So I did manage to find the official documentation for this library after digging through TI Planet forums a bit, and I found out the the correct syntax was
Code:
draw_filled_polygon([[x1, y1], [x2, y2], ..., [xn, yn]], couleur)
although whenever I try that, it crashes the calculator. Is this a bug with the python interpreter or is it just picky about which values or how many values I use?

Hello,

Sorry, in french, m'y english is little.

Et avec couleur=(r,g,b) ?

Ça donne quoi ?

Here is what I got:
Code:
>from graphic import * >draw_filled_polygon([[0,0],[0,240],[160,120]],(0,0,0)) Traceback (most recent call last):   File "<stdin>", line 1, in <module> TypeError: can't convert tuple to int
09-04-2021, 08:53 PM (This post was last modified: 09-04-2021 09:44 PM by Guenter Schink.)
Post: #6
 Guenter Schink Senior Member Posts: 414 Joined: Dec 2013
RE: How to use graphic.draw_filled_polygon?
(09-04-2021 07:43 PM)jfelten Wrote:  Here is what I got:
Code:
>from graphic import * >draw_filled_polygon([[0,0],[0,240],[160,120]],(0,0,0)) Traceback (most recent call last):   File "<stdin>", line 1, in <module> TypeError: can't convert tuple to int

That's weird! The following code works on the virtual Prime and on the G1, but crashes the G2
Code:
>from graphic import * >draw_filled_polygon([[0,0],[0,240],[160,120]],0xff)
gives a nice blue triangle.

"draw_polygon" however works as expected. When I was working on my "Mandelbrot Explorer" I tried a lot with the "graphic" module but gave up. It was completely useless.

Günter

Where did you find the documentation?
09-04-2021, 11:10 PM
Post: #7
 jfelten Junior Member Posts: 34 Joined: May 2021
RE: How to use graphic.draw_filled_polygon?
 « Next Oldest | Next Newest »

User(s) browsing this thread: 1 Guest(s)