ricktu288 / ray-optics

A web app for creating and simulating 2D geometric optical scenes, with a gallery of (interactive) demos.
https://phydemo.app/ray-optics/
Apache License 2.0
1.32k stars 220 forks source link

Colour filters #106

Closed gbonfi closed 1 year ago

gbonfi commented 1 year ago

Hello, and thanks for the great app.

There is a missing option for making a proper filter. Could the blocker be made to block just one wavelength? (or vice-versa letting through only one)

Simulating an RGB filter would be immediate without having to manage reflections from mirror or beam splitters.

ricktu288 commented 1 year ago

@gljames24 Can you work on this one? Since the dichroic filter is created by you.

gljames24 commented 1 year ago

So just add the dichroic filter feature to the blocker? I can work on that later next week as I'm on a trip right now, but it shouldn't be too hard to get working.

gljames24 commented 1 year ago

@ricktu288 I moved wavelength interaction and the dichroic property box to the simulator.js so I could invoke them from any object. With the blocker, it isn't actually a dichroic anymore, but rather the more generally an optical filter which should probably be what the user sees as a setting. Also instead of the filter option, it should probably just be named "invert" as that is what it is doing. I can add those to the locales and submit a pull request if you think that sounds good.

ricktu288 commented 1 year ago

Sounds good. Please use "反向" for zh-TW and zh-CN of "invert".

gljames24 commented 1 year ago

@ricktu288 Sorry this took so long. Let me know if there is anything you want changed. #108

ricktu288 commented 1 year ago

Thanks. I changed the appearance to match the wavelength when filter is on (it may somewhat be misleading since when "invert" is off the actual appearance when there is a blacklight should be more like the complementary color, but the appearance of other components in this app do not have a common physical meaning anyway), and also show a checkbox of "filter" instead of "show advanced options" in the selected object bar.