本文整理汇总了C#中HelixToolkit.Wpf.MeshBuilder.AddCircleInZCross方法的典型用法代码示例。如果您正苦于以下问题:C# MeshBuilder.AddCircleInZCross方法的具体用法?C# MeshBuilder.AddCircleInZCross怎么用?C# MeshBuilder.AddCircleInZCross使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HelixToolkit.Wpf.MeshBuilder
的用法示例。
在下文中一共展示了MeshBuilder.AddCircleInZCross方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateModel
//.........这里部分代码省略.........
{
// draw faces in z directions
mb = new MeshBuilder();
mb.AddRectangularMesh(
new[] {
new Point3D(rectDraw.X,rectDraw.Y,rectDraw.Z), //0,0,0
new Point3D(rectDraw.X+rectDraw.SizeX,rectDraw.Y,rectDraw.Z), //1,0,0
new Point3D(rectDraw.X,rectDraw.Y+rectDraw.SizeY,rectDraw.Z), //0,1,0
new Point3D(rectDraw.X+rectDraw.SizeX,rectDraw.Y+rectDraw.SizeY,rectDraw.Z) //1,1,0
}, 2);
plotModel.Children.Add(new GeometryModel3D(mb.ToMesh(), MaterialHelper.CreateMaterial(znBrush)));
mb = new MeshBuilder(); mb.AddRectangularMesh(
new[] {
new Point3D(rectDraw.X,rectDraw.Y+rectDraw.SizeY,rectDraw.Z+rectDraw.SizeZ), // 0,1,1
new Point3D(rectDraw.X+rectDraw.SizeX,rectDraw.Y+rectDraw.SizeY,rectDraw.Z+rectDraw.SizeZ), // 1,1,1
new Point3D(rectDraw.X,rectDraw.Y,rectDraw.Z+rectDraw.SizeZ), // 0,0,1
new Point3D(rectDraw.X+rectDraw.SizeX,rectDraw.Y,rectDraw.Z+rectDraw.SizeZ) // 1,0,1
}
, 2);
plotModel.Children.Add(new GeometryModel3D(mb.ToMesh(), MaterialHelper.CreateMaterial(zpBrush)));
// draw faces in y directions
mb = new MeshBuilder();
mb.AddRectangularMesh(
new[] {
new Point3D(rectDraw.X,rectDraw.Y,rectDraw.Z),
new Point3D(rectDraw.X,rectDraw.Y,rectDraw.Z+rectDraw.SizeZ),
new Point3D(rectDraw.X+rectDraw.SizeX,rectDraw.Y,rectDraw.Z),
new Point3D(rectDraw.X+rectDraw.SizeX,rectDraw.Y,rectDraw.Z+rectDraw.SizeZ)
}, 2);
plotModel.Children.Add(new GeometryModel3D(mb.ToMesh(), MaterialHelper.CreateMaterial(ynBrush)));
mb = new MeshBuilder(); mb.AddRectangularMesh(
new[] {
new Point3D(rectDraw.X+rectDraw.SizeX,rectDraw.Y+rectDraw.SizeY,rectDraw.Z),
new Point3D(rectDraw.X+rectDraw.SizeX,rectDraw.Y+rectDraw.SizeY,rectDraw.Z+rectDraw.SizeZ),
new Point3D(rectDraw.X,rectDraw.Y+rectDraw.SizeY,rectDraw.Z),
new Point3D(rectDraw.X,rectDraw.Y+rectDraw.SizeY,rectDraw.Z+rectDraw.SizeZ)
}, 2);
plotModel.Children.Add(new GeometryModel3D(mb.ToMesh(), MaterialHelper.CreateMaterial(ypBrush)));
// draw faces in x directions
mb = new MeshBuilder();
mb.AddRectangularMesh(
new[] {
new Point3D(rectDraw.X,rectDraw.Y,rectDraw.Z),
new Point3D(rectDraw.X,rectDraw.Y+rectDraw.SizeY,rectDraw.Z),
new Point3D(rectDraw.X,rectDraw.Y,rectDraw.Z+rectDraw.SizeZ),
new Point3D(rectDraw.X,rectDraw.Y+rectDraw.SizeY,rectDraw.Z+rectDraw.SizeZ)
}, 2);
plotModel.Children.Add(new GeometryModel3D(mb.ToMesh(), MaterialHelper.CreateMaterial(xnBrush)));
mb = new MeshBuilder(); mb.AddRectangularMesh(
new[] {
new Point3D(rectDraw.X+rectDraw.SizeX,rectDraw.Y,rectDraw.Z+rectDraw.SizeZ),
new Point3D(rectDraw.X+rectDraw.SizeX,rectDraw.Y+rectDraw.SizeY,rectDraw.Z+rectDraw.SizeZ),
new Point3D(rectDraw.X+rectDraw.SizeX,rectDraw.Y,rectDraw.Z),
new Point3D(rectDraw.X+rectDraw.SizeX,rectDraw.Y+rectDraw.SizeY,rectDraw.Z)
}, 2);
plotModel.Children.Add(new GeometryModel3D(mb.ToMesh(), MaterialHelper.CreateMaterial(xpBrush)));
}
if (isCylindarMode)
{
int div = 121;
mb = new MeshBuilder();
double s = Math.Min(_realRect3D.SizeX, _realRect3D.SizeY);
double shiftx = (_realRect3D.SizeX - s) / 2;
double shifty = (_realRect3D.SizeY - s) / 2;
var startCentre = new Point3D(Centre.X * s + shiftx, Centre.Y * s + shifty, rectDraw.Z);
var endCentre = new Point3D(Centre.X * s + shiftx, Centre.Y * s + shifty, rectDraw.Z + rectDraw.SizeZ);
double r = Radius * s;
mb.AddCylindarZ(startCentre, r, rectDraw.SizeZ, div);
plotModel.Children.Add(new GeometryModel3D(mb.ToMesh(), MaterialHelper.CreateMaterial(expBrush)));
mb = new MeshBuilder();
mb.AddCircleInZCross(startCentre, r, div, false);
znBrush.Viewbox = new Rect((startCentre.X - r) / _realRect3D.SizeX, (startCentre.Y - r) / _realRect3D.SizeY, (2 * r) / _realRect3D.SizeX, (2 * r) / _realRect3D.SizeY);
plotModel.Children.Add(new GeometryModel3D(mb.ToMesh(), MaterialHelper.CreateMaterial(znBrush)));
mb = new MeshBuilder();
mb.AddCircleInZCross(endCentre, r, div, true);
zpBrush.Viewbox = new Rect((startCentre.X - r) / _realRect3D.SizeX, (startCentre.Y - r) / _realRect3D.SizeY, (2 * r) / _realRect3D.SizeX, (2 * r) / _realRect3D.SizeY);
zpBrush.Transform = null;
plotModel.Children.Add(new GeometryModel3D(mb.ToMesh(), MaterialHelper.CreateMaterial(zpBrush)));
}
return plotModel;
}