8000 NURBS raytracing · Issue #77 · cihologramas/pyoptools · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

NURBS raytracing #77

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Jonas231 opened this issue Mar 21, 2020 · 4 comments
Open

NURBS raytracing #77

Jonas231 opened this issue Mar 21, 2020 · 4 comments
Assignees

Comments

@Jonas231
Copy link

Hi guys,
this package is very impressing.

Do you plan to implement NURBS raytracing?
This would be very useful for this non-sequential optical raytracer for stray light analysis applications.
I would very much like to contribute in this direction. One could start somewhere from here:
https://github.com/orbingol/NURBS-Python
Load the .iges-surfaces into python: e.g. https://github.com/Rod-Persky/pyIGES

Then perform raytracing:
[Martin] Practical Ray Tracing of Trimmed NURBS Surfaces

Is it possible to track the traversed raypaths of any ray in pyoptools. Let's say ray A started at surface A, hit surface B at coordinate (x,y,z) with direction cosines ... and stoped at surface C... ?

@ramezquitao
Copy link
Member
ramezquitao commented Mar 23, 2020

Hi,

This is something we can be easily done as long as we get the following information:

1- The equation of the nurbs z=f(x,y)
2- The intersection point of the nurb and an arbitrary ray
3- The normal of the nurb surface at the intersection point.

If you could help us with that, I can implement the nurbs surface in pyoptools fast.

About your second question, yes it is possible to track a ray in the propagation. I will prepare an example and send it to you.

@ramezquitao ramezquitao self-assigned this Mar 23, 2020
@Jonas231
Copy link
Author

Sounds good. I will try.

  1. I should get with https://github.com/pyvista/pyiges. I have already plotted an aspheric mirror as a vtk mesh with it. A slight modification gives accesss to parameters of the iges.
  2. / 3. --> This seems to be the hard part and will take some time.
    When and if it is finished however I think your package will be very powerful.
    Have you considered using pyvista, vtk, mayavi (the like) for plotting the optical surfaces and rays?

@Jonas231
Copy link
Author

This master thesis conveys the complexity of the issue:
"Ray Tracing NURBS Surfaces using CUDA"
https://repository.tudelft.nl/islandora/object/uuid:7e04a67d-fc3c-4d11-a1e0-67043044e637/datastream/OBJ/download

@ramezquitao
Copy link
Member

I added an example on how to follow the rays in the documentation at my branch. This has not been merged with the official branch yet, but you can see i the example here:

https://pyoptools-rao.readthedocs.io/en/latest/notebooks/basic/raypath_follow.html

Regarding using pyvista, vtk, mayavi: At the beginning of the development we used VTK, but it made the installation very complicated. After that we made a viewer using WX, but also to keep it working was a lot of work. Right now, the idea is that pyOpTools should work with the minimum amount of dependencies. For the moment, only the jupyter frontend is intended to be part of the main pyOpTools installation. Other kinds of front-ends, such as the Freecad workbech , are intended to be developed by separate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
0