From: Daniel <boy...@gm...> - 2009-11-30 23:55:55
|
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 |
From: Peter B. <p.h...@bh...> - 2009-12-01 01:15:45
|
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 |
From: Stanley S. <ove...@ea...> - 2009-12-01 03:40:53
|
Here's a book on the math: *Geometric Tools for Computer Graphics* by Schneider and Eberly. ISBN 1-55860-594-0. Here's an Amazon.com search: http://www.amazon.com/s/ref=nb_ss_0_15?url=search-alias%3Daps&field-keywords=geometric+tools+for+computer+graphics&sprefix=Geometric+tools The book includes not only the math of these calculations, but also shows algorithms in pseudo-code, which should be easy to translate into Python code. On Mon, Nov 30, 2009 at 4:15 PM, Peter Borcherds <p.h...@bh...>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 > > > > > ------------------------------------------------------------------------------ > 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 > |
From: Stef M. <s.m...@ru...> - 2009-12-01 10:19:46
|
Daniel wrote: > 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. > > Besides the math, you can do nice geometrical visualizations in VPython: http://mientki.ruhosting.nl/movies/geo_demo1.html http://mientki.ruhosting.nl/movies/geo_demo2.html cheers, Stef Het UMC St Radboud staat geregistreerd bij de Kamer van Koophandel in het handelsregister onder nummer 41055629. The Radboud University Nijmegen Medical Centre is listed in the Commercial Register of the Chamber of Commerce under file number 41055629. |
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 > > |
From: Stef M. <s.m...@ru...> - 2009-12-01 13:53:38
|
Daniel, you probably know this beautiful VPython page of Yun http://www-ee.eng.hawaii.edu/~zqyun/caevp.html cheers, Stef Daniel wrote: > 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 >> >> >> > > > ------------------------------------------------------------------------------ > 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 > > > Het UMC St Radboud staat geregistreerd bij de Kamer van Koophandel in het handelsregister onder nummer 41055629. The Radboud University Nijmegen Medical Centre is listed in the Commercial Register of the Chamber of Commerce under file number 41055629. |