Ejemplo n.º 1
0
        }// CreateCuboid

        public static Prism CreateCylinder(int nslices)
        {
            Polygon3D bot = Polygon3D.CreateCircle(nslices, -1);
            Polygon3D top = Polygon3D.CreateCircle(nslices, 1);

            return(new Prism(top, bot));
        }// CreateCylinder
Ejemplo n.º 2
0
        public Prism(Polygon3D top, Polygon3D bot)
        {
            _points3d = new Vector3d[top.points3d.Length + bot.points3d.Length];
            int i = 0;

            foreach (Vector3d v in top.points3d)
            {
                _points3d[i++] = new Vector3d(v);
            }
            foreach (Vector3d v in bot.points3d)
            {
                _points3d[i++] = new Vector3d(v);
            }
            initInfo();
        }
Ejemplo n.º 3
0
        }// createPlanes

        public static Prism CreateCuboid(Vector3d center, Vector3d scale)
        {
            Vector3d off = scale;

            Vector3d[] top = new Vector3d[4] {
                new Vector3d(center + new Vector3d(-off.x, -off.y, off.z)),
                new Vector3d(center + new Vector3d(off.x, -off.y, off.z)),
                new Vector3d(center + new Vector3d(off.x, off.y, off.z)),
                new Vector3d(center + new Vector3d(-off.x, off.y, off.z))
            };
            Vector3d[] bot = new Vector3d[4] {
                new Vector3d(center - off),
                new Vector3d(center + new Vector3d(off.x, -off.y, -off.z)),
                new Vector3d(center + new Vector3d(off.x, off.y, -off.z)),
                new Vector3d(center + new Vector3d(-off.x, off.y, -off.z))
            };
            Polygon3D p1 = new Polygon3D(top);
            Polygon3D p2 = new Polygon3D(bot);

            return(new Prism(p1, p2));
        }// CreateCuboid
Ejemplo n.º 4
0
        public Object clone()
        {
            Polygon3D cloned = new Polygon3D(this.points3d);

            return(cloned);
        }