Beispiel #1
0
        /// <summary>   Initializes a new instance of the Cylinder class. </summary>
        ///
        /// <param name="Center">           The center. </param>
        /// <param name="NSides">           The sides. </param>
        /// <param name="FrontRadius">      The front radius. </param>
        /// <param name="BackRadius">       The back radius. </param>
        /// <param name="Length">           The length. </param>
        /// <param name="rotation_point">   The rotation point. </param>
        /// <param name="radians">          The radians. </param>
        public Cylinder(Point3D Center, int NSides, double FrontRadius, double BackRadius,
                        double Length, Point3D rotation_point, double radians)
        {
            center      = Center;
            nSides      = NSides;
            frontRadius = FrontRadius;
            backRadius  = BackRadius;
            length      = Length;

            front      = new ObjectCircle(nSides, center, frontRadius);
            backcenter = new Point3D(center.X, center.Y, center.Z - length);
            back       = new ObjectCircle(nSides, backcenter, backRadius);

            RotateZY(rotation_point, radians);
        }
Beispiel #2
0
        /// <summary>   Initializes a new instance of the Cylinder class. </summary>
        ///
        /// <param name="Center">       The center. </param>
        /// <param name="NSides">       The sides. </param>
        /// <param name="FrontRadius">  The front radius. </param>
        /// <param name="BackRadius">   The back radius. </param>
        /// <param name="Length">       The length. </param>
        public Cylinder(Point3D Center, int NSides, double FrontRadius, double BackRadius, 
            double Length)
        {
            center = Center;
            nSides = NSides;
            frontRadius = FrontRadius;
            backRadius = BackRadius;
            length = Length;

            front = new ObjectCircle(nSides, center, frontRadius);

            backcenter = new Point3D(center.X, center.Y, center.Z - length);

            back = new ObjectCircle(nSides, backcenter, backRadius);
        }
Beispiel #3
0
        /// <summary>   Creates circle model. </summary>
        ///
        /// <param name="NSides">   The sides. </param>
        /// <param name="Center">   The center. </param>
        /// <param name="Diameter"> The diameter. </param>
        ///
        /// <returns>   The new circle model. </returns>
        public static GeometryModel3D CreateCircleModel(int NSides, Point3D Center, double Diameter)
        {
            MeshGeometry3D mesh = new MeshGeometry3D();

            ObjectCircle circle = new ObjectCircle(NSides, Center, Diameter);

            circle.addToMesh(mesh, false);

            Material material = new DiffuseMaterial(
                new SolidColorBrush(Colors.White));

            GeometryModel3D model = new GeometryModel3D(mesh, material);

            return(model);
        }
Beispiel #4
0
        /// <summary>   Creates circle model. </summary>
        ///
        /// <param name="NSides">   The sides. </param>
        /// <param name="Center">   The center. </param>
        /// <param name="Diameter"> The diameter. </param>
        ///
        /// <returns>   The new circle model. </returns>
        public static GeometryModel3D CreateCircleModel(int NSides, Point3D Center, double Diameter)
        {
            MeshGeometry3D mesh = new MeshGeometry3D();

            ObjectCircle circle = new ObjectCircle(NSides, Center, Diameter);

            circle.addToMesh(mesh, false);

            Material material = new DiffuseMaterial(
                new SolidColorBrush(Colors.White));

            GeometryModel3D model = new GeometryModel3D(mesh, material);

            return model;
        }