/*
 *              Scientrace.CircularFresnelPrism cprism = new Scientrace.CircularFresnelPrism(env, air,
 *                      new Location(0, 0, 0), new NonzeroVector(prismradius, 0, 0).rotateAboutY(prismAngleRadians),
 *                      new NonzeroVector(0,0, prismradius).rotateAboutY(prismAngleRadians), new NonzeroVector(0, -0.5E-2, 0),
 *                      this.prism_angle*Math.PI/180, (Math.PI/2)-(this.prism_angle*Math.PI/180), dentalcount, pmma);
 *?/
 *
 *      /* Prism and Mirror data from configfile */
        public Scientrace.ParabolicMirror parseXParabolicMirror(XElement xmir)
        {
            Scientrace.UnitVector miraxis = this.X.getXNzVector(xmir.Element("MirrorAxis")).toUnitVector();

            /*string materialid = this.X.getXString(xmir.Attribute("Material"));
             * Scientrace.MaterialProperties material = Scientrace.MaterialProperties.FromIdentifier(materialid);*/
            Scientrace.MaterialProperties material = new ShadowClassConstruct(this.parentcollection).getXMaterial(xmir);
            XMLBorderParser xbp = new XMLBorderParser();

            Scientrace.AbstractGridBorder border = xbp.getXBorder(xmir.Element("Border"));
            Scientrace.ParabolicMirror    tretpmir;
            if (xmir.Attribute("DistanceToMirror") == null)
            {
                double parabolic_constant    = this.X.getXDouble(xmir.Attribute("ParabolicConstant"));
                Scientrace.Location location = this.X.getXLocation(xmir.Element("Location"));
                tretpmir = new Scientrace.ParabolicMirror(
                    this.parentcollection, material, location, miraxis, parabolic_constant, border);
            }
            else
            {
                double distance_to_mirror      = this.X.getXDouble(xmir.Attribute("DistanceToMirror"));
                Scientrace.Location focuspoint = this.X.getXLocation(xmir.Element("FocusPoint"));
//				Console.WriteLine("-->"+focuspoint.tricoshort()+ " / "+ distance_to_mirror+miraxis.tricon()+ " / <---");
                tretpmir = Scientrace.ParabolicMirror.CreateAtFocus(this.parentcollection, material,
                                                                    focuspoint, distance_to_mirror, miraxis, border);
                tretpmir.exportX3Dgridsteps = 64;
            }
            return(tretpmir);
        }
Esempio n. 2
0
        public static Scientrace.ParabolicMirror CreateAtFocus(Scientrace.Object3dCollection parent,
                                                               Scientrace.MaterialProperties mprops, Scientrace.Location focusloc,
                                                               double distancetormirror, Scientrace.UnitVector zaxis,
                                                               AbstractGridBorder cborder)
        {
            double c = 1 / (4 * distancetormirror);

            Scientrace.Location loc = (focusloc - (zaxis.toVector() * distancetormirror)).toLocation();
            return(new Scientrace.ParabolicMirror(parent, mprops, loc, zaxis, c, cborder));
        }
Esempio n. 3
0
        /// <summary>
        /// The parabolic mirror is one of the key elements of the SunCycle concentrator
        /// When light is directed onto a parabolic mirror in the right direction the
        /// lightrays will reflect towards a single point, hence it can be used as a concentrator.
        /// </summary>
        /// <param name="parent">
        /// A <see cref="Scientrace.Object3dCollection"/> in which the physicalobject "parabolicmirror" is placed.
        /// </param>
        /// <param name="mprops">
        /// A <see cref="Scientrace.MaterialProperties"/> instance defines the properties of the mirror.
        /// </param>
        /// <param name="loc">
        /// A <see cref="Scientrace.Location"/> defines the location which has to be shifted to 0,0,0 to make z = x^2 + y^2 = 0
        /// </param>
        /// <param name="zaxis">
        /// A <see cref="Scientrace.UnitVector"/> pointing the direction of the norm at the "bottom" of the mirror pointing "up"
        /// </param>
        /// <param name="c">
        /// A <see cref="System.Double"/>, the value c for which z = c(x^2+y^2) after a location shift.
        /// </param>
        /// <param name="cborder">
        /// A <see cref="CylindricalBorder"/> the mirror only exists between these borders.
        /// </param>
        public ParabolicMirror(Scientrace.Object3dCollection parent, Scientrace.MaterialProperties mprops,
                               Scientrace.Location loc, Scientrace.UnitVector zaxis, double c,
                               AbstractGridBorder cborder) : base(parent, mprops)
        {
            /* Console.WriteLine("Mirror props: loc:"+
             *                        loc.trico()+" zax:"+zaxis.trico()+ " c:"+c +" border: "+cborder.ToString()); */
            this.c       = c;
            this.loc     = loc;
            this.zaxis   = zaxis;
            this.cborder = cborder;


            Scientrace.UnitVector basevec1 = new Scientrace.UnitVector(1, 0, 0);
            if (Math.Abs(zaxis.dotProduct(basevec1)) > 0.8)
            {
                basevec1 = new Scientrace.UnitVector(0, 1, 0);
            }
            Scientrace.UnitVector v = basevec1.crossProduct(zaxis).tryToUnitVector();
            trf = new VectorTransformOrthonormal(zaxis, v, VectorTransform.SWAP_U_WITH_W);

            //Console.WriteLine("V transform: "+trf.transform(v).trico()+ " z: "+zaxis+" transform(Z):"+trf.transform(zaxis).trico());
        }
Esempio n. 4
0
 public void addBorder(AbstractGridBorder aBorder)
 {
     this.additionalBorders.Add(aBorder);
 }
Esempio n. 5
0
 public CombinedBorder(AbstractGridBorder primaryborder)
 {
     this.primaryborder = primaryborder;
 }