Class ContinuousDimension
A linear dimension where start and end are projected onto the dimension line.
Examples
var l = Polygon.L(5, 5, 1);
var m = new Mass(l, 1, BuiltInMaterials.Glass);
this.Model.AddElement(m);
// Flatten all polygon points along the X axis and sort.
var pts = new List<Vector3>();
var yz = new Plane(Vector3.Origin, Vector3.YAxis);
foreach (var pt in l.Vertices)
{
var proj = pt.Project(yz);
if (!pts.Contains(proj))
{
pts.Add(proj);
}
}
pts.Sort(new DirectionComparer(Vector3.XAxis));
var dimensions = new List<LinearDimension>();
var refLine = new Line(new Vector3(0, 7, 0), new Vector3(5, 10, 0));
for (var i = 0; i < pts.Count - 1; i++)
{
var d = new ContinuousDimension(pts[i], pts[i + 1], refLine);
dimensions.Add(d);
}
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: Elements.Annotations
Assembly: Hypar.Elements.dll
Syntax
public class ContinuousDimension : LinearDimension, INotifyPropertyChanged, IOverrideLinked
Constructors
ContinuousDimension(Vector3, Vector3, Line)
Create a continuous dimension with an optional reference line. The start and end points will be projected onto the dimension line.
Declaration
public ContinuousDimension(Vector3 start, Vector3 end, Line dimensionLine)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | start | The start of the dimension. |
Vector3 | end | The end of the dimension. |
Line | dimensionLine | A line on which the start and end points will be projected. |
ContinuousDimension(Vector3, Vector3, Plane, String, String, String)
Create a continuous dimension from JSON.
Declaration
[JsonConstructor]
public ContinuousDimension(Vector3 start, Vector3 end, Plane referencePlane, string prefix = null, string suffix = null, string displayValue = null)
Parameters
Type | Name | Description |
---|---|---|
Vector3 | start | The start of the dimension. |
Vector3 | end | The end of the dimension. |
Plane | referencePlane | The plane on which the dimension will be projected. |
System.String | prefix | Text that appears before the dimension's value. |
System.String | suffix | Text that appears after the dimension's value. |
System.String | displayValue | Text that appears in place of the dimension's value. |
Implements
System.ComponentModel.INotifyPropertyChanged