当前位置: 首页>>代码示例>>C#>>正文


C# Rhino.Duplicate方法代码示例

本文整理汇总了C#中Rhino.Duplicate方法的典型用法代码示例。如果您正苦于以下问题:C# Rhino.Duplicate方法的具体用法?C# Rhino.Duplicate怎么用?C# Rhino.Duplicate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Rhino的用法示例。


在下文中一共展示了Rhino.Duplicate方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: BakeGeometry

        public override void BakeGeometry(Rhino.RhinoDoc doc, Rhino.DocObjects.ObjectAttributes att, List<Guid> obj_ids)
        {
            Rhino.Geometry.Transform zDown_airy = Rhino.Geometry.Transform.Translation(0, 0, 2d);
            Rhino.DocObjects.ObjectAttributes a2 = att.Duplicate();
            a2.LayerIndex = 2;
            Rhino.DocObjects.ObjectAttributes a3 = att.Duplicate();
            a3.LayerIndex = 3;
            Rhino.DocObjects.ObjectAttributes a4 = att.Duplicate();
            a4.LayerIndex = 4;
            Rhino.DocObjects.ObjectAttributes a5 = att.Duplicate();
            a5.LayerIndex = 5;
            Rhino.DocObjects.ObjectAttributes a6 = att.Duplicate();
            a6.LayerIndex = 6;
            Rhino.DocObjects.ObjectAttributes a7 = att.Duplicate();
            a7.LayerIndex = 7;
            foreach (var leaf in listLeaf)
            {
                var airySrf=leaf.airySrf.Duplicate() as Rhino.Geometry.NurbsSurface;
                airySrf.Transform(zScale);
                airySrf.Transform(zDown_airy);
                Guid id = doc.Objects.AddSurface(airySrf, a2);
                obj_ids.Add(id);
                var srf = leaf.shellSrf.Duplicate() as Rhino.Geometry.NurbsSurface;
                srf.Transform(zDown_eq);
                id = doc.Objects.AddSurface(srf, a3);
                obj_ids.Add(id);
            }
            foreach (var branch in listBranch)
            {
                //var airyCrv=branch.airyCrv.Duplicate() as Rhino.Geometry.NurbsCurve;
                //airyCrv.Transform(zDown_airy);
                //Guid id = doc.Objects.AddCurve(airyCrv, a2);
                //obj_ids.Add(id);
                if (branch.branchType == branch.type.kink || branch.branchType == branch.type.reinforce||branch.branchType == branch.type.open)
                {
                    var crv = branch.shellCrv.Duplicate() as Rhino.Geometry.NurbsCurve;
                    crv.Transform(zDown_eq);
                    Guid id = doc.Objects.AddCurve(crv, a7);
                    obj_ids.Add(id);
                }
            }
            if (crossMagenta != null)
            {
                foreach (var line in crossMagenta)
                {
                    Guid id = doc.Objects.AddLine(line, a4);
                    obj_ids.Add(id);
                }
            }
            if (listBranch != null)
            {
                foreach (var branch in listBranch)
                {
                    if (branch.branchType == branch.type.fix)
                    {
                        if (branch.tuples != null)
                        {
                            foreach (var tup in branch.tuples)
                            {
                                var circle = new Rhino.Geometry.Circle(new Rhino.Geometry.Point3d(tup.x, tup.y, tup.z), 0.5);
                                circle.Transform(zDown);
                                Guid id = doc.Objects.AddCircle(circle, a6);
                                obj_ids.Add(id);
                                circle = new Rhino.Geometry.Circle(new Rhino.Geometry.Point3d(tup.x, tup.y, branch.slice2.height), 0.5);
                                circle.Transform(zDown_eq);
                                id = doc.Objects.AddCircle(circle, a6);
                                obj_ids.Add(id);
                            }
                        }
                    }
                    if (branch.branchType == branch.type.kink || branch.branchType == branch.type.reinforce||branch.branchType==branch.type.open)
                    {
                        if (branch.tuples != null)
                        {
                            foreach (var tup in branch.tuples)
                            {
                                var D = tup.SPK[0, 0]/2d;
                                if (D > 0)
                                {
                                    var line = new Rhino.Geometry.Line(new Rhino.Geometry.Point3d(tup.x, tup.y, tup.z), new Rhino.Geometry.Point3d(tup.x, tup.y, tup.z + D));
                                    line.Transform(zDown);
                                    Guid id = doc.Objects.AddLine(line, a5);
                                    obj_ids.Add(id);
                                }
                            }
                        }
                    }

                }
            }
        }
开发者ID:liulei2776,项目名称:Mothra5,代码行数:91,代码来源:Bake.cs


注:本文中的Rhino.Duplicate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。