コード例 #1
0
        // Token: 0x06000010 RID: 16 RVA: 0x0000287C File Offset: 0x00000A7C
        private static void CreateTesselatedEdge(List <Vector3> vertices, List <int[]> wires, IList <Vector3> sweepContour, Angle curveTesselation, ref AffineTransform3 transform, IEdge3 edge)
        {
            EdgeLineSegment3 edgeLineSegment = edge as EdgeLineSegment3;

            if (edgeLineSegment != null)
            {
                SweptDiskSolidExtensions.CreateTesselatedEdgeLine(vertices, wires, sweepContour, ref transform, edgeLineSegment);
                return;
            }
            EdgeArc3 edgeArc = edge as EdgeArc3;

            if (edgeArc != null)
            {
                SweptDiskSolidExtensions.CreateTesselatedEdgeArc(vertices, wires, sweepContour, curveTesselation, ref transform, edgeArc);
                return;
            }
            EdgePolyLineSegment3 edgePolyLineSegment = edge as EdgePolyLineSegment3;

            if (edgePolyLineSegment != null)
            {
                SweptDiskSolidExtensions.CreateTesselatedEdgePolyLine(vertices, wires, sweepContour, ref transform, edgePolyLineSegment);
                return;
            }
        }
コード例 #2
0
        // Token: 0x06000015 RID: 21 RVA: 0x00002CB4 File Offset: 0x00000EB4
        private static void CreateTesselatedEdgePolyLine(List <Vector3> vertices, List <int[]> wires, IList <Vector3> sweepContour, ref AffineTransform3 transform, EdgePolyLineSegment3 edgePolyLine)
        {
            UnitVector3     unitVector = transform.AxisZ;
            Vector3         vector     = (Vector3)transform.AxisX;
            IList <Vector3> vertices2  = edgePolyLine.Vertices;

            for (int i = 0; i < vertices2.Count - 2; i++)
            {
                Vector3     right   = vertices2[i + 0];
                Vector3     vector2 = vertices2[i + 1];
                Vector3     left    = vertices2[i + 2];
                Vector3     vector3 = vector2 - right;
                Vector3     vector4 = left - vector2;
                UnitVector3 unitVector2;
                UnitVector3 unitVector3;
                if (vector3.TryGetNormalized(out unitVector2) && vector4.TryGetNormalized(out unitVector3))
                {
                    unitVector = unitVector3;
                    UnitVector3 planeNormal;
                    if (((Vector3)unitVector2 + (Vector3)unitVector3).TryGetNormalized(out planeNormal))
                    {
                        Plane3 plane = new Plane3(planeNormal, vector2);
                        SweptDiskSolidExtensions.ProjectToPlane(vertices, sweepContour.Count, unitVector2, plane);
                        SweptDiskSolidExtensions.BuildWires(vertices, wires, sweepContour.Count);
                        double scalar = plane.Normal.Dot(vector);
                        vector -= plane.Normal * scalar;
                    }
                }
            }
            UnitVector3 unitVector4 = unitVector;
            UnitVector3 axisY;
            UnitVector3 axisX;

            if (unitVector4.TryGetUnitCross(vector, out axisY) && axisY.TryGetUnitCross(unitVector4, out axisX))
            {
                IList <Vector3> list   = vertices2;
                Vector3         origin = list[list.Count - 1];
                transform = new AffineTransform3(axisX, axisY, unitVector4, origin);
                SweptDiskSolidExtensions.CreateTransformedSweep(vertices, sweepContour, transform);
                SweptDiskSolidExtensions.BuildWires(vertices, wires, sweepContour.Count);
            }
        }