Пример #1
0
        internal static void Extrude(
            DxfEntity entity,
            DrawContext.Surface context,
            ISurfaceGraphicsFactory graphicsFactory,
            WW.Math.Geometry.Polyline3D polyline,
            bool isSurface,
            Vector3D extrusion)
        {
            Interface41 transformer = context.GetTransformer();

            if (polyline.Count == 1)
            {
                WW.Math.Point3D start     = polyline[0];
                Segment4D       segment4D = DxfUtil.smethod_50(new Segment3D(start, start + extrusion), transformer);
                graphicsFactory.CreateSegment(segment4D.Start, segment4D.End);
            }
            else if (polyline.Count == 2)
            {
                WW.Math.Point3D point3D1 = polyline[0];
                WW.Math.Point3D point3D2 = polyline[1];
                Polyline4D      boundary = DxfUtil.smethod_46(new WW.Math.Geometry.Polyline3D(true, new WW.Math.Point3D[4] {
                    point3D1, point3D2, point3D2 + extrusion, point3D1 + extrusion
                }), transformer);
                Class940.smethod_20(entity, context, graphicsFactory, boundary, (List <bool>)null);
            }
            else if (isSurface)
            {
                Polyline4D boundary1 = DxfUtil.smethod_46(polyline, transformer);
                Class940.smethod_20(entity, context, graphicsFactory, boundary1, (List <bool>)null);
                WW.Math.Point3D             point3D1  = polyline[polyline.Count - 1];
                WW.Math.Point3D             point3D2  = point3D1 + extrusion;
                WW.Math.Geometry.Polyline3D polyline1 = new WW.Math.Geometry.Polyline3D(polyline.Count, polyline.Closed);
                for (int index = 0; index < polyline.Count; ++index)
                {
                    WW.Math.Point3D point3D3 = polyline[index];
                    WW.Math.Point3D point3D4 = point3D3 + extrusion;
                    polyline1.Add(point3D4);
                    Polyline4D boundary2 = DxfUtil.smethod_46(new WW.Math.Geometry.Polyline3D(true, new WW.Math.Point3D[4] {
                        point3D3, point3D1, point3D2, point3D4
                    }), transformer);
                    Class940.smethod_20(entity, context, graphicsFactory, boundary2, (List <bool>)null);
                    point3D1 = point3D3;
                    point3D2 = point3D4;
                }
                Polyline4D boundary3 = DxfUtil.smethod_46(polyline1, transformer);
                Class940.smethod_20(entity, context, graphicsFactory, boundary3, (List <bool>)null);
            }
            else
            {
                WW.Math.Point3D             point3D1   = polyline[polyline.Count - 1];
                WW.Math.Point3D             point3D2   = point3D1 + extrusion;
                WW.Math.Geometry.Polyline3D polyline3D = new WW.Math.Geometry.Polyline3D(polyline.Count, polyline.Closed);
                for (int index = 0; index < polyline.Count; ++index)
                {
                    WW.Math.Point3D point3D3 = polyline[index];
                    WW.Math.Point3D point3D4 = point3D3 + extrusion;
                    polyline3D.Add(point3D4);
                    Polyline4D boundary = DxfUtil.smethod_46(new WW.Math.Geometry.Polyline3D(true, new WW.Math.Point3D[4] {
                        point3D3, point3D1, point3D2, point3D4
                    }), transformer);
                    Class940.smethod_20(entity, context, graphicsFactory, boundary, (List <bool>)null);
                    point3D1 = point3D3;
                    point3D2 = point3D4;
                }
            }
        }