Open 10110111 opened 4 years ago
Actually, the problem seems to originate even before the attempts to plot: the tracing process appears to have lost most of the internal rays, see the layout output file:
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);
The layout is now:
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.