[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Length of a PolyLine



Hi Hans,

Hans Breuer wrote:
Shouldn't the parameters to pow() be the other way around?

Your right.

What do you mean with "not always the same"? Looking just at the
Python bindings plug-ins/python/pydia-property.c(PyDia_get_PointArray)
you'll get the points in the same order as stored internally. And
that needs to be ordered to get the drawing right.

I draw a simple PolyLine with two points and they seem to be a little bit double-minded where to be :-)


#!/usr/bin/env python
points = dia.active_display().diagram.layers[0].objects[2].properties['poly_points']
for i in range(len(points.value)):
print points.value[i]


>>> execfile("length.py")
(inf,inf)
(-0.122777,nan)
>>> execfile("length.py")
(0.000000,0.000000)
(0.000000,0.000000)
>>> execfile("length.py")
(0.000000,0.000000)
(0.000000,0.000000)
>>> execfile("length.py")
(0.000000,0.000000)
(0.000000,0.000000)
>>> execfile("length.py")
(inf,inf)
(-0.122777,nan)

My System:

bash-2.05b$ uname -a
FreeBSD banias 5.3-RELEASE-p4 FreeBSD 5.3-RELEASE-p4 #3: Fri Jan 7 17:45:33 CET 2005 root banias:/usr/src/sys/i386/compile/BANIAS-5.3 i386


bash-2.05b$ dia -v
Dia version 0.94, compiled 21:24:31 Jan 16 2005

bash-2.05b$ python -V
Python 2.4

best regards
           Chris Burkert
--
http://www.chrisburkert.de/


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index] Mail converted by Mofo Magic and the Flying D

 
All trademarks and copyrights are the property of their respective owners.

Other Directory Sites: SeekWonder | Directory Owners Forum

GuideSMACK