public Line(EntityObject entity) : base(EdgeType.Line) { if (entity == null) { throw new ArgumentNullException("entity"); } Entities.Line line = entity as Entities.Line; if (line == null) { throw new ArgumentException("The entity is not a Line", "entity"); } this.Start = new Vector2(line.StartPoint.X, line.StartPoint.Y); this.End = new Vector2(line.EndPoint.X, line.EndPoint.Y); }
/// <summary> /// Initializes a new instance of the <c>HatchBoundaryPath.Line</c> class. /// </summary> /// <param name="entity"><see cref="EntityObject">Entity</see> that represents the edge.</param> public Line(EntityObject entity) : base(EdgeType.Line) { if (entity == null) { throw new ArgumentNullException(nameof(entity)); } Entities.Line line = entity as Entities.Line; if (line == null) { throw new ArgumentException("The entity is not a Line", nameof(entity)); } Vector3 point; Matrix3 trans = MathHelper.ArbitraryAxis(entity.Normal).Transpose(); point = trans * line.StartPoint; this.Start = new Vector2(point.X, point.Y); point = trans * line.EndPoint; this.End = new Vector2(point.X, point.Y); }