public RayTraceParameters(OpticalSystem system)
        {
            this._sequence         = new List <Element>();
            this._sequential_mode  = true;
            this._intensity_mode   = RayTracer.TraceIntensityMode.Simpletrace;
            this._propagation_mode = PropagationMode.RayPropagation;
            this._max_bounce       = 50;
            this._unobstructed     = false;
            this._lost_ray_length  = 1000;
            foreach (Element e in system.elements())
            {
                add(e);
            }

            _sequence.Sort((a, b) =>
            {
                double z1 = a.get_position().z();
                double z2 = b.get_position().z();
                if (z1 > z2)
                {
                    return(1);
                }
                else if (z1 < z2)
                {
                    return(-1);
                }
                else
                {
                    return(0);
                }
            });
            this._default_distribution = new Distribution(Pattern.MeridionalDist, 10, 0.999);
        }
Пример #2
0
        void draw_2d(RendererSvg r, OpticalSystem system)
        {
            // optical axis
            Vector3Pair b = system.get_bounding_box();

            r.draw_segment(new Vector2Pair(new Vector2(b.v0.z(), 0.0), new Vector2(b.v1.z(), 0.0)), Rgb.rgb_gray);

            foreach (Element e in system.elements())
            {
                draw_element_2d(r, e, null);
            }
        }
Пример #3
0
            public OpticalSystem build()
            {
                generateIds();
                Transform3Cache transform3Cache = setCoordinates();
                List <Element>  elements        = buildElements();
                OpticalSystem   system          = new OpticalSystem(elements, transform3Cache);

                foreach (Element e in system.elements())
                {
                    e.set_system(system);
                }

                return(system);
            }