本文整理汇总了C#中System.Edge.Tessellate方法的典型用法代码示例。如果您正苦于以下问题:C# Edge.Tessellate方法的具体用法?C# Edge.Tessellate怎么用?C# Edge.Tessellate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Edge
的用法示例。
在下文中一共展示了Edge.Tessellate方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Stream
private void Stream(ArrayList data, Edge edge)
{
data.Add(new Snoop.Data.ClassSeparator(typeof(Edge)));
// Curve Type
{
string curveType = "None";
if (edge.AsCurve() != null)
{
Curve crv = edge.AsCurve();
if (crv is Arc)
curveType = "Arc";
else if (crv is CylindricalHelix)
curveType = "CylindricalHelix";
else if (crv is Ellipse)
curveType = "Ellipse";
else if (crv is HermiteSpline)
curveType = "HermiteSpline";
else if (crv is Line)
curveType = "Line";
else if (crv is NurbSpline)
curveType = "NurbSpline";
}
data.Add(new Snoop.Data.String("Curve Type", curveType));
}
try
{
data.Add(new Snoop.Data.Object("Curve", edge.AsCurve()));
}
catch (System.Exception ex)
{
data.Add(new Snoop.Data.Exception("Curve", ex));
}
try
{
data.Add(new Snoop.Data.Object("Start point reference", edge.GetEndPointReference(0)));
}
catch (System.Exception ex)
{
data.Add(new Snoop.Data.Exception("Start point reference", ex));
}
try
{
data.Add(new Snoop.Data.Object("End point reference", edge.GetEndPointReference(1)));
}
catch (System.Exception ex)
{
data.Add(new Snoop.Data.Exception("End point reference", ex));
}
data.Add(new Snoop.Data.Object("Reference", edge.Reference));
data.Add(new Snoop.Data.Double("Approximate length", edge.ApproximateLength));
data.Add(new Snoop.Data.Object("Face [0]", edge.GetFace(0)));
data.Add(new Snoop.Data.Object("Face [1]", edge.GetFace(1)));
data.Add(new Snoop.Data.CategorySeparator("Tesselated Points"));
System.Collections.Generic.IList<XYZ> pts = edge.Tessellate();
int i = 0;
foreach (XYZ pt in pts)
{
data.Add(new Snoop.Data.Xyz(string.Format("PT [{0:d}]", i++), pt));
}
// TBD: not sure how to use these yet...
// TesselateOnFace ??
}
示例2: IsVerticalEdge
/// <summary>
/// Determines whether a edge is vertical.
/// </summary>
/// <param name="edge">The edge to be determined.</param>
/// <returns>Return true if this edge is vertical, or else return false.</returns>
public static bool IsVerticalEdge(Edge edge)
{
List<XYZ> polyline = edge.Tessellate() as List<XYZ>;
Autodesk.Revit.DB.XYZ verticalVct = new Autodesk.Revit.DB.XYZ (0, 0, 1);
Autodesk.Revit.DB.XYZ pointBuffer = polyline[0];
for (int i = 1; i < polyline.Count; i = i + 1)
{
Autodesk.Revit.DB.XYZ temp = polyline[i];
Autodesk.Revit.DB.XYZ vector = GetVector(pointBuffer, temp);
if (Equal(vector, verticalVct))
{
return true;
}
else
{
continue;
}
}
return false;
}
示例3: EdgeBinding
/// <summary>
/// Constructor takes Edge as parameter.
/// </summary>
/// <param name="edge">Edge</param>
public EdgeBinding(Edge edge)
{
m_points = edge.Tessellate();
m_pen = new Pen(System.Drawing.Color.White);
Reset();
}
示例4: Stream
public virtual void Stream(Edge edge)
{
IList<XYZ> ptArray = edge.Tessellate();
int len = ptArray.Count;
for (int i=0; i < (len - 1); i++) {
Stream(ptArray[i], ptArray[i + 1]);
}
}
示例5: IsLinesParallel
/// <summary>
/// check whether 2 edges are parallel
/// </summary>
/// <param name="edgeA">
/// the edge to be checked
/// </param>
/// <param name="edgeB">
/// the edge to be checked
/// </param>
/// <returns>
/// if they're parallel, return true; otherwise false
/// </returns>
private bool IsLinesParallel(Edge edgeA, Edge edgeB)
{
List<XYZ> pointsA = edgeA.Tessellate() as List<XYZ>;
List<XYZ> pointsB = edgeB.Tessellate() as List<XYZ>;
Autodesk.Revit.DB.XYZ vectorA = pointsA[1] - pointsA[0];
Autodesk.Revit.DB.XYZ vectorB = pointsB[1] - pointsB[0];
Utility.Vector4 vec4A = new Utility.Vector4(vectorA);
Utility.Vector4 vec4B = new Utility.Vector4(vectorB);
return IsLinesParallel(vec4A, vec4B);
}
示例6: ComputeCrossProduct
/// <summary>
/// compute the cross product of 2 edges
/// </summary>
/// <param name="edgeA">
/// the edge for the cross product
/// </param>
/// <param name="edgeB">
/// the edge for the cross product
/// </param>
/// <returns>
/// the cross product of 2 edges
/// </returns>
private Utility.Vector4 ComputeCrossProduct(Edge edgeA, Edge edgeB)
{
List<XYZ> pointsA = edgeA.Tessellate() as List<XYZ>;
List<XYZ> pointsB = edgeB.Tessellate() as List<XYZ>;
Autodesk.Revit.DB.XYZ vectorA = pointsA[1] - pointsA[0];
Autodesk.Revit.DB.XYZ vectorB = pointsB[1] - pointsB[0];
Utility.Vector4 vec4A = new Utility.Vector4(vectorA);
Utility.Vector4 vec4B = new Utility.Vector4(vectorB);
return Utility.Vector4.CrossProduct(vec4A, vec4B);
}