ThroughCurves(UG二次开发)

本文介绍了一种使用四条曲线来创建曲面的方法,该方法涉及参数设置如曲线数量、对齐方式等,并详细展示了创建过程中的关键步骤及所需使用的数据结构。

   /// <summary>
        /// 通过曲线创建曲面(4条曲线)
        /// </summary>
        /// <param name="spline_tags"></param>
        /// <param name="spline_count"></param>
        /// <param name="thrCurvesTag"></param>
        public void CreateThrCurves2(Tag[] section_tags, int spline_count, out Tag thrCurvesTag)
        {
            try
            {
                int i = 0;
                int patch = 2;
                int alignment = 1;  //对齐方式 
                int vstatus = 0;
                int vdegree = 3;
                int body_type = 1;
                double[] tol = new double[3] { 0.025, 0.025, 0.025 };
                int[] c_flag = new int[2] { 0, 0 };
                Tag[] c_face_id = new Tag[2] { Tag.Null, Tag.Null };
                double[] value = new double[6] { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 };
                StringList s_section = new StringList();
                theUFSession.Modl.InitStringList(ref s_section);
                theUFSession.Modl.CreateStringList(spline_count, 4 * spline_count, ref s_section);
                s_section.num = spline_count;
                for (i = 0; i < spline_count; i++)
                {
                    s_section._string[i] = 4;
                    s_section.dir[i] = 1;
                }
                for (i = 0; i < 4 * spline_count; i++)
                {
                    s_section.id[i] = section_tags[i];
                }

                StringList s_spine = new StringList();
                theUFSession.Modl.CreateThruCurves(ref s_section, ref s_spine, ref patch, ref alignment,
                    value, ref vdegree, ref vstatus, ref body_type, FeatureSigns.Nullsign, tol, c_face_id, c_flag, out thrCurvesTag);
            }
            catch (NXException ex)
            {
                MessageBox.Show(ex.ToString());
                thrCurvesTag = Tag.Null;
            }
        }

转载于:https://www.cnblogs.com/yyFisheep/archive/2012/09/18/2690730.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值