Giter Club home page Giter Club logo

Comments (7)

ricktu288 avatar ricktu288 commented on July 19, 2024

Do you mean to evaluate equations with named constants (which cannot be changed once evaluated) when entering the (x,y) coordinates of a control point? Or do you mean to fully parametrize the scene with a set of variables, so that you can adjust the variables and see the corresponding change?

The former is relatively easy to implement, while the latter is very difficult. It would be helpful if you could describe in more details your specific need.

Also note that some of the existing features, such as the handle (see the "Group, rotate, or scale object" section in the popup of the "Help" button), may provide some of the automation you need. For now, you may also consider using a Python script to generate the scene, as in https://phydemo.app/ray-optics/gallery/chaff-countermeasure.

from ray-optics.

Medic-Gamingg avatar Medic-Gamingg commented on July 19, 2024

My intention was the latter, however now that I've further reflected on my idea it was a bit lazy of me to request such a feature, especially with the fact that I do not know much about the subject of geometric optics, meaning my idea could be near useless whether it be from a lack of need or from the need already being satisfied by something else, I apologize for opening an issue on this and in the future I will put in more consideration before opening issues.

from ray-optics.

ricktu288 avatar ricktu288 commented on July 19, 2024

This is actually a good feature request, and you are not the first one to request this. Actually, at least 15 items in the Gallery would be benefitted by this feature, and I have considered it seriously before.

The only problem is that the implementation is highly nontrivial, and there are several very different possible approaches, such that once decided, it will be impractical to change to another. I need to know that what the users need in order to decide which approach is the best, so it is still a good idea if you can provide your original thought. Note that this app is designed for educational purpose, so suggestions from people who do not know much about geometric optics is also valuable (compare https://www.desmos.com/, an educational-purpose graphing calculator in which almost everything is parametrizable).

Also, I will keep this issue open for discussion, since there have been other people suggesting this privately before.

Note that, however, this feature is not expected to be implemented in the near future due to its difficulty.

from ray-optics.

gbonfi avatar gbonfi commented on July 19, 2024

Thanks for reopening it. It can also come in handy to me.
I'd like to check how light propagates through a long light guide with dimples on one side. Since the dimples are all equal in size (length and depth) a variable can help to change one value, e.g. depth, to modify the shape.
At the moment I create a small section and then duplicate it many times, but if I need to change depth (so the y value) I need to replicate the procedure, while with a variable z=.... I could just change that.

from ray-optics.

ricktu288 avatar ricktu288 commented on July 19, 2024

Depending on the shape of the dimples, it looks like this automation you are describing may be possible with the handle (the "Group, rotate, or scale object" section in the popup of the "Help" button), such as clicking all the tip points of the dimples, and then move it with the handle.

Still, in the general case, the parametrization/variable feature is still required. And actually also I am thinking about the "list" feature which should work together with the variable feature, so that you don't even need to replicate that a lot of things in the beginning, and the number of replication is also an adjustable variable. In Desmos, it is very simple to achieve this.

圖片

And I have been considering to implement this also in ray-optics. But that is the most difficult part. There are actually relatively simple (but still quite difficult) approaches to implement the "variable", but then it will not allow the implementation of "list". My current thought is to use an approach that will allow these two features together.

from ray-optics.

ricktu288 avatar ricktu288 commented on July 19, 2024

Also, the main difficulty to implement this is to create the proper user interface. If you don't need a full user interface (such as you need to first edit the scene by editing the JSON code directly, but then the variables can still be adjusted in UI with sliders, and non-parametrized object can be created and edited in the UI as usual), then it is actually not that difficult, and may be done in the near future.

But without the full UI, I do not know how many people would be benefitted by this. I do not know what fraction of the users of this app is comfortable editing JSON code directly.

from ray-optics.

ricktu288 avatar ricktu288 commented on July 19, 2024

Recently, similar feature requests has been suggested two more times from private emails. One of the suggestion is to use a desmos-like equation sidebar approach, where the user can add objects by typing an equation, such as

C_1 = glass(circle[p, r],gradient[f(x), o])

to create a glass gradient index circle with boundary origin p, radius r, and absolute origin o.

This has a relatively simple implementation without the need to modify a lot of core code (as opposed to previously-proposed approach). We just need to treat the list of equations as a "scene-builder" outside of the existing scene editor UI, and every time the user modifies some variables or equations are modified, just "recompile" those variable/equations into the JSON object of the scene in the original format readable by the core simulator. Also, we do not need to implement all the possible features (as equations) at once, as one can still add objects in the old way in the editor (without appearing in the sidebar).

from ray-optics.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.