private void InitSection() { CrossSection.Regen(0.0); SectionWidth = CrossSection.BoxSize.X; SectionHeight = CrossSection.BoxSize.Y; }
private void InitializeView() { var length = Vector3D.Distance(this.StartPoint, this.EndPoint); var transformation = new Transformation(); transformation.Rotation(Point3D.Origin, Vector3D.AxisZ, Vector3D.AxisY, -1.0 * Vector3D.AxisX, StartPoint, V1, V2, V3); CrossSection.Regen(0.01); this.SectionWidth = CrossSection.BoxSize.X; this.SectionHeight = CrossSection.BoxSize.Y; Point3D bboxMid = (CrossSection.BoxMax + CrossSection.BoxMin) / 2.0; CrossSection.Translate(-bboxMid.X, -bboxMid.Y, bboxMid.Z); View = CrossSection.ExtrudeAsSolid <FFSolid>(length * Vector3D.AxisZ, 0.01); View.Rotate(Position.SectionRotation.ToRadian(), Vector3D.AxisZ); var wirePnts = new List <Point3D>(); #region Local Axis of the Frame wirePnts.Add((Point3D)Point3D.Origin.Clone()); wirePnts.Add(new Point3D(0, 0, length)); wirePnts.Add(new Point3D(0, 0, 0.5 * length)); wirePnts.Add(new Point3D(0, 300, 0.5 * length)); wirePnts.Add(new Point3D(0, 300, 0.5 * length)); wirePnts.Add(new Point3D(100, 200, 0.5 * length)); wirePnts.Add(new Point3D(0, 300, 0.5 * length)); wirePnts.Add(new Point3D(-100, 200, 0.5 * length)); wirePnts.Add(new Point3D(0, 0, 0.5 * length)); wirePnts.Add(new Point3D(-300, 0, 0.5 * length)); wirePnts.Add(new Point3D(-300, 0, 0.5 * length)); wirePnts.Add(new Point3D(-200, 100, 0.5 * length)); wirePnts.Add(new Point3D(-300, 0, 0.5 * length)); wirePnts.Add(new Point3D(-200, -100, 0.5 * length)); wirePnts.Add(new Point3D(0, 0, 0.5 * length)); wirePnts.Add(new Point3D(0, 0, 0.5 * length + 300)); wirePnts.Add(new Point3D(0, 0, 0.5 * length + 300)); wirePnts.Add(new Point3D(100, 0, 0.5 * length + 200)); wirePnts.Add(new Point3D(0, 0, 0.5 * length + 300)); wirePnts.Add(new Point3D(-100, 0, 0.5 * length + 200)); wirePnts.ForEach(item => item.TransformBy(transformation)); #endregion View.wireVertices = wirePnts.ToArray(); View.TransformBy(transformation); View.Parent = this; }