From: Daniel <boy...@gm...> - 2009-12-01 12:01:12
|
Hi Peter, Stanley and Stef, I bit of background! I have written a 'statistical/forward' ray tracer in C and I'm trying to shift this to python: a total write! To be honest the C code is awful (scientist code), however at the time of writing it was good enough to get the job done, and it did the job well. The purpose of the ray-tracer is not to render images, but to build up statistics about where rays entered into the scene end-up. For example, in solar energy research one could imagine having the ray from a 'solar' light-source, bounding off a few mirrors and entering a solar cell. My previous ray tracer was used to simulated Luminescent Solar Concentrators (have a look here at our research group's page: http://www.imperial.ac.uk/qpv ). I have already converted the majority of the 'physics' part into python (have a look at Materials.py here: http://groups.google.com/group/python-ray-tracing-community ). I would like to base the re-write 'on the shoulders of giants' where possible! The less code I write means the project becomes easier to manage with less bugs. So if somebody has written all the required intersection code already then I was thinking I could use this. I'm basically looking for a 3D library that allows me programmatically to define geometric objects. In the simplest case just planes, box and rays (of course one can make a box from planes). Example, # an axis aligned box with LxWxH = 1x1x1. box = Box(pt1=(0,0,0), pt2=(1,1,1)) # box now transformed to 45 degrees along x axis box.transform = Transform(axis=(1,0,0), angle_deg=45) # define a ray between two points ray = Ray(pt1=(-1,1,1), pt=(1,1,1)) # List of intersection points points = box.intersection(ray) I was hoping that vpython might be able to do this, of that you guys would be able to point me in the write direction. I could of course sit down and write the intersection code (again!) manually (the books you linked too look really good, I will see if our library has them -- thanks), but if something is out there I would prefer to use this. Cheers, Dan On 1 Dec 2009, at 00:15, Peter Borcherds wrote: > Dear Daniel > > I do not understand what it is you want to do. > > Perhaps vpython is not the right package. Have you looked at Geogebra? > > Regards > > Peter > > P.H...@bh... > > +44 (0) 121 475 3029 > > ________________________________ > > From: Daniel [mailto:boy...@gm...] > Sent: Mon 30-Nov-09 11:55 PM > To: vis...@li... > Subject: [Visualpython-users] Intersection Calculations > > > > Hi folks, > > Is it possible to use vpython to compute intersections with simple > geometrical objects such has rays and planes? Could you point me in > the right direction. > > Best regards, > > Daniel > > ------------------------------------------------------------------------------ > Join us December 9, 2009 for the Red Hat Virtual Experience, > a free event focused on virtualization and cloud computing. > Attend in-depth sessions from your desk. Your couch. Anywhere. > http://p.sf.net/sfu/redhat-sfdev2dev > _______________________________________________ > Visualpython-users mailing list > Vis...@li... > https://lists.sourceforge.net/lists/listinfo/visualpython-users > > |