Exemplo n.º 1
0
        // Token: 0x0600019B RID: 411 RVA: 0x0000B580 File Offset: 0x00009780
        private static bool getDirections(List <WireItem> wireItemsMajor, List <WireItem> wireItemsMinor, out ItGeVector3d xVector, out ItGeVector3d yVector, out ItGeVector3d normal)
        {
            xVector = ItGeVector3d.kOrigin;
            yVector = ItGeVector3d.kOrigin;
            normal  = ItGeVector3d.kOrigin;
            bool flag = wireItemsMajor.none <WireItem>() || wireItemsMinor.none <WireItem>();
            bool result;

            if (flag)
            {
                result = false;
            }
            else
            {
                ItGePoint3d startPoint  = wireItemsMajor[0].StartPoint;
                ItGePoint3d endPoint    = wireItemsMajor[0].EndPoint;
                ItGePoint3d startPoint2 = wireItemsMinor[0].StartPoint;
                ItGePoint3d endPoint2   = wireItemsMinor[0].EndPoint;
                xVector = (endPoint2 - startPoint2).normalize();
                yVector = (endPoint - startPoint).normalize();
                normal  = xVector.crossProduct(yVector);
                result  = true;
            }
            return(result);
        }
Exemplo n.º 2
0
        // Token: 0x060001E4 RID: 484 RVA: 0x0000D60C File Offset: 0x0000B80C
        private static bool IsSingleIronInXYPlane(List <ItGeCurve3d> firstList)
        {
            ItGeVector3d directionFromCurve = SteelGroupElementRebarBase.GetDirectionFromCurve(firstList[0]);
            ItGeVector3d refVec             = directionFromCurve.crossProduct(ItGeVector3d.kZAxis);
            ItGeVector3d vec = directionFromCurve.orthoProject(ItGeVector3d.kZAxis);
            double       a   = directionFromCurve.angleTo(vec, refVec);

            return(a.Eq(0.0, -1.0));
        }
        // Token: 0x0600020A RID: 522 RVA: 0x0000E160 File Offset: 0x0000C360
        private ItSegment GetFirstSegFromCircArc(ItBar xmlBar, ItGeCircArc3d firstCirc, ItGeVector3d xzPlaneNormal, ref bool flipFutureYs, out ItSegment additionalSegment)
        {
            ItGeLine3d itGeLine3d;

            firstCirc.tangent(firstCirc.startPoint(), out itGeLine3d, null);
            ItGeVector3d itGeVector3d = itGeLine3d.direction().negate();
            ItSegment    startSegment = this.GetStartSegment(xmlBar);
            double       num;
            double       num2;

            this.GetRotationsInDegree(xzPlaneNormal, startSegment, itGeVector3d, ref flipFutureYs, out num, out num2);
            ItGeVector3d itGeVector3d2;
            ItGeVector3d yAxis;
            ItGeVector3d zAxis;

            this.GetNewDirections(num, num2, startSegment, out itGeVector3d2, out yAxis, out zAxis);
            this.SetCurrentNormal(xmlBar, num, num2, startSegment);
            ItDebug.assert(itGeVector3d2.isCodirectionalTo(itGeVector3d, null), "Failure in: ");
            double       l         = 0.0;
            double       r         = 0.0;
            double       rotX      = Math.Round(num, 10);
            double       bendY     = Math.Round(num2, 10);
            ItGeMatrix3d kIdentity = ItGeMatrix3d.kIdentity;

            kIdentity.setCoordSystem(ItGePoint3d.kOrigin, itGeVector3d, yAxis, zAxis);
            additionalSegment = new ItSegment(l, r, rotX, bendY, kIdentity, "normal");
            double circleSign = this.GetCircleSign(xmlBar, firstCirc);
            double num3;
            double num4;

            this.GetRotationsInDegree(xzPlaneNormal, additionalSegment, itGeVector3d, ref flipFutureYs, out num3, out num4);
            ItGeVector3d itGeVector3d3;
            ItGeVector3d itGeVector3d4;
            ItGeVector3d itGeVector3d5;

            this.GetNewDirections(num3, 0.0, startSegment, out itGeVector3d3, out itGeVector3d4, out itGeVector3d5);
            this.SetCurrentNormal(xmlBar, num3, 0.0, additionalSegment);
            double num5 = this.GetCentralAngleWithSign(firstCirc, circleSign);

            num5 = ItAngle.toDegree(num5);
            ItGeLine3d itGeLine3d2;

            firstCirc.tangent(firstCirc.startPoint(), out itGeLine3d2, null);
            ItGeVector3d itGeVector3d6 = itGeLine3d2.direction();
            ItGeVector3d zAxis2        = itGeVector3d6.crossProduct(xzPlaneNormal);
            double       l2            = 0.0;
            double       r2            = firstCirc.radius();
            double       rotX2         = Math.Round(num3, 10);
            double       bendY2        = Math.Round(num5, 10);

            kIdentity = ItGeMatrix3d.kIdentity;
            kIdentity.setCoordSystem(ItGePoint3d.kOrigin, itGeVector3d6, xzPlaneNormal, zAxis2);
            return(new ItSegment(l2, r2, rotX2, bendY2, kIdentity, "normal"));
        }
        // Token: 0x0600020D RID: 525 RVA: 0x0000E42C File Offset: 0x0000C62C
        private void GetRotationComplex(ItGeVector3d rebarPlaneNormal, ItSegment prevSegment, ItGeVector3d direction, ref bool flipFutureYs, out double rotX, out double bendY)
        {
            ItGeVector3d xvector       = prevSegment.XVector;
            ItGeVector3d yvector       = prevSegment.YVector;
            ItGeVector3d itGeVector3d  = yvector.orthoProject(rebarPlaneNormal);
            ItGeVector3d itGeVector3d2 = direction.crossProduct(rebarPlaneNormal);

            rotX  = itGeVector3d.angleTo(itGeVector3d2, xvector);
            rotX  = SteelGroupElementRebarBase.FixRotX(rotX, ref flipFutureYs);
            bendY = xvector.angleTo(direction, itGeVector3d2);
            bendY = SteelGroupElement.FixAngleRange(bendY, flipFutureYs);
        }
        // Token: 0x06000214 RID: 532 RVA: 0x0000E8A4 File Offset: 0x0000CAA4
        public static ItGeVector3d GetNormalFromTwoSegments(ItGeCurve3d firstCurve, ItGeCurve3d nextCurve)
        {
            ItGeCircArc3d itGeCircArc3d = firstCurve as ItGeCircArc3d;
            ItGeLineSeg3d itGeLineSeg3d = firstCurve as ItGeLineSeg3d;
            bool          flag          = itGeCircArc3d != null;
            ItGeVector3d  result;

            if (flag)
            {
                result = itGeCircArc3d.normal();
            }
            else
            {
                ItGeVector3d  itGeVector3d   = itGeLineSeg3d.direction();
                ItGeCircArc3d itGeCircArc3d2 = nextCurve as ItGeCircArc3d;
                ItGeLineSeg3d itGeLineSeg3d2 = nextCurve as ItGeLineSeg3d;
                bool          flag2          = itGeCircArc3d2 != null;
                if (flag2)
                {
                    ItGeVector3d itGeVector3d2 = itGeCircArc3d2.normal();
                    ItGePlane    itGePlane     = new ItGePlane(ItGePoint3d.kOrigin, itGeVector3d2);
                    ItGePoint3d  itGePoint3d;
                    bool         flag3 = itGePlane.intersectWith(itGeLineSeg3d, out itGePoint3d, null);
                    if (flag3)
                    {
                        result = ItGeVector3d.kYAxis;
                    }
                    else
                    {
                        result = itGeVector3d2;
                    }
                }
                else
                {
                    bool flag4 = itGeLineSeg3d2 != null;
                    if (flag4)
                    {
                        ItGeVector3d vec           = itGeLineSeg3d2.direction();
                        ItGeVector3d itGeVector3d3 = itGeVector3d.crossProduct(vec);
                        bool         flag5         = itGeVector3d3.length().Gt(0.0, -1.0);
                        if (flag5)
                        {
                            return(itGeVector3d3);
                        }
                    }
                    result = null;
                }
            }
            return(result);
        }
        // Token: 0x0600020F RID: 527 RVA: 0x0000E4EC File Offset: 0x0000C6EC
        private ItSegment GetSegmentFromCircArc(ItBar xmlBar, ItSegment prevSegment, ItGeCircArc3d circArc, ref bool flipFutureYs, out ItSegment additionalSegment)
        {
            additionalSegment = null;
            ItGeLine3d itGeLine3d  = null;
            ItGeLine3d itGeLine3d2 = null;
            bool       flag        = !circArc.tangent(circArc.endPoint(), out itGeLine3d, null) || !circArc.tangent(circArc.startPoint(), out itGeLine3d2, null);
            ItSegment  result;

            if (flag)
            {
                result = null;
            }
            else
            {
                ItGeVector3d itGeVector3d = (itGeLine3d2 != null) ? itGeLine3d2.direction().negate() : prevSegment.XVector;
                this.GetAdditionalSegment(xmlBar, prevSegment, out additionalSegment, itGeVector3d, ref flipFutureYs);
                ItGeVector3d rebarPlaneNormal = circArc.normal();
                double       num;
                double       num2;
                this.GetRotationsInDegree(rebarPlaneNormal, additionalSegment ?? prevSegment, itGeVector3d, ref flipFutureYs, out num, out num2);
                this.SetCurrentNormal(xmlBar, num, 0.0, additionalSegment ?? prevSegment);
                double circleSign = this.GetCircleSign(xmlBar, circArc);
                double num3       = this.GetCentralAngleWithSign(circArc, circleSign);
                num3 = ItAngle.toDegree(num3);
                ItGeVector3d itGeVector3d2 = -1.0 * itGeLine3d.direction();
                ItGeVector3d itGeVector3d3 = circleSign * circArc.normal();
                ItGeVector3d zAxis         = itGeVector3d2.crossProduct(itGeVector3d3);
                double       l             = 0.0;
                double       r             = circArc.radius();
                num = Math.Round(num, 10);
                double       bendY     = Math.Round(num3, 10);
                ItGeMatrix3d kIdentity = ItGeMatrix3d.kIdentity;
                kIdentity.setCoordSystem(ItGePoint3d.kOrigin, itGeVector3d2, itGeVector3d3, zAxis);
                ItSegment itSegment = new ItSegment(l, r, num, bendY, kIdentity, "normal");
                result = itSegment;
            }
            return(result);
        }