Skip to content
This repository has been archived by the owner on Jun 29, 2019. It is now read-only.

création de curve dans list_curves(cont) #1

Closed
gabrielhdt opened this issue Dec 3, 2016 · 0 comments
Closed

création de curve dans list_curves(cont) #1

gabrielhdt opened this issue Dec 3, 2016 · 0 comments
Assignees
Labels

Comments

@gabrielhdt
Copy link
Owner

En lançant list_curves([cont]), l'erreur suivante est obtenue

File "test.py", line 34, in test_tg
    curves = cp.list_curves([cont])
  File "/home/gabriel/workspace/vcs/GAMA/control_points.py", line 79, in list_curves
    curves.append(curve)
UnboundLocalError: local variable 'curve' referenced before assignment

avec cont un carré défini par:

cont.xys += [ie.Pixel(10 + i, i) for i in range(10, 21)]                    
cont.xys += [ie.Pixel(30 - i, 20 + i) for i in range(1, 11)]                
cont.xys += [ie.Pixel(20 - i, 30 - i) for i in range(1, 11)]                
cont.xys += [ie.Pixel(10 + i, 20 - i) for i in range(1, 11)]

Le problème semble résider dans les conditions
if len(contour.xys) < 3: et while start != c_end: qui ne couvriraient pas tous les cas, laissant curve non initialisée lors de l'appel curves.append(curve).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants