Writing a Python manual for Poser 7. Advice required re copyright/license

2007-07-13 Thread PhilC
Hi Folks,

I'm attempting to write a comprehensive manual explaining how to write
Python scripts for the Poser 7 application. All the example scripts,
explanatory paragraphs and screen shots will naturally be all my own
work. My difficulty is in knowing how I may present the large amount
of tabulated data that lists out all the Tkinter functions and their
options. I'm familiar with Fredrik Lundh's "An Introduction to
Tkinter" at http://effbot.org/tkinterbook/ but would not wish to
blindly copy the tables. However there are only so many ways to type:-

"background= 
The background color. The default is system specific."

The manual may be published in book form so may not be free. Does
anyone have contact information for Mr Lundh in order that I might
perhaps send him a draft copy for his comment?

Many thanks,

PhilC

http://www.philc.net
-- 
http://mail.python.org/mailman/listinfo/python-list


Applying transformation matrix to 3D vertex coordinates

2007-09-03 Thread PhilC
'''

Task:-
to apply a translation array to an array
of 3D vertex coordinates to produce the
resulting location of each vertices.

Translation array and vertex coordinates taken from
a Truespace COB file.

The text in the COB file looks like this:-

Transform
-2.11786 -0.817596 0.946387 0.864939
0.405189 1.25484 2.11894 0.434915
-1.16679 1.9198 -0.981965 1.13894
0 0 0 1
World Vertices 8
-0.20 -0.029486 -0.236313
0.20 0.029486 -0.163687
-0.20 0.370514 -0.282911
-0.20 0.370514 0.117089
-0.20 -0.029486 0.163687
0.20 0.029486 0.236313
0.20 0.429486 -0.210286
0.20 0.429486 0.189714

###
'''
# script start 

import Numeric
 
transArray = Numeric.array((
(-2.11786, -0.817596, 0.946387, 0.864939),
(0.405189, 1.25484, 2.11894, 0.434915),
(-1.16679, 1.9198, -0.981965, 1.1389),
(0, 0, 0, 1)
))

# a "1" added to the end of each set of vertix coordinates
vertArray = Numeric.array((
(-0.20, -0.029486, -0.236313, 1),
(0.20, 0.029486, -0.163687, 1),
(-0.20, 0.370514, -0.282911, 1),
(-0.20, 0.370514, 0.117089, 1),
(-0.20, -0.029486, 0.163687, 1),
(0.20, 0.029486, 0.236313, 1),
(0.20, 0.429486, -0.210286, 1),
(0.20, 0.429486, 0.189714, 1)
))

print transArray
print ""
print vertArray
print ""

transArray = Numeric.reshape(transArray,(4,4))
vertArray = Numeric.reshape(vertArray,(4,8))

print Numeric.matrixmultiply(transArray,vertArray)

# script end
'''
##
Result:-

[[ 0.5708016   0.10309048  0.70481144 -1.12413 0.1022124
0.03400637  0.63866924 -1.12413   ]
 [-0.6688108   0.57729922 -0.19537307  4.2138840.3408408
0.72615216  0.66384632  4.213884  ]
 [ 0.2735711.26381257 -0.66763452  0.909945   -0.585931
1.13709619  0.39979 0.909945  ]
 [ 0.2 0.429486   -0.2102861.  0.2
0.4294860.1897141.]]

Am I going in the right direction?
What do I do with the result? :)

Thanks,

PhilC
'''
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Applying transformation matrix to 3D vertex coordinates

2007-09-04 Thread PhilC
On Mon, 03 Sep 2007 23:24:42 -0500, Robert Kern
<[EMAIL PROTECTED]> wrote:

>transpose()


ahh yes I can see where that would work. Just tried it in the above
and I do get a last line of ones.

OK onward and upward :)

Many thanks Robert.
-- 
http://mail.python.org/mailman/listinfo/python-list


Marching Cubes example

2009-02-27 Thread PhilC
Does anyone know of sample code showing how the marching cubes
algorithm may be implimented using Python?

Ref:- http://local.wasp.uwa.edu.au/~pbourke/geometry/polygonise/

I can set up the cubes and test to see if their vertices are inside
the isosurface.

I can produce a resulting "metaball" but definition is poor and some
faces are reversed. (but not in any pattern that I can effectivly
debug).

My particular issues are:-

1) Finding the point at which the isosurface cuts the cube being
tested. Using a mid point produces poor results.

2) Getting the resulting triangular faces to all face outwards.

I'd prefer not to get into using VTK or matlab if possible.

Thanks :)

--
http://mail.python.org/mailman/listinfo/python-list