Exemplo n.º 1
0
        public SupportPolyGenerator(SupportStorage storage, int currentZHeight_um)
        {
            this.supportStorage = storage;
            this.generateInternalSupport = storage.generateInternalSupport;

            if (!storage.generated)
            {
                return;
            }

            supportedAngleFromHorizon = Math.PI / 2 - (storage.endAngleDegrees / 180.0 * Math.PI + 0.01);
            this.supportZDistance_um = storage.supportLayerHeight_um * storage.supportZGapLayers;

            this.interfaceZDistance_um = storage.supportLayerHeight_um * storage.supportInterfaceLayers;

            done = new bool[storage.gridWidth * storage.gridHeight];

            for (int y = 1; y < storage.gridHeight; y++)
            {
                for (int x = 1; x < storage.gridWidth; x++)
                {
                    if (!done[x + y * storage.gridWidth])
                    {
                        if (needSupportAt(new IntPoint(x, y), currentZHeight_um))
                        {
                            lazyFill(supportPolygons, new IntPoint(x, y), currentZHeight_um, needSupportAt);
                        }
                        else if (needInterfaceAt(new IntPoint(x, y), currentZHeight_um))
                        {
                            //lazyFill(supportPolygons, new IntPoint(x, y), z, needInterfaceAt);
                            lazyFill(interfacePolygons, new IntPoint(x, y), currentZHeight_um, needInterfaceAt);
                        }
                    }
                }
            }

            supportPolygons = supportPolygons.Offset(storage.supportXYDistance_um);
            interfacePolygons = interfacePolygons.Offset(storage.supportXYDistance_um);
        }
Exemplo n.º 2
0
        public SupportPolyGenerator(SupportStorage storage, int z)
        {
            this.supportStorage          = storage;
            this.generateInternalSupport = storage.generateInternalSupport;

            if (!storage.generated)
            {
                return;
            }

            cosAngle = Math.Cos((double)(storage.endAngle) / 180.0 * Math.PI) - 0.01;
            this.supportZDistance_um = storage.supportZDistance_um;

            this.interfaceZDistance_um = storage.interfaceLayers * supportZDistance_um;

            done = new bool[storage.gridWidth * storage.gridHeight];

            for (int y = 1; y < storage.gridHeight; y++)
            {
                for (int x = 1; x < storage.gridWidth; x++)
                {
                    if (!done[x + y * storage.gridWidth])
                    {
                        if (needSupportAt(new IntPoint(x, y), z))
                        {
                            lazyFill(supportPolygons, new IntPoint(x, y), z, needSupportAt);
                        }
                        else if (needInterfaceAt(new IntPoint(x, y), z))
                        {
                            //lazyFill(supportPolygons, new IntPoint(x, y), z, needInterfaceAt);
                            lazyFill(interfacePolygons, new IntPoint(x, y), z, needInterfaceAt);
                        }
                    }
                }
            }

            supportPolygons   = supportPolygons.Offset(storage.supportXYDistance_um);
            interfacePolygons = interfacePolygons.Offset(storage.supportXYDistance_um);
        }
Exemplo n.º 3
0
        public SupportPolyGenerator(SupportStorage storage, int currentZHeight_um)
        {
            this.supportStorage          = storage;
            this.generateInternalSupport = storage.generateInternalSupport;

            if (!storage.generated)
            {
                return;
            }

            supportedAngleFromHorizon = Math.PI / 2 - (storage.endAngleDegrees / 180.0 * Math.PI + 0.01);
            this.supportZDistance_um  = storage.supportLayerHeight_um * storage.supportZGapLayers;

            this.interfaceZDistance_um = storage.supportLayerHeight_um * storage.supportInterfaceLayers;

            done = new bool[storage.gridWidth * storage.gridHeight];

            for (int y = 1; y < storage.gridHeight; y++)
            {
                for (int x = 1; x < storage.gridWidth; x++)
                {
                    if (!done[x + y * storage.gridWidth])
                    {
                        if (needSupportAt(new IntPoint(x, y), currentZHeight_um))
                        {
                            lazyFill(supportPolygons, new IntPoint(x, y), currentZHeight_um, needSupportAt);
                        }
                        else if (needInterfaceAt(new IntPoint(x, y), currentZHeight_um))
                        {
                            //lazyFill(supportPolygons, new IntPoint(x, y), z, needInterfaceAt);
                            lazyFill(interfacePolygons, new IntPoint(x, y), currentZHeight_um, needInterfaceAt);
                        }
                    }
                }
            }

            supportPolygons   = supportPolygons.Offset(storage.supportXYDistance_um);
            interfacePolygons = interfacePolygons.Offset(storage.supportXYDistance_um);
        }