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


C# MeshBuilder.AddPipe方法代码示例

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


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

示例1: UpdateGeometry

 /// <summary>
 /// Updates the geometry.
 /// </summary>
 protected override void UpdateGeometry()
 {
     var mb = new MeshBuilder(false, false);
     var p0 = new Point3D(0, 0, 0);
     var d = this.Axis;
     d.Normalize();
     var p1 = p0 - (d * this.Length * 0.5);
     var p2 = p0 + (d * this.Length * 0.5);
     mb.AddPipe(p1, p2, this.InnerDiameter, this.Diameter, 60);
     this.Model.Geometry = mb.ToMesh();
 }
开发者ID:chantsunman,项目名称:helix-toolkit,代码行数:14,代码来源:BindableRotateManipulator.cs

示例2: Tessellate

 /// <summary>
 /// Do the tessellation and return the <see cref="MeshGeometry3D" />.
 /// </summary>
 /// <returns>
 /// A triangular mesh geometry.
 /// </returns>
 protected override MeshGeometry3D Tessellate()
 {
     var builder = new MeshBuilder(false, true);
     builder.AddPipe(this.Point1, this.Point2, this.InnerDiameter, this.Diameter, this.ThetaDiv);
     return builder.ToMesh();
 }
开发者ID:chantsunman,项目名称:helix-toolkit,代码行数:12,代码来源:PipeVisual3D.cs

示例3: CreateArea

        private void CreateArea(LineOfSightArea area)
        {
            Model3DGroup group = Model as Model3DGroup;

            Model3DCollection collection = new Model3DCollection();
            try
            {
                if (_mapping[area] != null)
                {
                    foreach (Model3D model in _mapping[area])
                    {
                        group.Children.Remove(model);
                    }
                }
            }
            catch (KeyNotFoundException)
            {
                //nothing needs to be done
            }

            foreach (var vertex in area.Vertices)
            {
                MeshBuilder builder = new MeshBuilder();
                Point3D p1 = new Point3D(vertex.X, vertex.Y, area.MaxZ);
                Point3D p2 = new Point3D(vertex.X, vertex.Y, area.MinZ);

                //if (Clipping != null && !Clipping.DrawPoint(p)) continue;

                builder.AddBox(p1, 4, 4, 4);
                builder.AddBox(p2, 4, 4, 4);
                builder.AddPipe(p1, p2, 1.5, 1.5, 50);

                GeometryModel3D box = new GeometryModel3D(builder.ToMesh(), Materials.Yellow);
                collection.Add(box);

                builder = new MeshBuilder();

                Point3D next;
                if (vertex == area.Vertices.Last())
                {
                    next = area.Vertices[0];
                }
                else
                {
                    next = area.Vertices.ElementAt(area.Vertices.IndexOf(vertex) + 1);
                }
                Point3D n1 = new Point3D(next.X, next.Y, area.MaxZ);
                Point3D n2 = new Point3D(next.X, next.Y, area.MinZ);

                //builder.AddPipe(p1, p2);
                builder.AddPipe(p1, n1, 0.5, 0.5, 50);
                builder.AddPipe(p2, n2, 0.5, 0.5, 50);
                collection.Add(new GeometryModel3D(builder.ToMesh(), Materials.Yellow));

            }

            _mapping[area] = collection;
            foreach (Model3D model in collection)
            {
                group.Children.Add(model);
            }
        }
开发者ID:Unchated,项目名称:pogee-3d-editor,代码行数:62,代码来源:LineOfSightAreaDisplay3D.cs

示例4: Tessellate

        protected override MeshGeometry3D Tessellate()
        {
            double width = Columns*grid - margin*2;
            double length = Rows*grid - margin*2;
            double height = Height*plateThickness;
            var builder = new MeshBuilder(true, true);

            for (int i = 0; i < Columns; i++)
                for (int j = 0; j < Rows; j++)
                {
                    var o = new Point3D((i + 0.5)*grid, (j + 0.5)*grid, height);
                    builder.AddCone(o, new Vector3D(0, 0, 1), knobDiameter/2, knobDiameter/2, knobHeight, false, true,
                                    Divisions);
                    builder.AddPipe(new Point3D(o.X, o.Y, o.Z - wallThickness), new Point3D(o.X, o.Y, wallThickness),
                                    knobDiameter, outerDiameter, Divisions);
                }

            builder.AddBox(new Point3D(Columns * 0.5 * grid, Rows * 0.5 * grid, height - wallThickness / 2), width, length,
                          wallThickness,
                          MeshBuilder.BoxFaces.All);
            builder.AddBox(new Point3D(margin + wallThickness / 2, Rows * 0.5 * grid, height / 2 - wallThickness / 2),
                           wallThickness, length, height - wallThickness,
                           MeshBuilder.BoxFaces.All ^ MeshBuilder.BoxFaces.Top);
            builder.AddBox(
                new Point3D(Columns * grid - margin - wallThickness / 2, Rows * 0.5 * grid, height / 2 - wallThickness / 2),
                wallThickness, length, height - wallThickness,
                MeshBuilder.BoxFaces.All ^ MeshBuilder.BoxFaces.Top);
            builder.AddBox(new Point3D(Columns * 0.5 * grid, margin + wallThickness / 2, height / 2 - wallThickness / 2),
                           width, wallThickness, height - wallThickness,
                           MeshBuilder.BoxFaces.All ^ MeshBuilder.BoxFaces.Top);
            builder.AddBox(
                new Point3D(Columns * 0.5 * grid, Rows * grid - margin - wallThickness / 2, height / 2 - wallThickness / 2),
                width, wallThickness, height - wallThickness,
                MeshBuilder.BoxFaces.All ^ MeshBuilder.BoxFaces.Top);

            return builder.ToMesh();
        }
开发者ID:chantsunman,项目名称:helix-toolkit,代码行数:37,代码来源:LegoVisual3D.cs

示例5: CreateArea

        private void CreateArea(RoamArea area)
        {
            Model3DGroup group = Model as Model3DGroup;

            Model3DCollection collection = new Model3DCollection();
            if (_mapping.ContainsKey(area))
            {
                foreach (Model3D model in _mapping[area])
                {
                    group.Children.Remove(model);
                }
            }

            foreach (var vertex in area.Vertices)
            {
                MeshBuilder builder = new MeshBuilder();
                Point3D p1 = new Point3D(vertex.X, vertex.Y, area.MaxZ);
                Point3D p2 = new Point3D(vertex.X, vertex.Y, area.MinZ);

                //if (Clipping != null && !Clipping.DrawPoint(p)) continue;

                builder.AddBox(p1, 4, 4, 4);
                builder.AddBox(p2, 4, 4, 4);
                builder.AddPipe(p1, p2, 1.5, 1.5, 50);

                GeometryModel3D box = new GeometryModel3D(builder.ToMesh(), Materials.Yellow);
                collection.Add(box);

                builder = new MeshBuilder();

                Point3D next = new Point3D();
                if (vertex == area.Vertices.Last())
                {
                    next.X = area.Vertices[0].X;
                    next.Y = area.Vertices[0].Y;
                }
                else
                {
                    next.X = area.Vertices.ElementAt(area.Vertices.IndexOf(vertex) + 1).X;
                    next.Y = area.Vertices.ElementAt(area.Vertices.IndexOf(vertex) + 1).Y;
                }
                Point3D n1 = new Point3D(next.X, next.Y, area.MaxZ);
                Point3D n2 = new Point3D(next.X, next.Y, area.MinZ);

                //builder.AddPipe(p1, p2);
                builder.AddPipe(p1, n1, 0.5, 0.5, 50);
                builder.AddPipe(p2, n2, 0.5, 0.5, 50);
                collection.Add(new GeometryModel3D(builder.ToMesh(), Materials.Yellow));

            }

            _mapping[area] = collection;
            foreach (Model3D model in collection)
            {
                group.Children.Add(model);
            }
        }
开发者ID:Unchated,项目名称:pogee-3d-editor,代码行数:57,代码来源:RoamAreasDisplay3D.cs


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