On Thu, Feb 28, 2008 at 11:13 AM, dorai iyer <[EMAIL PROTECTED]> wrote:
> Hi,
> I am trying to draw a vector ( as a single polygonal line) and then stroke
> it and measure its length using
> gimp-vectors-stroke-get-length.
>
> So I first used python to try to do it. Here is the script
> def vector_length(image, drawable):
>      vectors = pdb.gimp_image_get_active_vectors(image)
>     strokes = pdb.gimp_vectors_get_strokes(vectors)
>     len1 = pdb.gimp_vectors_stroke_get_length(vectors, stroke1, 100.0)
.. stroke1 is the unbound variable. Why would it exist? You never create it.

The following is more correct

nstrokes, strokes = pdb.gimp_vectors_get_strokes(vectors)
len0 = pdb.gimp_vectors_stroke_get_length(vectors, strokes[0], 100.0)



> the vectors and strokes went fine but I could not get the length
>
> I then thought maybe I should try using tinyscheme and tried the following
>   (let* (
>         (count 0)
>         (vector (car(gimp-image-get-active-vectors img)))
>         (strokes (cadr(gimp-vectors-get-strokes vector)))
>          (len (caddr(gimp-vectors-stroke-get-length vector (aref strokes
> count) 100.0)))
>      )
>     (print (list len vector))
> I still get an unbound variable error. a search fo previous implementations
> did not show much. Has anyone used
>  gimp-vectors-stroke-get-length
> in either scm or python successfully and can help resolve my problem. I am
> more familaiar with python then tinyscheme but not adept at either which is
> probably clearly reflected in my programming.
>  Thanks for the help.
>
> _______________________________________________
>  Gimp-user mailing list
>  Gimp-user@lists.XCF.Berkeley.EDU
>  https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user
>
>
_______________________________________________
Gimp-user mailing list
Gimp-user@lists.XCF.Berkeley.EDU
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-user

Reply via email to