本文整理汇总了C#中Line.Transform方法的典型用法代码示例。如果您正苦于以下问题:C# Line.Transform方法的具体用法?C# Line.Transform怎么用?C# Line.Transform使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Line
的用法示例。
在下文中一共展示了Line.Transform方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: box
Polyline box(Line l)
{
Polyline pl = new Polyline();
Line l2 = new Line(l.From, l.To);
l2.Transform(Transform.Rotation(Math.PI / 2, (l.From + l.To) / 2));
pl.Add(l.From);
pl.Add(l2.From);
pl.Add(l.To);
pl.Add(l2.To);
Plane p = new Plane(pl[0], pl[1], pl[2]);
if (Vector3d.VectorAngle(p.Normal, Vector3d.ZAxis) > Math.PI / 2) pl.Reverse();
pl.Add(pl[0]);
return pl;
}
示例2: Joint
Mesh Joint(Polyline pl1, Polyline pl2, double u, double v, double w)
{
Mesh mesh = new Mesh();
Vector3d v11 = new Vector3d(pl1[2] - pl1[0]);
v11.Unitize(); v11 *= (Math.Sqrt(2) * u) / 2;
Line l12 = new Line(pl1[0] - v11, pl1[0] + v11);
Line l11 = new Line(l12.From, l12.To);
Line l13 = new Line(l12.From, l12.To);
Vector3d v12 = pl1[1] - pl1[0];
v12.Unitize(); v12 *= w;
Vector3d v13 = pl1[3] - pl1[0];
v13.Unitize(); v13 *= w;
l13.Transform(Transform.Translation(v12));
l11.Transform(Transform.Translation(v13));
l11.Transform(Transform.Translation(new Vector3d(0, 0, v / 2)));
l12.Transform(Transform.Translation(new Vector3d(0, 0, v / 2)));
l13.Transform(Transform.Translation(new Vector3d(0, 0, v / 2)));
mesh.Append(MT.MeshLoft(l11, l12));
mesh.Append(MT.MeshLoft(l12, l13));
Vector3d v21 = new Vector3d(pl2[2] - pl2[0]);
v21.Unitize(); v21 *= (Math.Sqrt(2) * u) / 2;
Line l22 = new Line(pl2[0] - v21, pl2[0] + v21);
Line l21 = new Line(l22.From, l22.To);
Line l23 = new Line(l22.From, l22.To);
Vector3d v22 = pl2[1] - pl2[0];
v22.Unitize(); v22 *= w;
Vector3d v23 = pl2[3] - pl2[0];
v23.Unitize(); v23 *= w;
l23.Transform(Transform.Translation(v22));
l21.Transform(Transform.Translation(v23));
l21.Transform(Transform.Translation(new Vector3d(0, 0, -v / 2)));
l22.Transform(Transform.Translation(new Vector3d(0, 0, -v / 2)));
l23.Transform(Transform.Translation(new Vector3d(0, 0, -v / 2)));
mesh.Append(MT.MeshLoft(l21, l22));
mesh.Append(MT.MeshLoft(l22, l23));
mesh.Append(MT.MeshLoft(l12, l22));
return mesh;
}