Beispiel #1
0
 public bool UpdateCurrentFluid()
 {
     if (fluids.ContainsKey(selectedfluid))
     {
         FluidConfig ic = fluids[selectedfluid];
         ic.price = m_fluidPrice;
         return(true);
     }
     return(false);
 }
Beispiel #2
0
 public bool SetCurrentFluid(string fluid)
 {
     if (fluids.ContainsKey(fluid))
     {
         selectedfluid = fluid;
         FluidConfig ic = fluids[fluid];
         m_fluidPrice = ic.price;
         return(true);
     }
     return(false);
 }
Beispiel #3
0
    void Awake()
    {
        this.config = Camera.main.GetComponent <FluidSimulation>().Config;

        ResolutionChange();
        DensityDiffusion();
        VelosityDiffusion();
        PressureStrongly();
        MotionCurlIter();
        Vorticity();
        BrushSize();
        BrushForce();
    }
Beispiel #4
0
        internal string AddNewFluid(string profileName)
        {
            if (inks.ContainsKey(profileName))
            {
                return("Fluid profile name already exists");
            }
            FluidConfig ic = new FluidConfig(profileName);

            if ((selectedfluid != null) && inks.ContainsKey(selectedfluid))
            {
                ic.CopyFrom(fluids[selectedfluid]);
            }
            fluids[profileName] = ic;
            SetCurrentFluid(profileName);
            return("OK");
        }
Beispiel #5
0
 void Start()
 {
     this.config = Camera.main.GetComponent <FluidSimulation>().Config;
 }
Beispiel #6
0
        private void LoadInternal(ref XmlHelper xh)
        {
            XmlNode sbc = xh.m_toplevel;

            dpmmX = xh.GetDouble(sbc, "DotsPermmX", 102.4);
            dpmmY = xh.GetDouble(sbc, "DotsPermmY", 76.8);
            xres  = xh.GetInt(sbc, "XResolution", 1024);
            yres  = xh.GetInt(sbc, "YResolution", 768);
            //ZThick = xh.GetDouble(sbc, "SliceHeight", 0.05);
            //layertime_ms = xh.GetInt(sbc, "LayerTime", 1000); // 1 second default
            //firstlayertime_ms = xh.GetInt(sbc, "FirstLayerTime", 5000);
            blanktime_ms = xh.GetInt(sbc, "BlankTime", 2000); // 2 seconds blank
            plat_temp    = xh.GetInt(sbc, "PlatformTemp", 75);
            //exportgcode = xh.GetBool(sbc, "ExportGCode"));

            exportsvg = xh.GetInt(sbc, "ExportSVG", 0); // the problem is this was previously a boolean variable

            if ((exportsvg < 0) || (exportsvg > 4))
            {
                exportsvg = 0;
            }
            export    = xh.GetBool(sbc, "Export", false);;
            exportpng = xh.GetBool(sbc, "ExportPNG", false);;

            XOffset = xh.GetInt(sbc, "XOffset", 0);
            YOffset = xh.GetInt(sbc, "YOffset", 0);
            //numfirstlayers = xh.GetInt(sbc, "NumberofBottomLayers", 3);
            direction             = (eBuildDirection)xh.GetEnum(sbc, "Direction", typeof(eBuildDirection), eBuildDirection.Bottom_Up);
            liftdistance          = xh.GetDouble(sbc, "LiftDistance", 5.0);
            slidetiltval          = xh.GetDouble(sbc, "SlideTiltValue", 0.0);
            antialiasing          = xh.GetBool(sbc, "AntiAliasing", false);
            usemainliftgcode      = xh.GetBool(sbc, "UseMainLiftGCode", false);
            aaval                 = xh.GetDouble(sbc, "AntiAliasingValue", 1.5);
            liftfeedrate          = xh.GetDouble(sbc, "LiftFeedRate", 50.0);       // 50mm/s
            bottomliftfeedrate    = xh.GetDouble(sbc, "BottomLiftFeedRate", 25.0); // 50mm/s
            liftretractrate       = xh.GetDouble(sbc, "LiftRetractRate", 100.0);   // 100mm/s
            m_exportopt           = xh.GetString(sbc, "ExportOption", "SUBDIR");   // default to saving in subdirectory
            m_flipX               = xh.GetBool(sbc, "FlipX", false);
            m_flipY               = xh.GetBool(sbc, "FlipY", false);
            m_notes               = xh.GetString(sbc, "Notes", "");
            m_createoutlines      = xh.GetBool(sbc, "RenderOutlines", false);
            m_outlinewidth_inset  = xh.GetDouble(sbc, "OutlineWidth_Inset", 2.0);
            m_outlinewidth_outset = xh.GetDouble(sbc, "OutlineWidth_Outset", 0.0);


            m_feed_thickness   = xh.GetDouble(sbc, "FeedThickness", 1);
            m_wall_thickness   = xh.GetDouble(sbc, "WallThickness", 1);
            m_speed_spareading = xh.GetDouble(sbc, "SpeedSpareading", 1);
            m_speed_printing   = xh.GetDouble(sbc, "SpeedPrinting", 1);
            m_roller_speed     = xh.GetDouble(sbc, "Speed_printing", 1);
            m_bottom_layers    = xh.GetDouble(sbc, "BottomLayers", 1);


            //m_resinprice = xh.GetDouble(sbc, "ResinPriceL", 0.0);

            m_headercode   = xh.GetString(sbc, "GCodeHeader", DefGCodeHeader());
            m_footercode   = xh.GetString(sbc, "GCodeFooter", DefGCodeFooter());
            m_preslicecode = xh.GetString(sbc, "GCodePreslice", DefGCodePreslice());
            m_liftcode     = xh.GetString(sbc, "GCodeLift", DefGCodeLift());
            m_layercode    = xh.GetString(sbc, "GCodeLayer", DefGCodeLayer());
            selectedInk    = xh.GetString(sbc, "SelectedInk", "Default");

            selectedpowder = xh.GetString(sbc, "SelectedPowder", "Default");

            selectedfluid = xh.GetString(sbc, "SelectedFluid", "Default");


            inks = new Dictionary <string, InkConfig>();
            List <XmlNode> inkNodes = xh.FindAllChildElement(sbc, "InkConfig");

            foreach (XmlNode xnode in inkNodes)
            {
                string    name = xh.GetString(xnode, "Name", "Default");
                InkConfig ic   = new InkConfig(name);
                ic.Load(xh, xnode);
                inks[name] = ic;
            }
            if (!inks.ContainsKey(selectedInk))
            {
                InkConfig ic = new InkConfig(selectedInk);
                ic.Load(xh, sbc); // try loading legacy settings from parent
                inks[selectedInk] = ic;
            }

            fluids = new Dictionary <string, FluidConfig>();
            List <XmlNode> fluidNodes = xh.FindAllChildElement(sbc, "FluidConfig");

            foreach (XmlNode xnode in fluidNodes)
            {
                string name = xh.GetString(xnode, "Name", "Default");
                var    ic   = new FluidConfig(name);
                ic.Load(xh, xnode);
                fluids[name] = ic;
            }
            if (!fluids.ContainsKey(selectedfluid))
            {
                FluidConfig ic = new FluidConfig(selectedfluid);
                ic.Load(xh, sbc); // try loading legacy settings from parent
                fluids[selectedfluid] = ic;
            }


            powders = new Dictionary <string, PowderConfig>();
            List <XmlNode> powderNodes = xh.FindAllChildElement(sbc, "PowderConfig");

            foreach (XmlNode xnode in powderNodes)
            {
                string name = xh.GetString(xnode, "Name", "Default");
                var    ic   = new PowderConfig(name);
                ic.Load(xh, xnode);
                powders[name] = ic;
            }
            if (!powders.ContainsKey(selectedpowder))
            {
                PowderConfig ic = new PowderConfig(selectedpowder);
                ic.Load(xh, sbc); // try loading legacy settings from parent
                powders[selectedpowder] = ic;
            }

            SetCurrentInk(selectedInk);

            SetCurrentPowder(selectedpowder);
            SetCurrentFluid(selectedfluid);

            minExposure   = xh.GetInt(sbc, "MinTestExposure", 500);
            exposureStep  = xh.GetInt(sbc, "TestExposureStep", 200);
            exportpreview = (PreviewGenerator.ePreview)xh.GetEnum(sbc, "ExportPreview", typeof(PreviewGenerator.ePreview), PreviewGenerator.ePreview.None);



            xh.LoadUserParamList(userParams);
        }
Beispiel #7
0
        public void CreateDefault()
        {
            numfirstlayers    = 3;
            layertime_ms      = 1000; // 1 second default
            firstlayertime_ms = 5000;
            blanktime_ms      = 2000; // 2 seconds blank
            xres   = 1024;
            yres   = 768;
            ZThick = .05;


            m_feed_thickness   = .4d;
            m_speed_spareading = 50;
            m_speed_printing   = 50;
            m_bottom_layers    = 2;
            m_roller_speed     = 20;
            m_wall_thickness   = 2;


            plat_temp      = 75;
            dpmmX          = 102.4;
            dpmmY          = 76.8;
            XOffset        = 0;
            YOffset        = 0;
            numfirstlayers = 3;
            //exportgcode = true;
            exportsvg    = 0;
            export       = false;
            exportpng    = false;
            direction    = eBuildDirection.Bottom_Up;
            liftdistance = 5.0;
            //raise_time_ms = 750;
            slidetiltval       = 0.0;
            antialiasing       = false;
            usemainliftgcode   = false;
            aaval              = 1.5;
            liftfeedrate       = 50.0;     // 50mm/s
            bottomliftfeedrate = 25.0;
            liftretractrate    = 100.0;    // 100mm/s
            m_exportopt        = "SUBDIR"; // default to saving in subdirectory
            m_flipX            = false;
            m_flipY            = false;
            m_notes            = "";
            m_resinprice       = 0.0;//
            //set the default gcode segments
            m_headercode      = DefGCodeHeader();
            m_footercode      = DefGCodeFooter();
            m_liftcode        = DefGCodeLift();
            m_layercode       = DefGCodeLayer();
            m_preslicecode    = DefGCodePreslice();
            inks              = new Dictionary <string, InkConfig>();
            selectedInk       = "Default";
            inks[selectedInk] = new InkConfig(selectedInk);


            fluids                = new Dictionary <string, FluidConfig>();
            selectedfluid         = "default";
            fluids[selectedfluid] = new FluidConfig(selectedfluid);

            powders                 = new Dictionary <string, PowderConfig>();
            selectedpowder          = "default";
            powders[selectedpowder] = new PowderConfig(selectedpowder);

            minExposure           = 500;
            m_createoutlines      = false;
            m_outlinewidth_inset  = 2.0;
            m_outlinewidth_outset = 0.0;
            exposureStep          = 200;
            exportpreview         = PreviewGenerator.ePreview.None;
            userParams            = new UserParameterList();
        }