public void GetPolygonsDefineFace()
        {
            Document doc = Column.Document;
            Curve    c   = DrivingCurve;

            List <XYZ> ps = new List <XYZ> {
                c.GetEndPoint(0), c.GetEndPoint(1)
            };
            Transform tf = Column.GetTransform();

            XYZ vecX = tf.BasisX;
            XYZ vecY = tf.BasisY;
            XYZ vecZ = tf.BasisZ;

            List <XYZ> cenWidthPoints = new List <XYZ> {
                GeomUtil.OffsetPoint(ps[0], vecX, -Width / 2), GeomUtil.OffsetPoint(ps[1], vecX, -Width / 2),
                GeomUtil.OffsetPoint(ps[0], vecX, Width / 2), GeomUtil.OffsetPoint(ps[1], vecX, Width / 2)
            };

            cenWidthPoints.Sort(new ZYXComparer());
            XYZ temp = cenWidthPoints[2]; cenWidthPoints[2] = cenWidthPoints[3]; cenWidthPoints[3] = temp;

            List <XYZ> cenHeightPoints = new List <XYZ> {
                GeomUtil.OffsetPoint(ps[0], vecY, -Height / 2), GeomUtil.OffsetPoint(ps[1], vecY, -Height / 2),
                GeomUtil.OffsetPoint(ps[0], vecY, Height / 2), GeomUtil.OffsetPoint(ps[1], vecY, Height / 2)
            };

            cenHeightPoints.Sort(new ZYXComparer());
            temp = cenHeightPoints[2]; cenHeightPoints[2] = cenHeightPoints[3]; cenHeightPoints[3] = temp;

            ps = new List <XYZ> {
                (cenHeightPoints[0] + cenHeightPoints[3]) / 2, (cenHeightPoints[1] + cenHeightPoints[2]) / 2
            };
            List <XYZ> cenHozPoints = new List <XYZ> {
                GeomUtil.OffsetPoint(ps[0], vecX, -Width / 2), GeomUtil.OffsetPoint(ps[1], vecX, -Width / 2),
                GeomUtil.OffsetPoint(ps[0], vecX, Width / 2), GeomUtil.OffsetPoint(ps[1], vecX, Width / 2)
            };

            cenHozPoints.Sort(new ZYXComparer());
            temp = cenHozPoints[2]; cenHozPoints[2] = cenHozPoints[3]; cenHozPoints[3] = temp;

            CentralVerticalHeightPolygon = new Polygon(cenHeightPoints);
            CentralVerticalWidthPolygon  = new Polygon(cenWidthPoints);
            CentralHorizontalPolygon     = new Polygon(cenHozPoints);

            vecX                = GeomUtil.UnitVector(GeomUtil.IsBigger(vecX, -vecX) ? vecX : -vecX);
            vecY                = GeomUtil.UnitVector(GeomUtil.IsBigger(vecY, -vecY) ? vecY : -vecY);
            vecZ                = GeomUtil.UnitVector(GeomUtil.IsBigger(vecZ, -vecZ) ? vecZ : -vecZ);
            TopPolygon          = GeomUtil.OffsetPolygon(CentralHorizontalPolygon, vecZ, Length / 2);
            BottomPolygon       = GeomUtil.OffsetPolygon(CentralHorizontalPolygon, vecZ, -Length / 2);
            FirstHeightPolygon  = GeomUtil.OffsetPolygon(CentralVerticalHeightPolygon, vecX, -Width / 2);
            SecondHeightPolygon = GeomUtil.OffsetPolygon(CentralVerticalHeightPolygon, vecX, Width / 2);
            FirstWidthPolygon   = GeomUtil.OffsetPolygon(CentralVerticalWidthPolygon, vecY, -Height / 2);
            SecondWidthPolygon  = GeomUtil.OffsetPolygon(CentralVerticalWidthPolygon, vecY, Height / 2);

            this.VecX = vecX; this.VecY = vecY; this.VecZ = vecZ;
        }
        public void GetPolygonsDefineFace()
        {
            LocationCurve lc = Beam.Location as LocationCurve;
            Curve         c  = lc.Curve;

            Length = c.Length;

            List <XYZ> ps = new List <XYZ> {
                c.GetEndPoint(0), c.GetEndPoint(1)
            };

            Parameter zJP  = Beam.LookupParameter("z Justification");
            Parameter zOP  = Beam.LookupParameter("z Offset Value");
            Parameter yJP  = Beam.LookupParameter("y Justification");
            Parameter yOP  = Beam.LookupParameter("y Offset Value");
            XYZ       vecX = ps[1] - ps[0];
            XYZ       vecY = XYZ.BasisZ.CrossProduct(vecX);

            int    zJ = zJP.AsInteger();
            double zO = zOP.AsDouble();

            switch (zJ)
            {
            case 0:
                ps[0] = GeomUtil.OffsetPoint(ps[0], XYZ.BasisZ, zO - Height / 2);
                ps[1] = GeomUtil.OffsetPoint(ps[1], XYZ.BasisZ, zO - Height / 2);
                break;

            case 1:
            case 2:
                ps[0] = GeomUtil.OffsetPoint(ps[0], XYZ.BasisZ, zO);
                ps[1] = GeomUtil.OffsetPoint(ps[1], XYZ.BasisZ, zO);
                break;

            case 3:
                ps[0] = GeomUtil.OffsetPoint(ps[0], XYZ.BasisZ, zO + Height / 2);
                ps[1] = GeomUtil.OffsetPoint(ps[1], XYZ.BasisZ, zO + Height / 2);
                break;
            }

            int    yJ = yJP.AsInteger();
            double yO = yOP.AsDouble();

            switch (yJ)
            {
            case 0:
                ps[0] = GeomUtil.OffsetPoint(ps[0], vecY, yO - Width / 2);
                ps[1] = GeomUtil.OffsetPoint(ps[1], vecY, yO - Width / 2);
                break;

            case 1:
            case 2:
                ps[0] = GeomUtil.OffsetPoint(ps[0], vecY, yO);
                ps[1] = GeomUtil.OffsetPoint(ps[1], vecY, yO);
                break;

            case 3:
                ps[0] = GeomUtil.OffsetPoint(ps[0], vecY, yO + Width / 2);
                ps[1] = GeomUtil.OffsetPoint(ps[1], vecY, yO + Width / 2);
                break;
            }

            ps.Sort(new ZYXComparer());
            List <XYZ> ps2 = new List <XYZ>()
            {
                ps[0], ps[1]
            }; ps2.Sort(new XYComparer());

            DrivingCurve = Line.CreateBound(ps2[0], ps2[1]);

            List <XYZ> cenVerPoints = new List <XYZ> {
                GeomUtil.OffsetPoint(ps[0], XYZ.BasisZ, -Height / 2), GeomUtil.OffsetPoint(ps[1], XYZ.BasisZ, -Height / 2),
                GeomUtil.OffsetPoint(ps[0], XYZ.BasisZ, Height / 2), GeomUtil.OffsetPoint(ps[1], XYZ.BasisZ, Height / 2)
            };

            cenVerPoints.Sort(new ZYXComparer());
            XYZ temp = cenVerPoints[2]; cenVerPoints[2] = cenVerPoints[3]; cenVerPoints[3] = temp;

            List <XYZ> cenHozPoints = new List <XYZ> {
                GeomUtil.OffsetPoint(ps[0], vecY, -Width / 2), GeomUtil.OffsetPoint(ps[1], vecY, -Width / 2),
                GeomUtil.OffsetPoint(ps[0], vecY, Width / 2), GeomUtil.OffsetPoint(ps[1], vecY, Width / 2)
            };

            cenHozPoints.Sort(new ZYXComparer());
            temp = cenHozPoints[2]; cenHozPoints[2] = cenHozPoints[3]; cenHozPoints[3] = temp;

            ps = new List <XYZ> {
                (cenVerPoints[0] + cenVerPoints[1]) / 2, (cenVerPoints[2] + cenVerPoints[3]) / 2
            };
            List <XYZ> cenSecPoints = new List <XYZ> {
                GeomUtil.OffsetPoint(ps[0], vecY, -Width / 2), GeomUtil.OffsetPoint(ps[1], vecY, -Width / 2),
                GeomUtil.OffsetPoint(ps[0], vecY, Width / 2), GeomUtil.OffsetPoint(ps[1], vecY, Width / 2)
            };

            cenSecPoints.Sort(new ZYXComparer());
            temp = cenSecPoints[2]; cenSecPoints[2] = cenSecPoints[3]; cenSecPoints[3] = temp;

            CentralHorizontalPolygon      = new Polygon(cenHozPoints);
            CentralVerticalLengthPolygon  = new Polygon(cenVerPoints);
            CentralVerticalSectionPolygon = new Polygon(cenSecPoints);

            vecX                 = GeomUtil.UnitVector(GeomUtil.IsBigger(vecX, -vecX) ? vecX : -vecX);
            vecY                 = GeomUtil.UnitVector(GeomUtil.IsBigger(vecY, -vecY) ? vecY : -vecY);
            TopPolygon           = GeomUtil.OffsetPolygon(CentralHorizontalPolygon, XYZ.BasisZ, Height / 2);
            BottomPolygon        = GeomUtil.OffsetPolygon(CentralHorizontalPolygon, XYZ.BasisZ, -Height / 2);
            FirstLengthPolygon   = GeomUtil.OffsetPolygon(CentralVerticalLengthPolygon, vecY, -Width / 2);
            SecondLengthPolygon  = GeomUtil.OffsetPolygon(CentralVerticalLengthPolygon, vecY, Width / 2);
            FirstSectionPolygon  = GeomUtil.OffsetPolygon(CentralVerticalSectionPolygon, vecX, -Length / 2);
            SecondSectionPolygon = GeomUtil.OffsetPolygon(CentralVerticalSectionPolygon, vecX, Length / 2);

            VecX = vecX; VecY = vecY; VecZ = XYZ.BasisZ;
        }
        public void GetPolygonsDefineFace()
        {
            Document doc = Wall.Document;
            Curve    c   = DrivingCurve;

            XYZ vecX = CheckGeometry.GetDirection(c);
            XYZ vecZ = XYZ.BasisZ;
            XYZ vecY = vecZ.CrossProduct(vecX);

            List <XYZ> ps = new List <XYZ> {
                c.GetEndPoint(0), c.GetEndPoint(1)
            };

            List <XYZ> cenLengthPoints = new List <XYZ> {
                GeomUtil.OffsetPoint(ps[0], vecZ, 0), GeomUtil.OffsetPoint(ps[1], vecZ, 0),
                GeomUtil.OffsetPoint(ps[0], vecZ, Height), GeomUtil.OffsetPoint(ps[1], vecZ, Height)
            };

            cenLengthPoints.Sort(new ZYXComparer());
            XYZ temp = cenLengthPoints[2]; cenLengthPoints[2] = cenLengthPoints[3]; cenLengthPoints[3] = temp;

            XYZ midPoint = (ps[0] + ps[1]) / 2;

            ps = new List <XYZ> {
                GeomUtil.OffsetPoint(midPoint, vecY, -Width / 2), GeomUtil.OffsetPoint(midPoint, vecY, Width / 2)
            };
            List <XYZ> cenWidthPoints = new List <XYZ> {
                GeomUtil.OffsetPoint(ps[0], vecZ, 0), GeomUtil.OffsetPoint(ps[1], vecZ, 0),
                GeomUtil.OffsetPoint(ps[0], vecZ, Height), GeomUtil.OffsetPoint(ps[1], vecZ, Height)
            };

            cenWidthPoints.Sort(new ZYXComparer());
            temp = cenWidthPoints[2]; cenWidthPoints[2] = cenWidthPoints[3]; cenWidthPoints[3] = temp;

            ps = new List <XYZ> {
                (cenLengthPoints[0] + cenLengthPoints[3]) / 2, (cenLengthPoints[1] + cenLengthPoints[2]) / 2
            };
            List <XYZ> cenHozPoints = new List <XYZ> {
                GeomUtil.OffsetPoint(ps[0], vecY, -Width / 2), GeomUtil.OffsetPoint(ps[1], vecY, -Width / 2),
                GeomUtil.OffsetPoint(ps[0], vecY, Width / 2), GeomUtil.OffsetPoint(ps[1], vecY, Width / 2)
            };

            cenHozPoints.Sort(new ZYXComparer());
            temp = cenHozPoints[2]; cenHozPoints[2] = cenHozPoints[3]; cenHozPoints[3] = temp;

            CentralVerticalLengthPolygon = new Polygon(cenLengthPoints);
            CentralVerticalWidthPolygon  = new Polygon(cenWidthPoints);
            CentralHorizontalPolygon     = new Polygon(cenHozPoints);

            vecX = GeomUtil.UnitVector(GeomUtil.IsBigger(vecX, -vecX) ? vecX : -vecX);
            vecY = GeomUtil.UnitVector(GeomUtil.IsBigger(vecY, -vecY) ? vecY : -vecY);
            vecZ = GeomUtil.UnitVector(GeomUtil.IsBigger(vecZ, -vecZ) ? vecZ : -vecZ);

            TopPolygon          = GeomUtil.OffsetPolygon(CentralHorizontalPolygon, vecZ, Height / 2);
            BottomPolygon       = GeomUtil.OffsetPolygon(CentralHorizontalPolygon, vecZ, -Height / 2);
            FirstLengthPolygon  = GeomUtil.OffsetPolygon(CentralVerticalLengthPolygon, vecY, -Width / 2);
            SecondLengthPolygon = GeomUtil.OffsetPolygon(CentralVerticalLengthPolygon, vecY, Width / 2);
            FirstWidthPolygon   = GeomUtil.OffsetPolygon(CentralVerticalWidthPolygon, vecX, -Length / 2);
            SecondWidthPolygon  = GeomUtil.OffsetPolygon(CentralVerticalWidthPolygon, vecX, Length / 2);

            this.VecX = vecX; this.VecY = vecY; this.VecZ = vecZ;
        }