Beispiel #1
0
        public PlenumKneeBrace(string name, Point centerPoint, HorizontalOrientationEnum horizontalOrientation)
        {
            geometry = new GeometryManager();

            Name = name;

            CenterPoint = centerPoint;

            BottomLeftPoint  = new Point("Bottom Left Point", CenterPoint.X - Width / 2, CenterPoint.Y - Height / 2);
            BottomRightPoint = new Point("Bottom Right Point", BottomLeftPoint.X + Width, BottomLeftPoint.Y);
            TopRightPoint    = new Point("Top Right Point", BottomRightPoint.X, BottomLeftPoint.Y + Height);
            TopLeftPoint     = new Point("Top Left Point", BottomLeftPoint.X, TopRightPoint.Y);

            if (horizontalOrientation == HorizontalOrientationEnum.Right)
            {
                SecondHolePoint = MyMath.FindPointAtAngle(CenterPoint, 2, TriangleSide.C, 30, HorizontalOrientationEnum.Left, VerticalOrientationEnum.Down);
            }
            else
            {
                SecondHolePoint = MyMath.FindPointAtAngle(CenterPoint, 2, TriangleSide.C, 30, HorizontalOrientationEnum.Right, VerticalOrientationEnum.Down);
            }


            Points = new List <Point>
            {
                BottomLeftPoint,
                BottomRightPoint,
                TopRightPoint,
                TopLeftPoint,
                CenterPoint,
                SecondHolePoint
            };
        }
Beispiel #2
0
        public KneeBraceClipBrace(string name, Point startpoint, HorizontalOrientationEnum horizontalOrientation)
        {
            geometry = new GeometryManager();

            Name = name;

            if (horizontalOrientation == HorizontalOrientationEnum.Right)
            {
                BottomLeftPoint  = startpoint;
                BottomRightPoint = new Point("Bottom Right Point", BottomLeftPoint.X + Width, BottomLeftPoint.Y);
                TopRightPoint    = new Point("Top Right Point", BottomRightPoint.X, BottomLeftPoint.Y + Height);
                TopLeftPoint     = new Point("Top Left Point", BottomLeftPoint.X, TopRightPoint.Y);
                CenterPoint      = new Point("Center Point", BottomLeftPoint.X + Width / 2, BottomLeftPoint.Y + Height / 2);
                SecondHolePoint  = MyMath.FindPointAtAngle(CenterPoint, 2, TriangleSide.C, 30, horizontalOrientation, VerticalOrientationEnum.Up);
            }
            else
            {
                BottomRightPoint = startpoint;
                BottomLeftPoint  = new Point("Bottom Right Point", BottomRightPoint.X - Width, BottomRightPoint.Y);
                TopRightPoint    = new Point("Top Right Point", BottomRightPoint.X, BottomLeftPoint.Y + Height);
                TopLeftPoint     = new Point("Top Left Point", BottomLeftPoint.X, TopRightPoint.Y);
                CenterPoint      = new Point("Center Point", BottomLeftPoint.X + Width / 2, BottomLeftPoint.Y + Height / 2);
                SecondHolePoint  = MyMath.FindPointAtAngle(CenterPoint, 2, TriangleSide.C, 30, horizontalOrientation, VerticalOrientationEnum.Up);
            }


            Points = new List <Point>
            {
                BottomLeftPoint,
                BottomRightPoint,
                TopRightPoint,
                TopLeftPoint,
                CenterPoint,
                SecondHolePoint
            };
        }
        public KneeBrace(string name, Point startPoint, double distanceBetweenPoints, HorizontalOrientationEnum horizontalOrientation)
        {
            geometry = new GeometryManager();

            Name = name;

            Length = distanceBetweenPoints + 4;
            Width  = 3;

            StartPoint = startPoint;

            if (horizontalOrientation == HorizontalOrientationEnum.Left)
            {
                EndPoint          = MyMath.FindPointAtAngle(startPoint, distanceBetweenPoints, TriangleSide.C, 90 - KneeBraceAngle, HorizontalOrientationEnum.Left, VerticalOrientationEnum.Up);
                BottomCenterPoint = MyMath.FindPointAtAngle(startPoint, 2, TriangleSide.C, 90 - KneeBraceAngle, HorizontalOrientationEnum.Right, VerticalOrientationEnum.Down);
                BottomLeftPoint   = MyMath.FindPointAtAngle(BottomCenterPoint, 1.5, TriangleSide.B, 90 - KneeBraceAngle, HorizontalOrientationEnum.Left, VerticalOrientationEnum.Down);
                BottomRightPoint  = MyMath.FindPointAtAngle(BottomLeftPoint, 3, TriangleSide.C, KneeBraceAngle, HorizontalOrientationEnum.Right, VerticalOrientationEnum.Up);
                TopRightPoint     = MyMath.FindPointAtAngle(BottomRightPoint, Length, TriangleSide.C, 90 - KneeBraceAngle, HorizontalOrientationEnum.Left, VerticalOrientationEnum.Up);
                TopLeftPoint      = MyMath.FindPointAtAngle(TopRightPoint, 3, TriangleSide.C, KneeBraceAngle, HorizontalOrientationEnum.Left, VerticalOrientationEnum.Down);
            }
            else
            {
                EndPoint          = MyMath.FindPointAtAngle(startPoint, distanceBetweenPoints, TriangleSide.C, 90 - KneeBraceAngle, HorizontalOrientationEnum.Right, VerticalOrientationEnum.Up);
                BottomCenterPoint = MyMath.FindPointAtAngle(startPoint, 2, TriangleSide.C, 90 - KneeBraceAngle, HorizontalOrientationEnum.Left, VerticalOrientationEnum.Down);
                BottomLeftPoint   = MyMath.FindPointAtAngle(BottomCenterPoint, 1.5, TriangleSide.B, 90 - KneeBraceAngle, HorizontalOrientationEnum.Left, VerticalOrientationEnum.Up);
                BottomRightPoint  = MyMath.FindPointAtAngle(BottomLeftPoint, 3, TriangleSide.C, KneeBraceAngle, HorizontalOrientationEnum.Right, VerticalOrientationEnum.Down);
                TopRightPoint     = MyMath.FindPointAtAngle(BottomRightPoint, Length, TriangleSide.C, 90 - KneeBraceAngle, HorizontalOrientationEnum.Right, VerticalOrientationEnum.Up);
                TopLeftPoint      = MyMath.FindPointAtAngle(TopRightPoint, 3, TriangleSide.C, KneeBraceAngle, HorizontalOrientationEnum.Left, VerticalOrientationEnum.Up);
            }



            Points = new List <Point>
            {
                startPoint,
                BottomRightPoint,
                TopRightPoint,
                TopLeftPoint
            };
        }
Beispiel #4
0
        public static Point FindPointAtAngle(Point startpoint, double distance, TriangleSide providedSide, double angle, HorizontalOrientationEnum horDirection, VerticalOrientationEnum verDirection)
        {
            double startingX = startpoint.X;
            double startingY = startpoint.Y;

            double xmodifier = horDirection == HorizontalOrientationEnum.Left ? -1 : 1;
            double ymodifier = verDirection == VerticalOrientationEnum.Up ? 1 : -1;

            double aDim = 0;
            double bDim = 0;
            double cDim = 0;

            Point point = null;

            switch (providedSide)
            {
            case TriangleSide.C:
                aDim  = (distance * Math.Sin(ConvertDegreeValue(angle))) * xmodifier;
                bDim  = (distance * Math.Cos(ConvertDegreeValue(angle))) * ymodifier;
                cDim  = distance;
                point = new Point("Found Point", startingX + aDim, bDim + startingY);
                break;

            case TriangleSide.B:
                aDim  = (distance * Math.Sin(ConvertDegreeValue(angle))) * ymodifier;
                bDim  = (distance * Math.Cos(ConvertDegreeValue(angle))) * xmodifier;
                cDim  = distance;
                point = new Point("Found Point", startingX + bDim, aDim + startingY);
                break;
            }



            return(point);
        }