Example #1
0
        /// <summary>
        /// Create geometry representation of wobj.
        /// </summary>
        /// <param name="frame">Wobj frame at cube centroid</param>
        /// <returns></returns>
        private static Solid vis_wobj(Plane frame)
        {
            List <Solid>     model = new List <Solid>();
            CoordinateSystem cs    = CoordinateSystem.ByPlane(frame);
            Vector           z     = frame.Normal.Reverse();
            double           h     = frame.Origin.Z;

            //Solid cube = Cuboid.ByLengths(cs, 40, 40, 40);
            Solid chu0 = Cylinder.ByCoordinateSystemHeightRadii(cs.Translate(cs.ZAxis.Reverse(), 2 + 20), 2, 10, 10);
            Solid bod0 = Cylinder.ByCoordinateSystemHeightRadii(cs.Translate(cs.ZAxis.Reverse(), 18 + 2 + 20), 18, 22, 22);
            Solid bod1 = Cuboid.ByLengths(cs.Translate(z, h - 18 - (h - 18 - 18 - 2 - 20) / 2), 46, 46, h - 18 - 18 - 2 - 20);
            Solid bod2 = Cylinder.ByCoordinateSystemHeightRadii(cs.Translate(z, h), 18, 22, 22);

            //model.Add(cube);
            model.Add(chu0);
            model.Add(bod0);
            model.Add(bod1);
            model.Add(bod2);

            Solid solid = Solid.ByUnion(model);

            return(solid);
        }