Ejemplo n.º 1
0
 internal static void Extrude(
     WW.Cad.Drawing.Surface.Geometry geometry,
     IList <WW.Math.Geometry.Polyline3D> polylines,
     bool areSurfaces,
     Vector3D extrusion)
 {
     foreach (WW.Math.Geometry.Polyline3D polyline in (IEnumerable <WW.Math.Geometry.Polyline3D>)polylines)
     {
         Class940.Extrude(geometry, polyline, areSurfaces, extrusion);
     }
 }
Ejemplo n.º 2
0
        public static void smethod_19(
            DxfEntity entity,
            DrawContext.Surface context,
            ISurfaceGraphicsFactory graphicsFactory,
            List <WW.Math.Point3D> boundary,
            List <bool> edgeVisibleList)
        {
            Interface41 transformer = context.GetTransformer();
            Polyline4D  boundary1   = DxfUtil.smethod_46(new WW.Math.Geometry.Polyline3D((IList <WW.Math.Point3D>)boundary), transformer);

            Class940.smethod_20(entity, context, graphicsFactory, boundary1, edgeVisibleList);
        }
Ejemplo n.º 3
0
 public static void smethod_16(
     DxfEntity entity,
     DrawContext.Surface context,
     ISurfaceGraphicsFactory graphicsFactory,
     IList <WW.Math.Geometry.Polyline3D> polylines,
     bool areSurfaces)
 {
     foreach (WW.Math.Geometry.Polyline3D polyline in (IEnumerable <WW.Math.Geometry.Polyline3D>)polylines)
     {
         Class940.smethod_17(entity, context, graphicsFactory, polyline, areSurfaces);
     }
 }
Ejemplo n.º 4
0
 internal static void Extrude(
     DxfEntity entity,
     DrawContext.Surface context,
     ISurfaceGraphicsFactory graphicsFactory,
     IList <WW.Math.Geometry.Polyline3D> polylines,
     bool areSurfaces,
     Vector3D extrusion)
 {
     foreach (WW.Math.Geometry.Polyline3D polyline in (IEnumerable <WW.Math.Geometry.Polyline3D>)polylines)
     {
         Class940.Extrude(entity, context, graphicsFactory, polyline, areSurfaces, extrusion);
     }
 }
Ejemplo n.º 5
0
 internal static void Extrude(
     WW.Cad.Drawing.Surface.Geometry geometry,
     WW.Math.Geometry.Polyline3D polyline,
     bool isSurface,
     Vector3D extrusion)
 {
     if (polyline.Count == 1)
     {
         WW.Math.Point3D start = polyline[0];
         geometry.Add((IPrimitive) new WW.Cad.Drawing.Surface.Segment(start, start + extrusion));
     }
     else if (polyline.Count == 2)
     {
         WW.Math.Point3D v0 = polyline[0];
         WW.Math.Point3D v1 = polyline[1];
         geometry.Add((IPrimitive) new Quad(v0, v1, v1 + extrusion, v0 + extrusion));
     }
     else if (isSurface)
     {
         Class940.smethod_22(geometry, (IList <WW.Math.Point3D>)polyline);
         WW.Math.Point3D             v1         = polyline[polyline.Count - 1];
         WW.Math.Point3D             v2         = v1 + 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 v0 = polyline[index];
             WW.Math.Point3D v3 = v0 + extrusion;
             polyline3D.Add(v3);
             geometry.Add((IPrimitive) new Quad(v0, v1, v2, v3));
             v1 = v0;
             v2 = v3;
         }
         Class940.smethod_22(geometry, (IList <WW.Math.Point3D>)polyline3D);
     }
     else
     {
         WW.Math.Point3D             v1         = polyline[polyline.Count - 1];
         WW.Math.Point3D             v2         = v1 + 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 v0 = polyline[index];
             WW.Math.Point3D v3 = v0 + extrusion;
             polyline3D.Add(v3);
             geometry.Add((IPrimitive) new Quad(v0, v1, v2, v3));
             v1 = v0;
             v2 = v3;
         }
     }
 }
Ejemplo n.º 6
0
 public static void smethod_21(
     DxfEntity entity,
     DrawContext.Surface context,
     WW.Cad.Drawing.Surface.Geometry geometry,
     WW.Math.Geometry.Polyline3D polyline,
     bool isSurface)
 {
     if (isSurface)
     {
         Class940.smethod_22(geometry, (IList <WW.Math.Point3D>)polyline);
     }
     else
     {
         geometry.Add(WW.Cad.Drawing.Surface.Polyline3D.CreatePrimitive(polyline));
     }
 }
Ejemplo n.º 7
0
        internal static void smethod_5(
            DxfEntity entity,
            DrawContext.Surface context,
            ISurfaceGraphicsFactory graphicsFactory,
            IList <WW.Cad.Drawing.Polyline2D2N> polylines,
            bool areSurfaces,
            Matrix4D transform,
            Vector3D normal,
            double extrusion)
        {
            int count = polylines.Count;

            for (int index = 0; index < count; ++index)
            {
                WW.Cad.Drawing.Polyline2D2N polyline = polylines[index];
                Class940.smethod_6(entity, context, graphicsFactory, polyline, areSurfaces, transform, normal, extrusion);
            }
        }
Ejemplo n.º 8
0
        public static void smethod_17(
            DxfEntity entity,
            DrawContext.Surface context,
            ISurfaceGraphicsFactory graphicsFactory,
            WW.Math.Geometry.Polyline3D polyline,
            bool isSurface)
        {
            Interface41 transformer = context.GetTransformer();
            Polyline4D  boundary    = DxfUtil.smethod_46(polyline, transformer);

            if (isSurface)
            {
                Class940.smethod_20(entity, context, graphicsFactory, boundary, (List <bool>)null);
            }
            else
            {
                graphicsFactory.CreatePolyline((IList <Vector4D>)boundary, polyline.Closed);
            }
        }
Ejemplo n.º 9
0
        internal static void smethod_13(
            DxfEntity entity,
            DrawContext.Surface context,
            WW.Cad.Drawing.Surface.Geometry geometry,
            IList <Polyline2D> polylinesA,
            IList <Polyline2D> polylinesB,
            Matrix4D transform,
            Vector3D normal,
            bool areSurfaces)
        {
            int count = polylinesA.Count;

            for (int index = 0; index < count; ++index)
            {
                Polyline2D polylineA = polylinesA[index];
                Polyline2D polylineB = polylinesB[index];
                Class940.smethod_14(entity, context, geometry, polylineA, polylineB, transform, normal, areSurfaces);
            }
        }
Ejemplo n.º 10
0
        internal static void smethod_10(
            DxfEntity entity,
            DrawContext.Surface context,
            ISurfaceGraphicsFactory graphicsFactory,
            IList <WW.Cad.Drawing.Polyline2D2N> polylinesA,
            IList <WW.Cad.Drawing.Polyline2D2N> polylinesB,
            Matrix4D transform,
            Vector3D normal,
            bool areSurfaces)
        {
            int count = polylinesA.Count;

            for (int index = 0; index < count; ++index)
            {
                WW.Cad.Drawing.Polyline2D2N polylineA = polylinesA[index];
                WW.Cad.Drawing.Polyline2D2N polylineB = polylinesB[index];
                Class940.smethod_11(entity, context, graphicsFactory, polylineA, polylineB, transform, normal, areSurfaces);
            }
        }
Ejemplo n.º 11
0
        internal static void smethod_8(
            DxfEntity entity,
            DrawContext.Surface context,
            ISurfaceGraphicsFactory graphicsFactory,
            WW.Cad.Drawing.Polyline2D2N polylineA,
            WW.Cad.Drawing.Polyline2D2N polylineB,
            bool isSurface,
            Matrix4D transform,
            Vector3D normal,
            double extrusion)
        {
            Interface41 transformer = (Interface41)context.GetTransformer().Clone();

            transformer.SetPreTransform(transform);
            Vector3D vector3D  = transformer.Transform(new Vector3D(0.0, 0.0, extrusion));
            Vector4D vector4D1 = (Vector4D)vector3D;

            if (polylineA.Count == 1)
            {
                Point2D2N point2D2N1 = polylineA[0];
                Point2D2N point2D2N2 = polylineB[0];
                if (point2D2N1.Position == point2D2N2.Position)
                {
                    Vector4D start = transformer.Transform((WW.Math.Point3D)point2D2N1.Position);
                    graphicsFactory.CreateSegment(start, start + vector4D1);
                }
                else
                {
                    Vector4D   vector4D2     = transformer.Transform(point2D2N1.Position);
                    Vector4D   vector4D3     = transformer.Transform(point2D2N2.Position);
                    Vector4D[] vector4DArray = new Vector4D[4] {
                        vector4D2, vector4D3, vector4D3 + vector4D1, vector4D2 + vector4D1
                    };
                    if (isSurface)
                    {
                        graphicsFactory.CreateQuad((IList <Vector4D>)vector4DArray, (IList <bool>)null);
                    }
                    else
                    {
                        graphicsFactory.CreatePolyline((IList <Vector4D>)vector4DArray, true);
                    }
                }
            }
            else if (polylineA.Count == 2)
            {
                Point2D2N  point2D2N1     = polylineA[0];
                Point2D2N  point2D2N2     = polylineA[1];
                Point2D2N  point2D2N3     = polylineB[0];
                Point2D2N  point2D2N4     = polylineB[1];
                Vector4D   vector4D2      = transformer.Transform(new WW.Math.Point3D(point2D2N1.Position, 0.0));
                Vector4D   vector4D3      = transformer.Transform(new WW.Math.Point3D(point2D2N2.Position, 0.0));
                Vector4D   vector4D4      = transformer.Transform(new WW.Math.Point3D(point2D2N3.Position, 0.0));
                Vector4D   vector4D5      = transformer.Transform(new WW.Math.Point3D(point2D2N4.Position, 0.0));
                Vector4D   vector4D6      = vector4D2 + vector4D1;
                Vector4D   vector4D7      = vector4D3 + vector4D1;
                Vector4D   vector4D8      = vector4D4 + vector4D1;
                Vector4D   vector4D9      = vector4D5 + vector4D1;
                Vector4D[] vector4DArray1 = new Vector4D[4] {
                    vector4D2, vector4D3, vector4D5, vector4D4
                };
                Vector4D[] vector4DArray2 = new Vector4D[4] {
                    vector4D6, vector4D7, vector4D9, vector4D8
                };
                if (isSurface)
                {
                    graphicsFactory.CreateQuad((IList <Vector4D>)vector4DArray1, (IList <bool>)null);
                    graphicsFactory.CreateQuad((IList <Vector4D>)vector4DArray2, (IList <bool>)null);
                    graphicsFactory.CreateQuad((IList <Vector4D>) new Vector4D[4]
                    {
                        vector4D2,
                        vector4D4,
                        vector4D8,
                        vector4D6
                    }, (IList <bool>)null);
                    graphicsFactory.CreateQuad((IList <Vector4D>) new Vector4D[4]
                    {
                        vector4D3,
                        vector4D5,
                        vector4D9,
                        vector4D7
                    }, (IList <bool>)null);
                    graphicsFactory.CreateQuadStrip((IList <Vector4D>) new Vector4D[2]
                    {
                        vector4D2,
                        vector4D3
                    }, (IList <Vector4D>) new Vector4D[2]
                    {
                        vector4D6,
                        vector4D7
                    }, (IList <Vector3D>) new Vector3D[2]
                    {
                        transformer.Transform(new Vector3D(point2D2N1.StartNormal, 0.0)),
                        transformer.Transform(new Vector3D(point2D2N1.EndNormal, 0.0))
                    }, 0, 1);
                    graphicsFactory.CreateQuadStrip((IList <Vector4D>) new Vector4D[2]
                    {
                        vector4D8,
                        vector4D9
                    }, (IList <Vector4D>) new Vector4D[2]
                    {
                        vector4D4,
                        vector4D5
                    }, (IList <Vector3D>) new Vector3D[2]
                    {
                        transformer.Transform(new Vector3D(point2D2N3.StartNormal, 0.0)),
                        transformer.Transform(new Vector3D(point2D2N3.EndNormal, 0.0))
                    }, 0, 1);
                }
                else
                {
                    graphicsFactory.CreatePolyline((IList <Vector4D>)vector4DArray1, true);
                    graphicsFactory.CreatePolyline((IList <Vector4D>)vector4DArray2, true);
                    for (int index = 0; index < 4; ++index)
                    {
                        graphicsFactory.CreateSegment(vector4DArray1[index], vector4DArray2[index]);
                    }
                }
            }
            else
            {
                int        count             = polylineA.Count;
                int        index1            = count - 1;
                bool       closed            = polylineA.Closed;
                Polyline4D polyline4DBottom1 = DxfUtil.smethod_47(polylineA, transformer);
                Polyline4D polyline4DTop1    = DxfUtil.smethod_47(polylineB, transformer);
                Polyline4D polyline4DTop2    = new Polyline4D(count, closed);
                Polyline4D polyline4DBottom2 = new Polyline4D(count, closed);
                for (int index2 = 0; index2 < count; ++index2)
                {
                    polyline4DTop2.Add(polyline4DBottom1[index2] + vector3D);
                    polyline4DBottom2.Add(polyline4DTop1[index2] + vector3D);
                }
                if (isSurface)
                {
                    graphicsFactory.CreateQuadStrip((IList <Vector4D>)polyline4DBottom1, (IList <Vector4D>)polyline4DTop1, normal, closed);
                    graphicsFactory.CreateQuadStrip((IList <Vector4D>)polyline4DTop2, (IList <Vector4D>)polyline4DBottom2, normal, closed);
                    if (!closed)
                    {
                        graphicsFactory.CreateQuad((IList <Vector4D>) new Vector4D[4]
                        {
                            polyline4DBottom1[0],
                            polyline4DTop2[0],
                            polyline4DBottom2[0],
                            polyline4DTop1[0]
                        }, (IList <bool>)null);
                        graphicsFactory.CreateQuad((IList <Vector4D>) new Vector4D[4]
                        {
                            polyline4DBottom1[index1],
                            polyline4DTop2[index1],
                            polyline4DBottom2[index1],
                            polyline4DTop1[index1]
                        }, (IList <bool>)null);
                    }
                    Class940.smethod_9(entity, graphicsFactory, polylineA, transformer, polyline4DBottom1, polyline4DTop2);
                    Class940.smethod_9(entity, graphicsFactory, polylineB, transformer, polyline4DBottom2, polyline4DTop1);
                    if (closed)
                    {
                        return;
                    }
                    Vector4D vector4D2 = polyline4DBottom1[0];
                    Vector4D vector4D3 = polyline4DTop1[0];
                    Vector4D vector4D4 = polyline4DTop2[0];
                    Vector4D vector4D5 = polyline4DBottom2[0];
                    graphicsFactory.CreateQuad((IList <Vector4D>) new Vector4D[4]
                    {
                        vector4D2,
                        vector4D3,
                        vector4D5,
                        vector4D4
                    }, (IList <bool>)null);
                    int      index2    = count - 1;
                    Vector4D vector4D6 = polyline4DBottom1[index2];
                    Vector4D vector4D7 = polyline4DTop1[index2];
                    Vector4D vector4D8 = polyline4DTop2[index2];
                    Vector4D vector4D9 = polyline4DBottom2[index2];
                    graphicsFactory.CreateQuad((IList <Vector4D>) new Vector4D[4]
                    {
                        vector4D6,
                        vector4D7,
                        vector4D9,
                        vector4D8
                    }, (IList <bool>)null);
                }
                else
                {
                    int index2 = 0;
                    int num    = 1;
                    if (closed)
                    {
                        index2 = count - 1;
                        num    = 0;
                    }
                    Vector4D start     = polyline4DBottom1[index2];
                    Vector4D vector4D2 = polyline4DTop1[index2];
                    Vector4D vector4D3 = polyline4DTop2[index2];
                    Vector4D end       = polyline4DBottom2[index2];
                    for (int index3 = num; index3 < count; ++index3)
                    {
                        Vector4D vector4D4 = polyline4DBottom1[index3];
                        Vector4D vector4D5 = polyline4DTop1[index3];
                        Vector4D vector4D6 = polyline4DTop2[index3];
                        Vector4D vector4D7 = polyline4DBottom2[index3];
                        graphicsFactory.CreateSegment(start, vector4D2);
                        graphicsFactory.CreateSegment(vector4D3, end);
                        graphicsFactory.CreateSegment(start, vector4D3);
                        graphicsFactory.CreateSegment(vector4D2, end);
                        start     = vector4D4;
                        vector4D2 = vector4D5;
                        vector4D3 = vector4D6;
                        end       = vector4D7;
                    }
                    graphicsFactory.CreatePolyline((IList <Vector4D>)polyline4DBottom1, closed);
                    graphicsFactory.CreatePolyline((IList <Vector4D>)polyline4DTop1, closed);
                    graphicsFactory.CreatePolyline((IList <Vector4D>)polyline4DTop2, closed);
                    graphicsFactory.CreatePolyline((IList <Vector4D>)polyline4DBottom2, closed);
                }
            }
        }
Ejemplo n.º 12
0
        internal static void smethod_6(
            DxfEntity entity,
            DrawContext.Surface context,
            ISurfaceGraphicsFactory graphicsFactory,
            WW.Cad.Drawing.Polyline2D2N polyline,
            bool isSurface,
            Matrix4D transform,
            Vector3D normal,
            double extrusion)
        {
            Interface41 transformer = (Interface41)context.GetTransformer().Clone();

            transformer.SetPreTransform(transform);
            Vector3D vector3D  = transformer.Transform(new Vector3D(0.0, 0.0, extrusion));
            Vector4D vector4D1 = (Vector4D)vector3D;

            if (polyline.Count == 1)
            {
                Point2D2N point2D2N = polyline[0];
                Vector4D  start     = transformer.Transform(point2D2N.Position);
                graphicsFactory.CreateSegment(start, start + vector4D1);
            }
            else if (polyline.Count == 2)
            {
                Point2D2N point2D2N1 = polyline[0];
                Point2D2N point2D2N2 = polyline[1];
                Vector4D  vector4D2  = transformer.Transform(point2D2N1.Position);
                Vector4D  vector4D3  = transformer.Transform(point2D2N2.Position);
                Vector4D  vector4D4  = vector4D2 + vector4D1;
                Vector4D  vector4D5  = vector4D3 + vector4D1;
                if (isSurface)
                {
                    graphicsFactory.CreateQuadStrip((IList <Vector4D>) new Vector4D[2]
                    {
                        vector4D2,
                        vector4D3
                    }, (IList <Vector4D>) new Vector4D[2]
                    {
                        vector4D4,
                        vector4D5
                    }, (IList <Vector3D>) new Vector3D[2]
                    {
                        transformer.Transform(new Vector3D(point2D2N1.StartNormal, 0.0)),
                        transformer.Transform(new Vector3D(point2D2N1.EndNormal, 0.0))
                    }, 0, 1);
                }
                else
                {
                    graphicsFactory.CreatePolyline((IList <Vector4D>) new Vector4D[4]
                    {
                        vector4D2,
                        vector4D3,
                        vector4D5,
                        vector4D4
                    }, true);
                }
            }
            else
            {
                int        count            = polyline.Count;
                bool       closed           = polyline.Closed;
                Polyline4D polyline4DBottom = DxfUtil.smethod_47(polyline, transformer);
                Polyline4D polyline4DTop    = new Polyline4D(count, closed);
                for (int index = 0; index < count; ++index)
                {
                    polyline4DTop.Add(polyline4DBottom[index] + vector3D);
                }
                if (isSurface)
                {
                    Class940.smethod_9(entity, graphicsFactory, polyline, transformer, polyline4DBottom, polyline4DTop);
                }
                else
                {
                    for (int index = 0; index < count; ++index)
                    {
                        Vector4D start = polyline4DBottom[index];
                        Vector4D end   = polyline4DTop[index];
                        graphicsFactory.CreateSegment(start, end);
                    }
                    graphicsFactory.CreatePolyline((IList <Vector4D>)polyline4DBottom, closed);
                    graphicsFactory.CreatePolyline((IList <Vector4D>)polyline4DTop, closed);
                }
            }
        }
Ejemplo n.º 13
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;
                }
            }
        }