Example #1
0
	// return type changed from single Scientrace.Trace instance to List<Scientrace.Trace> newTraces in order to better facilitate the splitting of traces.
	public List<Scientrace.Trace> redirect_with_polarisation(Scientrace.Object3d toObject, Scientrace.Intersection intersection) {
		List<Scientrace.Trace> newTraces = new List<Trace>();
		//what objects are acting here?
		Scientrace.Object3d fromObject = this.currentObject;

		/* The "normal" vector should always point towards the incoming beam when
		 * using the Snellius-approach as described by figure 15 in 
		 * "Optical simulation of the SunCycle concentrator using Scientrace"
		 * by Joep Bos-Coenraad (2013) */
		Scientrace.UnitVector normal = intersection.enter.flatshape.plane.getNorm()
										.orientedAgainst(this.traceline.direction)
										.tryToUnitVector();

		DielectricSurfaceInteraction fsi = new DielectricSurfaceInteraction(this, intersection.enter.loc, normal, 
						fromObject.materialproperties.refractiveindex(this), toObject.materialproperties.refractiveindex(this), 
						toObject);
		
		newTraces.AddIfNotNull(fsi.getReflectTrace(this.getMinDistinctionLength()));
		newTraces.AddIfNotNull(fsi.getRefractTrace(this.getMinDistinctionLength()));
		return newTraces;
		}
        // return type changed from single Scientrace.Trace instance to List<Scientrace.Trace> newTraces in order to better facilitate the splitting of traces.
        public List<Scientrace.Trace> redirect_with_polarisation(Scientrace.Object3d toObject, Scientrace.Intersection intersection)
        {
            List<Scientrace.Trace> newTraces = new List<Trace>();
            //what objects are acting here?
            Scientrace.Object3d fromObject = this.currentObject;

            /* The "normal" vector should always point towards the incoming beam when
             * using the Snellius-approach as described by figure 15 in
             * "Optical simulation of the SunCycle concentrator using Scientrace"
             * by Joep Bos-Coenraad (2013) */
            Scientrace.UnitVector normal = intersection.enter.flatshape.plane.getNorm()
                                        .orientedAgainst(this.traceline.direction)
                                        .tryToUnitVector();

            DielectricSurfaceInteraction fsi = new DielectricSurfaceInteraction(this, intersection.enter.loc, normal,
                        fromObject.materialproperties.refractiveindex(this), toObject.materialproperties.refractiveindex(this),
                        toObject);

            newTraces.AddIfNotNull(fsi.getReflectTrace(this.getMinDistinctionLength()));
            newTraces.AddIfNotNull(fsi.getRefractTrace(this.getMinDistinctionLength()));
            return newTraces;
        }