Exemple #1
0
        /// <summary>
        /// 生成锥体
        /// </summary>
        /// <param name="m">造型接口</param>
        /// <param name="center">中心</param>
        /// <param name="axis">旋转轴</param>
        /// <param name="baseRadius">底部半径</param>
        /// <param name="topRadius">顶部半径</param>
        /// <param name="height">高度</param>
        /// <returns></returns>
        public static IBody2 CreateCone
            (this IModeler m, Vector3 center, Vector3 axis, double baseRadius, double topRadius, double height)
        {
            var array = center.ToDoubles().Concat(axis.ToDoubles()).Concat(new[] { baseRadius, topRadius, height }).ToArray();

            return((IBody2)m.CreateBodyFromCone(array));
        }
Exemple #2
0
        public IXBody CreateCone(Point center, Vector axis, Vector refDir, double baseRadius, double topRadius, double height)
        {
            var coneBody = m_Modeler.CreateBodyFromCone(new double[]
            {
                center.X, center.Y, center.Z,
                axis.X, axis.Y, axis.Z,
                baseRadius, topRadius, height
            }) as IBody2;

            if (coneBody == null)
            {
                throw new NullReferenceException("Failed to generate cone body");
            }

            return(new SwTempBody(coneBody));
        }