-
Notifications
You must be signed in to change notification settings - Fork 7
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
Crash while processing a particular lens prescription #23
Comments
Indeed, the problem is with such lenses that cut away a fair portion of the incoming rays. I was able to work around the crash with this hack (replacing one magic number with another): diff --git a/src/core/analysis_rayfan.cpp b/src/core/analysis_rayfan.cpp
index d7c4ce8..59e4af9 100644
--- a/src/core/analysis_rayfan.cpp
+++ b/src/core/analysis_rayfan.cpp
@@ -52,7 +52,7 @@ namespace analysis
RayFan::RayFan (const std::shared_ptr<sys::System> &system,
enum rayfan_plane_e plane)
: _tracer (system.get ()), _processed_trace (false), _entrance (0),
- _exit (0), _dist (trace::SagittalDist, 15)
+ _exit (0), _dist (trace::SagittalDist, 150)
{
set_plane (plane);
} And the layout is rendered better when I replace a magic number here: diff --git a/cmd/generic_lens.cpp b/cmd/generic_lens.cpp
index 40e33d0..a25d3cf 100644
--- a/cmd/generic_lens.cpp
+++ b/cmd/generic_lens.cpp
@@ -310,7 +310,7 @@ layout (const std::shared_ptr<sys::System> &sys,
#else
// trace and draw rays from source
tracer.get_params ().set_default_distribution (
- trace::Distribution (trace::MeridionalDist, 10));
+ trace::Distribution (trace::MeridionalDist, 50));
tracer.get_trace_result ().set_generated_save_state (*source_point);
tracer.trace ();
tracer.get_trace_result ().draw_2d (renderer); |
Hi - thank you. I didn't notice this issue as I didn't get an alert somehow. |
BTW Sometimes Bill Claff's data file doesn't have some values - that can cause issues. I should probably improve validation when loading the data. |
I was trying to process (by example from
data
subdirectory) the prescription for Canon EF-S10-18mm f4.5-5.6 IS STM. Butgopt
aborts with the following output (and backtrace via GDB).The same
gopt
binary works fine with the examples in the repo, and also with another prescription I tried, for Canon EF-S24mm f2.8 STM.The text was updated successfully, but these errors were encountered: