From 860169cfe59c6acb49f243bd5ff5bf04703b7203 Mon Sep 17 00:00:00 2001 From: Mark Burton Date: Wed, 24 Jan 2018 14:31:00 +0000 Subject: [PATCH 01/31] Add bridge settings to experimental category. --- resources/definitions/fdmprinter.def.json | 79 +++++++++++++++++++++++ 1 file changed, 79 insertions(+) diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index aef5533ead..44d5cbe457 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -6189,6 +6189,85 @@ "settable_per_mesh": false, "settable_per_extruder": false, "settable_per_meshgroup": false + }, + "bridge_settings_enabled": + { + "label": "Enable Bridge Settings", + "description": "Detect bridges and modify print speed, flow and fan settings while bridges are printed.", + "type": "bool", + "default_value": true, + "settable_per_mesh": true, + "settable_per_extruder": false, + "settable_per_meshgroup": false + }, + "bridge_skin_line_width": + { + "label": "Bridge Skin Line Width", + "description": "Width of a single skin line used when bridging.", + "unit": "mm", + "minimum_value": "0.001", + "minimum_value_warning": "0.1 + 0.4 * machine_nozzle_size", + "maximum_value_warning": "2 * machine_nozzle_size", + "default_value": 0.4, + "type": "float", + "value": "line_width", + "enabled": "bridge_settings_enabled", + "limit_to_extruder": "top_bottom_extruder_nr", + "settable_per_mesh": true + }, + "bridge_skin_speed": + { + "label": "Bridge Skin Speed", + "description": "The speed at which bridge skin regions are printed.", + "unit": "mm/s", + "type": "float", + "minimum_value": "0.1", + "maximum_value": "math.sqrt(machine_max_feedrate_x ** 2 + machine_max_feedrate_y ** 2)", + "maximum_value_warning": "300", + "default_value": 20, + "value": "speed_topbottom / 2", + "enabled": "bridge_settings_enabled", + "settable_per_mesh": true + }, + "bridge_wall_speed": + { + "label": "Bridge Wall Speed", + "description": "The speed at which the bridge walls are printed.", + "unit": "mm/s", + "type": "float", + "minimum_value": "0.1", + "maximum_value": "math.sqrt(machine_max_feedrate_x ** 2 + machine_max_feedrate_y ** 2)", + "maximum_value_warning": "300", + "default_value": 20, + "value": "speed_wall_0 / 2", + "enabled": "bridge_settings_enabled", + "settable_per_mesh": true + }, + "bridge_material_flow": + { + "label": "Bridge Flow", + "description": "Flow compensation: the amount of material extruded when bridging is multiplied by this value.", + "unit": "%", + "default_value": 100, + "type": "float", + "minimum_value": "5", + "minimum_value_warning": "50", + "maximum_value_warning": "150", + "enabled": "bridge_settings_enabled", + "settable_per_mesh": true + }, + "bridge_fan_speed": + { + "label": "Bridge Fan Speed", + "description": "Fan speed to use when printing bridge walls and skin.", + "unit": "%", + "minimum_value": "0", + "maximum_value": "100", + "default_value": 100, + "type": "float", + "enabled": "bridge_settings_enabled", + "settable_per_mesh": false, + "settable_per_extruder": true } } }, From 2ae7b488507e987146d72a1b1317c824004817cb Mon Sep 17 00:00:00 2001 From: Mark Burton Date: Thu, 25 Jan 2018 18:23:25 +0000 Subject: [PATCH 02/31] Added bridge_skin_support_threshold setting. --- resources/definitions/fdmprinter.def.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index 44d5cbe457..608577c7f0 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -6200,6 +6200,18 @@ "settable_per_extruder": false, "settable_per_meshgroup": false }, + "bridge_skin_support_threshold": + { + "label": "Bridge Skin Support Threshold", + "description": "If a skin region is supported for less than this percentage of its area, print it using the bridge settings. Otherwise it is printed using the normal skin settings.", + "unit": "%", + "default_value": 50, + "type": "float", + "minimum_value": "0", + "maximum_value": "100", + "enabled": "bridge_settings_enabled", + "settable_per_mesh": true + }, "bridge_skin_line_width": { "label": "Bridge Skin Line Width", From 8d69e845633f87455c1b79ffb2afa03acf7bb951 Mon Sep 17 00:00:00 2001 From: Mark Burton Date: Mon, 29 Jan 2018 08:58:47 +0000 Subject: [PATCH 03/31] Refactor bridge settings. Added bridge_wall_max_air_gap, bridge_wall_material_flow and bridge_skin_material_flow. Removed bridge_skin_line_width and bridge_material_flow. --- resources/definitions/fdmprinter.def.json | 36 +++++++++++++++-------- 1 file changed, 23 insertions(+), 13 deletions(-) diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index 608577c7f0..d18f22c7b8 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -6212,19 +6212,16 @@ "enabled": "bridge_settings_enabled", "settable_per_mesh": true }, - "bridge_skin_line_width": + "bridge_wall_max_air_gap": { - "label": "Bridge Skin Line Width", - "description": "Width of a single skin line used when bridging.", - "unit": "mm", - "minimum_value": "0.001", - "minimum_value_warning": "0.1 + 0.4 * machine_nozzle_size", - "maximum_value_warning": "2 * machine_nozzle_size", - "default_value": 0.4, + "label": "Bridge Wall Max Air Gap", + "description": "The maximum allowed width of the region of air below a wall line before the wall is printed using bridge settings. Expressed as a percentage of the wall line width. When the air gap is wider than this, the wall line is printed using the bridge settings. Otherwise, the wall line is printed using the normal settings. The lower the value, the more likely it is that overhung wall lines will be printed using bridge settings.", + "unit": "%", + "default_value": 50, "type": "float", - "value": "line_width", + "minimum_value": "0", + "maximum_value": "100", "enabled": "bridge_settings_enabled", - "limit_to_extruder": "top_bottom_extruder_nr", "settable_per_mesh": true }, "bridge_skin_speed": @@ -6255,10 +6252,23 @@ "enabled": "bridge_settings_enabled", "settable_per_mesh": true }, - "bridge_material_flow": + "bridge_skin_material_flow": { - "label": "Bridge Flow", - "description": "Flow compensation: the amount of material extruded when bridging is multiplied by this value.", + "label": "Bridge Skin Flow", + "description": "Flow compensation: the amount of material extruded when bridging skin is multiplied by this value.", + "unit": "%", + "default_value": 100, + "type": "float", + "minimum_value": "5", + "minimum_value_warning": "50", + "maximum_value_warning": "150", + "enabled": "bridge_settings_enabled", + "settable_per_mesh": true + }, + "bridge_wall_material_flow": + { + "label": "Bridge Wall Flow", + "description": "Flow compensation: the amount of material extruded when bridging walls is multiplied by this value.", "unit": "%", "default_value": 100, "type": "float", From 35600fddd78b5f82e411208c3ac53fa13b0419fb Mon Sep 17 00:00:00 2001 From: Mark Burton Date: Mon, 29 Jan 2018 15:53:52 +0000 Subject: [PATCH 04/31] By default, bridging is disabled when support is enabled but the user can override that. --- resources/definitions/fdmprinter.def.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index d18f22c7b8..0e0857d2f9 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -6195,7 +6195,8 @@ "label": "Enable Bridge Settings", "description": "Detect bridges and modify print speed, flow and fan settings while bridges are printed.", "type": "bool", - "default_value": true, + "default_value": false, + "value": "not support_enable and not support_tree_enable", "settable_per_mesh": true, "settable_per_extruder": false, "settable_per_meshgroup": false From 15a0ec1ef17022a4cfdea51e219638d5c99b6292 Mon Sep 17 00:00:00 2001 From: Mark Burton Date: Tue, 30 Jan 2018 09:24:23 +0000 Subject: [PATCH 05/31] Make the default value of bridge_wall_max_air_gap 100% so that partial overhangs do not use bridging. Full overhangs (no support at all) will still use the wall bridge settings. --- resources/definitions/fdmprinter.def.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index 0e0857d2f9..1467cca252 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -6218,7 +6218,7 @@ "label": "Bridge Wall Max Air Gap", "description": "The maximum allowed width of the region of air below a wall line before the wall is printed using bridge settings. Expressed as a percentage of the wall line width. When the air gap is wider than this, the wall line is printed using the bridge settings. Otherwise, the wall line is printed using the normal settings. The lower the value, the more likely it is that overhung wall lines will be printed using bridge settings.", "unit": "%", - "default_value": 50, + "default_value": 100, "type": "float", "minimum_value": "0", "maximum_value": "100", From 2f8f42aa64f21b8f4f5a5b9d10a50639147ac51b Mon Sep 17 00:00:00 2001 From: Mark Burton Date: Thu, 15 Feb 2018 10:45:24 +0000 Subject: [PATCH 06/31] Reduce default bridge flows to 50%. --- resources/definitions/fdmprinter.def.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index 1467cca252..a3a4583b0b 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -6258,7 +6258,7 @@ "label": "Bridge Skin Flow", "description": "Flow compensation: the amount of material extruded when bridging skin is multiplied by this value.", "unit": "%", - "default_value": 100, + "default_value": 50, "type": "float", "minimum_value": "5", "minimum_value_warning": "50", @@ -6271,7 +6271,7 @@ "label": "Bridge Wall Flow", "description": "Flow compensation: the amount of material extruded when bridging walls is multiplied by this value.", "unit": "%", - "default_value": 100, + "default_value": 50, "type": "float", "minimum_value": "5", "minimum_value_warning": "50", From ca115d2f4805b139fc8986cfdeaba9615ec3af0b Mon Sep 17 00:00:00 2001 From: Mark Burton Date: Thu, 15 Feb 2018 10:45:40 +0000 Subject: [PATCH 07/31] Added bridge_wall_coast setting. --- resources/definitions/fdmprinter.def.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index a3a4583b0b..57770df26c 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -6225,6 +6225,18 @@ "enabled": "bridge_settings_enabled", "settable_per_mesh": true }, + "bridge_wall_coast": + { + "label": "Bridge Wall Coasting", + "description": "This controls the distance the extruder should coast immediately before a bridge wall begins. Coasting before the bridge starts can reduce the pressure in the nozzle and may produce a flatter bridge.", + "unit": "%", + "default_value": 100, + "type": "float", + "minimum_value": "0", + "maximum_value": "500", + "enabled": "bridge_settings_enabled", + "settable_per_mesh": false + }, "bridge_skin_speed": { "label": "Bridge Skin Speed", From dae2d9d761c2233f58d4300973253e6d45c300fe Mon Sep 17 00:00:00 2001 From: ChrisTerBeke Date: Tue, 27 Feb 2018 13:20:18 +0100 Subject: [PATCH 08/31] Add Dockerfile --- Dockerfile | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000..4aa7b4557c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,24 @@ +FROM ultimaker/cura-build-environment:3.2 + +# Environment vars for easy configuration +ENV CURA_BRANCH=master +ENV URANIUM_BRANCH=$CURA_BRANCH +ENV CURA_BENV_GIT_DIR=/srv/cura + +# Setup the repositories +RUN mkdir $CURA_BENV_GIT_DIR +WORKDIR $CURA_BENV_GIT_DIR +RUN git clone https://github.com/Ultimaker/Uranium +WORKDIR $CURA_BENV_GIT_DIR/Uranium +RUN git fetch origin +RUN git checkout $URANIUM_BRANCH +RUN git clone https://github.com/Ultimaker/cura +WORKDIR $CURA_BENV_GIT_DIR/Cura +RUN git fetch origin +RUN git checkout origin $CURA_BRANCH + +# Ensure Uranium is in the python path +RUN export PYTHOHPATH="${PYTHONPATH}:$CURA_BENV_GIT_DIR/Uranium" + +# Run Cura +CMD ["python3", "cura_app.py"] From 4dd01afffbc96363f18fc16773a5a37d42d1324f Mon Sep 17 00:00:00 2001 From: ChrisTerBeke Date: Tue, 27 Feb 2018 13:31:07 +0100 Subject: [PATCH 09/31] Cleanup Dockerfile --- Dockerfile | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4aa7b4557c..e71ae35b46 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,20 +5,23 @@ ENV CURA_BRANCH=master ENV URANIUM_BRANCH=$CURA_BRANCH ENV CURA_BENV_GIT_DIR=/srv/cura -# Setup the repositories RUN mkdir $CURA_BENV_GIT_DIR + +# Setup Uranium WORKDIR $CURA_BENV_GIT_DIR RUN git clone https://github.com/Ultimaker/Uranium WORKDIR $CURA_BENV_GIT_DIR/Uranium RUN git fetch origin RUN git checkout $URANIUM_BRANCH +RUN export PYTHOHPATH="${PYTHONPATH}:$CURA_BENV_GIT_DIR/Uranium" + +# Setup Cura +WORKDIR $CURA_BENV_GIT_DIR RUN git clone https://github.com/Ultimaker/cura WORKDIR $CURA_BENV_GIT_DIR/Cura RUN git fetch origin RUN git checkout origin $CURA_BRANCH -# Ensure Uranium is in the python path -RUN export PYTHOHPATH="${PYTHONPATH}:$CURA_BENV_GIT_DIR/Uranium" - # Run Cura +WORKDIR $CURA_BENV_GIT_DIR/Cura CMD ["python3", "cura_app.py"] From 8144ca978b2b67d413c5acd36766da2e6d9f6cf5 Mon Sep 17 00:00:00 2001 From: ChrisTerBeke Date: Tue, 27 Feb 2018 15:55:24 +0100 Subject: [PATCH 10/31] Add CuraEngine to Dockerfile --- Dockerfile | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index e71ae35b46..3f21496e92 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,10 @@ FROM ultimaker/cura-build-environment:3.2 # Environment vars for easy configuration +ENV CURA_BENV_BUILD_TYPE=Release ENV CURA_BRANCH=master ENV URANIUM_BRANCH=$CURA_BRANCH +ENV CURA_ENGINE_BRANCH=$CURA_BRANCH ENV CURA_BENV_GIT_DIR=/srv/cura RUN mkdir $CURA_BENV_GIT_DIR @@ -17,11 +19,28 @@ RUN export PYTHOHPATH="${PYTHONPATH}:$CURA_BENV_GIT_DIR/Uranium" # Setup Cura WORKDIR $CURA_BENV_GIT_DIR -RUN git clone https://github.com/Ultimaker/cura +RUN git clone https://github.com/Ultimaker/Cura WORKDIR $CURA_BENV_GIT_DIR/Cura RUN git fetch origin RUN git checkout origin $CURA_BRANCH +# Setup CuraEngine +WORKDIR $CURA_BENV_GIT_DIR +RUN git clone https://github.com/Ultimaker/CuraEngine +WORKDIR $CURA_BENV_GIT_DIR/CuraEngine +RUN git fetch origin +RUN git checkout $URANIUM_BRANCH +RUN mkdir build +WORKDIR $CURA_BENV_GIT_DIR/CuraEngine/build +RUN cmake3 .. \ + -DCMAKE_BUILD_TYPE=$CURA_BENV_BUILD_TYPE \ + -DCMAKE_C_COMPILER=gcc \ + -DCMAKE_CXX_COMPILER=g++ +RUN make + +# Make sure Cura can find CuraEngine +RUN ln -s /usr/local/bin/CuraEngine $CURA_BENV_GIT_DIR/Cura + # Run Cura WORKDIR $CURA_BENV_GIT_DIR/Cura CMD ["python3", "cura_app.py"] From e1a6ab098a5ebf79a0a21fdb16ad55f740335682 Mon Sep 17 00:00:00 2001 From: ChrisTerBeke Date: Tue, 27 Feb 2018 16:21:07 +0100 Subject: [PATCH 11/31] Rename source paths env variable --- Dockerfile | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3f21496e92..b2ecb5e843 100644 --- a/Dockerfile +++ b/Dockerfile @@ -5,33 +5,33 @@ ENV CURA_BENV_BUILD_TYPE=Release ENV CURA_BRANCH=master ENV URANIUM_BRANCH=$CURA_BRANCH ENV CURA_ENGINE_BRANCH=$CURA_BRANCH -ENV CURA_BENV_GIT_DIR=/srv/cura +ENV CURA_APP_DIR=/srv/cura -RUN mkdir $CURA_BENV_GIT_DIR +RUN mkdir $CURA_APP_DIR # Setup Uranium -WORKDIR $CURA_BENV_GIT_DIR +WORKDIR $CURA_APP_DIR RUN git clone https://github.com/Ultimaker/Uranium -WORKDIR $CURA_BENV_GIT_DIR/Uranium +WORKDIR $CURA_APP_DIR/Uranium RUN git fetch origin RUN git checkout $URANIUM_BRANCH -RUN export PYTHOHPATH="${PYTHONPATH}:$CURA_BENV_GIT_DIR/Uranium" +RUN export PYTHOHPATH="${PYTHONPATH}:$CURA_APP_DIR/Uranium" # Setup Cura -WORKDIR $CURA_BENV_GIT_DIR +WORKDIR $CURA_APP_DIR RUN git clone https://github.com/Ultimaker/Cura -WORKDIR $CURA_BENV_GIT_DIR/Cura +WORKDIR $CURA_APP_DIR/Cura RUN git fetch origin RUN git checkout origin $CURA_BRANCH # Setup CuraEngine -WORKDIR $CURA_BENV_GIT_DIR +WORKDIR $CURA_APP_DIR RUN git clone https://github.com/Ultimaker/CuraEngine -WORKDIR $CURA_BENV_GIT_DIR/CuraEngine +WORKDIR $CURA_APP_DIR/CuraEngine RUN git fetch origin RUN git checkout $URANIUM_BRANCH RUN mkdir build -WORKDIR $CURA_BENV_GIT_DIR/CuraEngine/build +WORKDIR $CURA_APP_DIR/CuraEngine/build RUN cmake3 .. \ -DCMAKE_BUILD_TYPE=$CURA_BENV_BUILD_TYPE \ -DCMAKE_C_COMPILER=gcc \ @@ -39,8 +39,8 @@ RUN cmake3 .. \ RUN make # Make sure Cura can find CuraEngine -RUN ln -s /usr/local/bin/CuraEngine $CURA_BENV_GIT_DIR/Cura +RUN ln -s /usr/local/bin/CuraEngine $CURA_APP_DIR/Cura # Run Cura -WORKDIR $CURA_BENV_GIT_DIR/Cura +WORKDIR $CURA_APP_DIR/Cura CMD ["python3", "cura_app.py"] From d3f7771e16e00b15efd08214eab146950bfdb6b6 Mon Sep 17 00:00:00 2001 From: ChrisTerBeke Date: Tue, 27 Feb 2018 16:24:17 +0100 Subject: [PATCH 12/31] Simplify cura engine cmake --- Dockerfile | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index b2ecb5e843..3f2a3a239e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -32,10 +32,7 @@ RUN git fetch origin RUN git checkout $URANIUM_BRANCH RUN mkdir build WORKDIR $CURA_APP_DIR/CuraEngine/build -RUN cmake3 .. \ - -DCMAKE_BUILD_TYPE=$CURA_BENV_BUILD_TYPE \ - -DCMAKE_C_COMPILER=gcc \ - -DCMAKE_CXX_COMPILER=g++ +RUN cmake3 .. RUN make # Make sure Cura can find CuraEngine From cee0887d1b146ab88fa22ac61f08bd5cacd66d68 Mon Sep 17 00:00:00 2001 From: ChrisTerBeke Date: Tue, 27 Feb 2018 16:24:50 +0100 Subject: [PATCH 13/31] Fix typo in python path --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 3f2a3a239e..1a0cbe0fff 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,7 +15,7 @@ RUN git clone https://github.com/Ultimaker/Uranium WORKDIR $CURA_APP_DIR/Uranium RUN git fetch origin RUN git checkout $URANIUM_BRANCH -RUN export PYTHOHPATH="${PYTHONPATH}:$CURA_APP_DIR/Uranium" +RUN export PYTHONPATH="${PYTHONPATH}:$CURA_APP_DIR/Uranium" # Setup Cura WORKDIR $CURA_APP_DIR From 1c2999551b036755e66d889c620e3a5a3d2ead86 Mon Sep 17 00:00:00 2001 From: ChrisTerBeke Date: Wed, 28 Feb 2018 10:30:51 +0100 Subject: [PATCH 14/31] install materials, install cura engine, run headless --- Dockerfile | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1a0cbe0fff..30aacfdb56 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,14 @@ -FROM ultimaker/cura-build-environment:3.2 +FROM ultimaker/cura-build-environment:1 # Environment vars for easy configuration ENV CURA_BENV_BUILD_TYPE=Release -ENV CURA_BRANCH=master +ENV CURA_BRANCH=3.2 ENV URANIUM_BRANCH=$CURA_BRANCH ENV CURA_ENGINE_BRANCH=$CURA_BRANCH +ENV MATERIALS_BRANCH=$CURA_BRANCH ENV CURA_APP_DIR=/srv/cura +# Ensure our sources dir exists RUN mkdir $CURA_APP_DIR # Setup Uranium @@ -15,7 +17,7 @@ RUN git clone https://github.com/Ultimaker/Uranium WORKDIR $CURA_APP_DIR/Uranium RUN git fetch origin RUN git checkout $URANIUM_BRANCH -RUN export PYTHONPATH="${PYTHONPATH}:$CURA_APP_DIR/Uranium" +RUN export PYTHONPATH=${PYTHONPATH}:$CURA_APP_DIR/Uranium # Setup Cura WORKDIR $CURA_APP_DIR @@ -24,6 +26,13 @@ WORKDIR $CURA_APP_DIR/Cura RUN git fetch origin RUN git checkout origin $CURA_BRANCH +# Setup materials +WORKDIR $CURA_APP_DIR/Cura/resources +RUN git clone https://github.com/Ultimaker/fdm_materials materials +WORKDIR $CURA_APP_DIR/Cura/resources/materials +RUN git fetch origin +RUN git checkout origin $MATERIALS_BRANCH + # Setup CuraEngine WORKDIR $CURA_APP_DIR RUN git clone https://github.com/Ultimaker/CuraEngine @@ -34,10 +43,13 @@ RUN mkdir build WORKDIR $CURA_APP_DIR/CuraEngine/build RUN cmake3 .. RUN make +RUN make install + +# TODO: setup libCharon # Make sure Cura can find CuraEngine RUN ln -s /usr/local/bin/CuraEngine $CURA_APP_DIR/Cura # Run Cura WORKDIR $CURA_APP_DIR/Cura -CMD ["python3", "cura_app.py"] +CMD ["python3", "cura_app.py", "--headless"] From 8b1bca6743581d9d31300bd36ff6e0b87d586e8a Mon Sep 17 00:00:00 2001 From: ChrisTerBeke Date: Thu, 1 Mar 2018 10:58:18 +0100 Subject: [PATCH 15/31] Add run in docker script --- Dockerfile | 26 ++++++++++++-------------- run_in_docker.sh | 3 +++ 2 files changed, 15 insertions(+), 14 deletions(-) create mode 100644 run_in_docker.sh diff --git a/Dockerfile b/Dockerfile index 30aacfdb56..464aebff53 100644 --- a/Dockerfile +++ b/Dockerfile @@ -13,32 +13,23 @@ RUN mkdir $CURA_APP_DIR # Setup Uranium WORKDIR $CURA_APP_DIR -RUN git clone https://github.com/Ultimaker/Uranium +RUN git clone -b $URANIUM_BRANCH --depth 1 https://github.com/Ultimaker/Uranium WORKDIR $CURA_APP_DIR/Uranium -RUN git fetch origin -RUN git checkout $URANIUM_BRANCH -RUN export PYTHONPATH=${PYTHONPATH}:$CURA_APP_DIR/Uranium # Setup Cura WORKDIR $CURA_APP_DIR -RUN git clone https://github.com/Ultimaker/Cura +RUN git clone -b $CURA_BRANCH --depth 1 https://github.com/Ultimaker/Cura WORKDIR $CURA_APP_DIR/Cura -RUN git fetch origin -RUN git checkout origin $CURA_BRANCH # Setup materials WORKDIR $CURA_APP_DIR/Cura/resources -RUN git clone https://github.com/Ultimaker/fdm_materials materials +RUN git clone -b $MATERIALS_BRANCH --depth 1 https://github.com/Ultimaker/fdm_materials materials WORKDIR $CURA_APP_DIR/Cura/resources/materials -RUN git fetch origin -RUN git checkout origin $MATERIALS_BRANCH # Setup CuraEngine WORKDIR $CURA_APP_DIR -RUN git clone https://github.com/Ultimaker/CuraEngine +RUN git clone -b $CURA_ENGINE_BRANCH --depth 1 https://github.com/Ultimaker/CuraEngine WORKDIR $CURA_APP_DIR/CuraEngine -RUN git fetch origin -RUN git checkout $URANIUM_BRANCH RUN mkdir build WORKDIR $CURA_APP_DIR/CuraEngine/build RUN cmake3 .. @@ -50,6 +41,13 @@ RUN make install # Make sure Cura can find CuraEngine RUN ln -s /usr/local/bin/CuraEngine $CURA_APP_DIR/Cura +# Tmp cleanup +RUN rm -Rf /var/cache + # Run Cura WORKDIR $CURA_APP_DIR/Cura -CMD ["python3", "cura_app.py", "--headless"] +ENV PYTHONPATH=${PYTHONPATH}:$CURA_APP_DIR/Uranium +ENV DISPLAY=:1.0 +ADD run_in_docker.sh . +RUN chmod +x ./run_in_docker.sh +CMD "./run_in_docker.sh" diff --git a/run_in_docker.sh b/run_in_docker.sh new file mode 100644 index 0000000000..1e939a2739 --- /dev/null +++ b/run_in_docker.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash +Xvfb :1 -screen 0 1280x800x16 & +python3 cura_app.py --headless \ No newline at end of file From e8481f55055d0128d4875c315f2c554299994193 Mon Sep 17 00:00:00 2001 From: ChrisTerBeke Date: Thu, 1 Mar 2018 11:00:49 +0100 Subject: [PATCH 16/31] Cleanup --- Dockerfile | 13 ++++--------- run_in_docker.sh | 1 + 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index 464aebff53..d4338c1a4f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,10 +2,10 @@ FROM ultimaker/cura-build-environment:1 # Environment vars for easy configuration ENV CURA_BENV_BUILD_TYPE=Release -ENV CURA_BRANCH=3.2 -ENV URANIUM_BRANCH=$CURA_BRANCH -ENV CURA_ENGINE_BRANCH=$CURA_BRANCH -ENV MATERIALS_BRANCH=$CURA_BRANCH +ENV CURA_BRANCH=docker +ENV URANIUM_BRANCH=3.2 +ENV CURA_ENGINE_BRANCH=3.2 +ENV MATERIALS_BRANCH=3.2 ENV CURA_APP_DIR=/srv/cura # Ensure our sources dir exists @@ -41,13 +41,8 @@ RUN make install # Make sure Cura can find CuraEngine RUN ln -s /usr/local/bin/CuraEngine $CURA_APP_DIR/Cura -# Tmp cleanup -RUN rm -Rf /var/cache - # Run Cura WORKDIR $CURA_APP_DIR/Cura ENV PYTHONPATH=${PYTHONPATH}:$CURA_APP_DIR/Uranium -ENV DISPLAY=:1.0 -ADD run_in_docker.sh . RUN chmod +x ./run_in_docker.sh CMD "./run_in_docker.sh" diff --git a/run_in_docker.sh b/run_in_docker.sh index 1e939a2739..eb364fd887 100644 --- a/run_in_docker.sh +++ b/run_in_docker.sh @@ -1,3 +1,4 @@ #!/usr/bin/env bash Xvfb :1 -screen 0 1280x800x16 & +export DISPLAY=:1.0 python3 cura_app.py --headless \ No newline at end of file From 700254ffc910d1e3c52cba6eec93bc7cbf4bb9cf Mon Sep 17 00:00:00 2001 From: ChrisTerBeke Date: Thu, 1 Mar 2018 11:40:08 +0100 Subject: [PATCH 17/31] use master for testing --- Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index d4338c1a4f..65c6851b31 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,9 +3,9 @@ FROM ultimaker/cura-build-environment:1 # Environment vars for easy configuration ENV CURA_BENV_BUILD_TYPE=Release ENV CURA_BRANCH=docker -ENV URANIUM_BRANCH=3.2 -ENV CURA_ENGINE_BRANCH=3.2 -ENV MATERIALS_BRANCH=3.2 +ENV URANIUM_BRANCH=master +ENV CURA_ENGINE_BRANCH=master +ENV MATERIALS_BRANCH=master ENV CURA_APP_DIR=/srv/cura # Ensure our sources dir exists From 2b0211a45f510c81e8a9b2d47ff8c39f4c313cec Mon Sep 17 00:00:00 2001 From: ChrisTerBeke Date: Thu, 1 Mar 2018 11:45:40 +0100 Subject: [PATCH 18/31] Move build steps for better caching strategy --- Dockerfile | 39 +++++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/Dockerfile b/Dockerfile index 65c6851b31..3e6adc0f4c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,32 +1,13 @@ FROM ultimaker/cura-build-environment:1 # Environment vars for easy configuration -ENV CURA_BENV_BUILD_TYPE=Release -ENV CURA_BRANCH=docker -ENV URANIUM_BRANCH=master -ENV CURA_ENGINE_BRANCH=master -ENV MATERIALS_BRANCH=master ENV CURA_APP_DIR=/srv/cura # Ensure our sources dir exists RUN mkdir $CURA_APP_DIR -# Setup Uranium -WORKDIR $CURA_APP_DIR -RUN git clone -b $URANIUM_BRANCH --depth 1 https://github.com/Ultimaker/Uranium -WORKDIR $CURA_APP_DIR/Uranium - -# Setup Cura -WORKDIR $CURA_APP_DIR -RUN git clone -b $CURA_BRANCH --depth 1 https://github.com/Ultimaker/Cura -WORKDIR $CURA_APP_DIR/Cura - -# Setup materials -WORKDIR $CURA_APP_DIR/Cura/resources -RUN git clone -b $MATERIALS_BRANCH --depth 1 https://github.com/Ultimaker/fdm_materials materials -WORKDIR $CURA_APP_DIR/Cura/resources/materials - # Setup CuraEngine +ENV CURA_ENGINE_BRANCH=master WORKDIR $CURA_APP_DIR RUN git clone -b $CURA_ENGINE_BRANCH --depth 1 https://github.com/Ultimaker/CuraEngine WORKDIR $CURA_APP_DIR/CuraEngine @@ -38,6 +19,24 @@ RUN make install # TODO: setup libCharon +# Setup Uranium +ENV URANIUM_BRANCH=master +WORKDIR $CURA_APP_DIR +RUN git clone -b $URANIUM_BRANCH --depth 1 https://github.com/Ultimaker/Uranium +WORKDIR $CURA_APP_DIR/Uranium + +# Setup materials +ENV MATERIALS_BRANCH=master +WORKDIR $CURA_APP_DIR/Cura/resources +RUN git clone -b $MATERIALS_BRANCH --depth 1 https://github.com/Ultimaker/fdm_materials materials +WORKDIR $CURA_APP_DIR/Cura/resources/materials + +# Setup Cura +ENV CURA_BRANCH=docker +WORKDIR $CURA_APP_DIR +RUN git clone -b $CURA_BRANCH --depth 1 https://github.com/Ultimaker/Cura +WORKDIR $CURA_APP_DIR/Cura + # Make sure Cura can find CuraEngine RUN ln -s /usr/local/bin/CuraEngine $CURA_APP_DIR/Cura From a8bf44003f0fd8d362efd41b44cf873cda40b921 Mon Sep 17 00:00:00 2001 From: ChrisTerBeke Date: Thu, 1 Mar 2018 11:52:09 +0100 Subject: [PATCH 19/31] Some fixes in Dockerfile --- Dockerfile | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3e6adc0f4c..b2b6243071 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,19 +23,16 @@ RUN make install ENV URANIUM_BRANCH=master WORKDIR $CURA_APP_DIR RUN git clone -b $URANIUM_BRANCH --depth 1 https://github.com/Ultimaker/Uranium -WORKDIR $CURA_APP_DIR/Uranium - -# Setup materials -ENV MATERIALS_BRANCH=master -WORKDIR $CURA_APP_DIR/Cura/resources -RUN git clone -b $MATERIALS_BRANCH --depth 1 https://github.com/Ultimaker/fdm_materials materials -WORKDIR $CURA_APP_DIR/Cura/resources/materials # Setup Cura ENV CURA_BRANCH=docker WORKDIR $CURA_APP_DIR RUN git clone -b $CURA_BRANCH --depth 1 https://github.com/Ultimaker/Cura -WORKDIR $CURA_APP_DIR/Cura + +# Setup materials +ENV MATERIALS_BRANCH=master +WORKDIR $CURA_APP_DIR/Cura/resources +RUN git clone -b $MATERIALS_BRANCH --depth 1 https://github.com/Ultimaker/fdm_materials materials # Make sure Cura can find CuraEngine RUN ln -s /usr/local/bin/CuraEngine $CURA_APP_DIR/Cura From 62169bed2a1781e8c0b187687d87521b2e7aa06b Mon Sep 17 00:00:00 2001 From: Mark Burton Date: Fri, 2 Mar 2018 16:35:21 +0000 Subject: [PATCH 20/31] Rename bridge_wall_max_air_gap to bridge_wall_max_overhang. --- resources/definitions/fdmprinter.def.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index 57770df26c..c803f9c084 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -6213,9 +6213,9 @@ "enabled": "bridge_settings_enabled", "settable_per_mesh": true }, - "bridge_wall_max_air_gap": + "bridge_wall_max_overhang": { - "label": "Bridge Wall Max Air Gap", + "label": "Bridge Wall Max Overhang", "description": "The maximum allowed width of the region of air below a wall line before the wall is printed using bridge settings. Expressed as a percentage of the wall line width. When the air gap is wider than this, the wall line is printed using the bridge settings. Otherwise, the wall line is printed using the normal settings. The lower the value, the more likely it is that overhung wall lines will be printed using bridge settings.", "unit": "%", "default_value": 100, From 5db636bf9beadaf499a1ae9c953fbb54ffc70ace Mon Sep 17 00:00:00 2001 From: Mark Burton Date: Fri, 2 Mar 2018 16:36:26 +0000 Subject: [PATCH 21/31] Add bridge_wall_min_length setting. It's currently per extruder to make it easy to access within the engine but this should be changed when the settings are refactored. --- resources/definitions/fdmprinter.def.json | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index c803f9c084..151cb3f45b 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -6201,6 +6201,18 @@ "settable_per_extruder": false, "settable_per_meshgroup": false }, + "bridge_wall_min_length": + { + "label": "Minimum Bridge Wall Length", + "description": "Unsupported walls shorter than this will be printed using the normal wall settings. Longer unsupported walls will be printed using the bridge wall settings.", + "unit": "mm", + "type": "float", + "minimum_value": "0", + "default_value": 5, + "enabled": "bridge_settings_enabled", + "settable_per_mesh": false, + "settable_per_extruder": true + }, "bridge_skin_support_threshold": { "label": "Bridge Skin Support Threshold", From 323eac345a086540b2e1faea744abc60b4fa79c2 Mon Sep 17 00:00:00 2001 From: Mark Burton Date: Sat, 3 Mar 2018 12:04:58 +0000 Subject: [PATCH 22/31] Added bridge_modify_skins_above. --- resources/definitions/fdmprinter.def.json | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index 151cb3f45b..b7ffcdf240 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -6303,6 +6303,15 @@ "enabled": "bridge_settings_enabled", "settable_per_mesh": true }, + "bridge_modify_skins_above": + { + "label": "Modify Skins Above Bridge", + "description": "If enabled, the skin regions present on the 2nd and 3rd layers above the air gap are printed using Bridge Skin Speed. Otherwise, those skins are printed using the normal skin speed.", + "type": "bool", + "default_value": true, + "enabled": "bridge_settings_enabled", + "settable_per_mesh": true + }, "bridge_fan_speed": { "label": "Bridge Fan Speed", From 754e85815a0b881077f2e37cde83568c19d4f099 Mon Sep 17 00:00:00 2001 From: Mark Burton Date: Sun, 4 Mar 2018 09:00:41 +0000 Subject: [PATCH 23/31] Additional second bridge skin settings. --- resources/definitions/fdmprinter.def.json | 60 ++++++++++++++++++----- 1 file changed, 49 insertions(+), 11 deletions(-) diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index b7ffcdf240..5550924c4f 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -6303,15 +6303,6 @@ "enabled": "bridge_settings_enabled", "settable_per_mesh": true }, - "bridge_modify_skins_above": - { - "label": "Modify Skins Above Bridge", - "description": "If enabled, the skin regions present on the 2nd and 3rd layers above the air gap are printed using Bridge Skin Speed. Otherwise, those skins are printed using the normal skin speed.", - "type": "bool", - "default_value": true, - "enabled": "bridge_settings_enabled", - "settable_per_mesh": true - }, "bridge_fan_speed": { "label": "Bridge Fan Speed", @@ -6322,8 +6313,55 @@ "default_value": 100, "type": "float", "enabled": "bridge_settings_enabled", - "settable_per_mesh": false, - "settable_per_extruder": true + "settable_per_mesh": true + }, + "bridge_process_second_skin": + { + "label": "Bridges Have Second Skin", + "description": "If enabled, the skin regions on the second layer above the air gap are printed using bridge second skin settings. Otherwise, those skin regions are printed using the normal skin settings.", + "type": "bool", + "default_value": true, + "enabled": "bridge_settings_enabled", + "settable_per_mesh": true + }, + "bridge_skin_speed_2": + { + "label": "Bridge Second Skin Speed", + "description": "Print speed to use when printing the second bridge skin layer.", + "unit": "mm/s", + "type": "float", + "minimum_value": "0.1", + "maximum_value": "math.sqrt(machine_max_feedrate_x ** 2 + machine_max_feedrate_y ** 2)", + "maximum_value_warning": "300", + "default_value": 20, + "value": "bridge_skin_speed", + "enabled": "bridge_settings_enabled and bridge_process_second_skin", + "settable_per_mesh": true + }, + "bridge_skin_material_flow_2": + { + "label": "Bridge Second Skin Flow", + "description": "Flow compensation: the amount of material extruded when printing the second bridge skin layer is multiplied by this value.", + "unit": "%", + "default_value": 100, + "type": "float", + "minimum_value": "5", + "minimum_value_warning": "50", + "maximum_value_warning": "150", + "enabled": "bridge_settings_enabled and bridge_process_second_skin", + "settable_per_mesh": true + }, + "bridge_fan_speed_2": + { + "label": "Bridge Second Skin Fan Speed", + "description": "Fan speed to use when printing the second bridge skin layer.", + "unit": "%", + "minimum_value": "0", + "maximum_value": "100", + "default_value": 0, + "type": "float", + "enabled": "bridge_settings_enabled and bridge_process_second_skin", + "settable_per_mesh": true } } }, From 4a498fd622bf38c9e93560d1d4da79fec55b6bfb Mon Sep 17 00:00:00 2001 From: Mark Burton Date: Sun, 4 Mar 2018 21:56:44 +0000 Subject: [PATCH 24/31] Tweak various bridge setting values & descriptions. --- resources/definitions/fdmprinter.def.json | 33 ++++++++++++----------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index 5550924c4f..396c45a59e 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -6255,11 +6255,11 @@ "description": "The speed at which bridge skin regions are printed.", "unit": "mm/s", "type": "float", - "minimum_value": "0.1", + "minimum_value": "cool_min_speed", "maximum_value": "math.sqrt(machine_max_feedrate_x ** 2 + machine_max_feedrate_y ** 2)", "maximum_value_warning": "300", - "default_value": 20, - "value": "speed_topbottom / 2", + "default_value": 15, + "value": "max(cool_min_speed, speed_topbottom / 2)", "enabled": "bridge_settings_enabled", "settable_per_mesh": true }, @@ -6269,18 +6269,18 @@ "description": "The speed at which the bridge walls are printed.", "unit": "mm/s", "type": "float", - "minimum_value": "0.1", + "minimum_value": "cool_min_speed", "maximum_value": "math.sqrt(machine_max_feedrate_x ** 2 + machine_max_feedrate_y ** 2)", "maximum_value_warning": "300", - "default_value": 20, - "value": "speed_wall_0 / 2", + "default_value": 15, + "value": "max(cool_min_speed, speed_wall_0 / 2)", "enabled": "bridge_settings_enabled", "settable_per_mesh": true }, "bridge_skin_material_flow": { "label": "Bridge Skin Flow", - "description": "Flow compensation: the amount of material extruded when bridging skin is multiplied by this value.", + "description": "When printing bridge skin regions, the amount of material extruded is multiplied by this value.", "unit": "%", "default_value": 50, "type": "float", @@ -6293,7 +6293,7 @@ "bridge_wall_material_flow": { "label": "Bridge Wall Flow", - "description": "Flow compensation: the amount of material extruded when bridging walls is multiplied by this value.", + "description": "When printing bridge walls, the amount of material extruded is multiplied by this value.", "unit": "%", "default_value": 50, "type": "float", @@ -6306,7 +6306,7 @@ "bridge_fan_speed": { "label": "Bridge Fan Speed", - "description": "Fan speed to use when printing bridge walls and skin.", + "description": "Percentage fan speed to use when printing bridge walls and skin.", "unit": "%", "minimum_value": "0", "maximum_value": "100", @@ -6317,8 +6317,8 @@ }, "bridge_process_second_skin": { - "label": "Bridges Have Second Skin", - "description": "If enabled, the skin regions on the second layer above the air gap are printed using bridge second skin settings. Otherwise, those skin regions are printed using the normal skin settings.", + "label": "Enable Second Bridge Layer", + "description": "If enabled, the skin regions on the second layer above the air are printed using bridge second skin settings. Otherwise, those skin regions are printed using the normal skin settings.", "type": "bool", "default_value": true, "enabled": "bridge_settings_enabled", @@ -6330,10 +6330,10 @@ "description": "Print speed to use when printing the second bridge skin layer.", "unit": "mm/s", "type": "float", - "minimum_value": "0.1", + "minimum_value": "cool_min_speed", "maximum_value": "math.sqrt(machine_max_feedrate_x ** 2 + machine_max_feedrate_y ** 2)", "maximum_value_warning": "300", - "default_value": 20, + "default_value": 15, "value": "bridge_skin_speed", "enabled": "bridge_settings_enabled and bridge_process_second_skin", "settable_per_mesh": true @@ -6341,11 +6341,12 @@ "bridge_skin_material_flow_2": { "label": "Bridge Second Skin Flow", - "description": "Flow compensation: the amount of material extruded when printing the second bridge skin layer is multiplied by this value.", + "description": "When printing the second bridge skin layer, the amount of material extruded is multiplied by this value.", "unit": "%", - "default_value": 100, + "default_value": 125, "type": "float", "minimum_value": "5", + "maximum_value": "500", "minimum_value_warning": "50", "maximum_value_warning": "150", "enabled": "bridge_settings_enabled and bridge_process_second_skin", @@ -6354,7 +6355,7 @@ "bridge_fan_speed_2": { "label": "Bridge Second Skin Fan Speed", - "description": "Fan speed to use when printing the second bridge skin layer.", + "description": "Percentage fan speed to use when printing the second bridge skin layer.", "unit": "%", "minimum_value": "0", "maximum_value": "100", From cd01b096b52357c6384e555a141505cebb3c65cf Mon Sep 17 00:00:00 2001 From: ChrisTerBeke Date: Mon, 5 Mar 2018 14:33:13 +0100 Subject: [PATCH 25/31] Emit backend errors so we can process them differently than through a qml notification --- .dockerignore | 4 ++++ Dockerfile | 13 +++++++------ plugins/CuraEngineBackend/CuraEngineBackend.py | 9 +++++++++ 3 files changed, 20 insertions(+), 6 deletions(-) create mode 100644 .dockerignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000000..d25d71bcc9 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,4 @@ +.git +.github +resources/materials +CuraEngine \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index b2b6243071..68255c56b9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -24,21 +24,22 @@ ENV URANIUM_BRANCH=master WORKDIR $CURA_APP_DIR RUN git clone -b $URANIUM_BRANCH --depth 1 https://github.com/Ultimaker/Uranium -# Setup Cura -ENV CURA_BRANCH=docker -WORKDIR $CURA_APP_DIR -RUN git clone -b $CURA_BRANCH --depth 1 https://github.com/Ultimaker/Cura - # Setup materials ENV MATERIALS_BRANCH=master -WORKDIR $CURA_APP_DIR/Cura/resources +WORKDIR $CURA_APP_DIR RUN git clone -b $MATERIALS_BRANCH --depth 1 https://github.com/Ultimaker/fdm_materials materials +# Setup Cura +WORKDIR $CURA_APP_DIR/Cura +ADD . . +RUN mv $CURA_APP_DIR/materials resources/materials + # Make sure Cura can find CuraEngine RUN ln -s /usr/local/bin/CuraEngine $CURA_APP_DIR/Cura # Run Cura WORKDIR $CURA_APP_DIR/Cura ENV PYTHONPATH=${PYTHONPATH}:$CURA_APP_DIR/Uranium +RUN chmod +x ./CuraEngine RUN chmod +x ./run_in_docker.sh CMD "./run_in_docker.sh" diff --git a/plugins/CuraEngineBackend/CuraEngineBackend.py b/plugins/CuraEngineBackend/CuraEngineBackend.py index 3982a0ad06..ffeddf21cc 100755 --- a/plugins/CuraEngineBackend/CuraEngineBackend.py +++ b/plugins/CuraEngineBackend/CuraEngineBackend.py @@ -33,6 +33,9 @@ from UM.i18n import i18nCatalog catalog = i18nCatalog("cura") class CuraEngineBackend(QObject, Backend): + + backendError = Signal() + ## Starts the back-end plug-in. # # This registers all the signal listeners and prepares for communication @@ -289,6 +292,7 @@ class CuraEngineBackend(QObject, Backend): if job.isCancelled() or job.getError() or job.getResult() == StartSliceJob.StartJobResult.Error: self.backendStateChange.emit(BackendState.Error) + self.backendError.emit(job) return if job.getResult() == StartSliceJob.StartJobResult.MaterialIncompatible: @@ -297,6 +301,7 @@ class CuraEngineBackend(QObject, Backend): "Unable to slice with the current material as it is incompatible with the selected machine or configuration."), title = catalog.i18nc("@info:title", "Unable to slice")) self._error_message.show() self.backendStateChange.emit(BackendState.Error) + self.backendError.emit(job) else: self.backendStateChange.emit(BackendState.NotStarted) return @@ -325,6 +330,7 @@ class CuraEngineBackend(QObject, Backend): title = catalog.i18nc("@info:title", "Unable to slice")) self._error_message.show() self.backendStateChange.emit(BackendState.Error) + self.backendError.emit(job) else: self.backendStateChange.emit(BackendState.NotStarted) return @@ -347,6 +353,7 @@ class CuraEngineBackend(QObject, Backend): title = catalog.i18nc("@info:title", "Unable to slice")) self._error_message.show() self.backendStateChange.emit(BackendState.Error) + self.backendError.emit(job) return if job.getResult() == StartSliceJob.StartJobResult.BuildPlateError: @@ -355,6 +362,7 @@ class CuraEngineBackend(QObject, Backend): title = catalog.i18nc("@info:title", "Unable to slice")) self._error_message.show() self.backendStateChange.emit(BackendState.Error) + self.backendError.emit(job) else: self.backendStateChange.emit(BackendState.NotStarted) @@ -364,6 +372,7 @@ class CuraEngineBackend(QObject, Backend): title = catalog.i18nc("@info:title", "Unable to slice")) self._error_message.show() self.backendStateChange.emit(BackendState.Error) + self.backendError.emit(job) else: self.backendStateChange.emit(BackendState.NotStarted) self._invokeSlice() From 5a8f2040d3695a83000aa67ad1a6f038fcc95c02 Mon Sep 17 00:00:00 2001 From: ChrisTerBeke Date: Mon, 5 Mar 2018 17:53:40 +0100 Subject: [PATCH 26/31] Add method to machine manager to get a machine stack by definition id --- cura/Settings/MachineManager.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cura/Settings/MachineManager.py b/cura/Settings/MachineManager.py index e357d778ca..d478321ffc 100755 --- a/cura/Settings/MachineManager.py +++ b/cura/Settings/MachineManager.py @@ -306,6 +306,14 @@ class MachineManager(QObject): self.__emitChangedSignals() + @staticmethod + def getMachine(definition_id: str) -> Optional["GlobalStack"]: + machines = ContainerRegistry.getInstance().findContainerStacks(type = "machine") + for machine in machines: + if machine.definition.getId() == definition_id: + return machine + return None + @pyqtSlot(str, str) def addMachine(self, name: str, definition_id: str) -> None: new_stack = CuraStackBuilder.createMachine(name, definition_id) From 1ed5a00198e3e3b28de84c60e149427ef2d69004 Mon Sep 17 00:00:00 2001 From: Mark Burton Date: Tue, 6 Mar 2018 10:47:28 +0000 Subject: [PATCH 27/31] Added skin densities and layer 3 settings + tweaked various defaults. --- resources/definitions/fdmprinter.def.json | 149 +++++++++++++++++----- 1 file changed, 114 insertions(+), 35 deletions(-) diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index 396c45a59e..a3e50c2b1c 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -6249,20 +6249,6 @@ "enabled": "bridge_settings_enabled", "settable_per_mesh": false }, - "bridge_skin_speed": - { - "label": "Bridge Skin Speed", - "description": "The speed at which bridge skin regions are printed.", - "unit": "mm/s", - "type": "float", - "minimum_value": "cool_min_speed", - "maximum_value": "math.sqrt(machine_max_feedrate_x ** 2 + machine_max_feedrate_y ** 2)", - "maximum_value_warning": "300", - "default_value": 15, - "value": "max(cool_min_speed, speed_topbottom / 2)", - "enabled": "bridge_settings_enabled", - "settable_per_mesh": true - }, "bridge_wall_speed": { "label": "Bridge Wall Speed", @@ -6277,19 +6263,6 @@ "enabled": "bridge_settings_enabled", "settable_per_mesh": true }, - "bridge_skin_material_flow": - { - "label": "Bridge Skin Flow", - "description": "When printing bridge skin regions, the amount of material extruded is multiplied by this value.", - "unit": "%", - "default_value": 50, - "type": "float", - "minimum_value": "5", - "minimum_value_warning": "50", - "maximum_value_warning": "150", - "enabled": "bridge_settings_enabled", - "settable_per_mesh": true - }, "bridge_wall_material_flow": { "label": "Bridge Wall Flow", @@ -6303,6 +6276,46 @@ "enabled": "bridge_settings_enabled", "settable_per_mesh": true }, + "bridge_skin_speed": + { + "label": "Bridge Skin Speed", + "description": "The speed at which bridge skin regions are printed.", + "unit": "mm/s", + "type": "float", + "minimum_value": "cool_min_speed", + "maximum_value": "math.sqrt(machine_max_feedrate_x ** 2 + machine_max_feedrate_y ** 2)", + "maximum_value_warning": "300", + "default_value": 15, + "value": "max(cool_min_speed, speed_topbottom / 2)", + "enabled": "bridge_settings_enabled", + "settable_per_mesh": true + }, + "bridge_skin_material_flow": + { + "label": "Bridge Skin Flow", + "description": "When printing bridge skin regions, the amount of material extruded is multiplied by this value.", + "unit": "%", + "default_value": 60, + "type": "float", + "minimum_value": "5", + "minimum_value_warning": "50", + "maximum_value_warning": "150", + "enabled": "bridge_settings_enabled", + "settable_per_mesh": true + }, + "bridge_skin_density": + { + "label": "Bridge Skin Density", + "description": "The density of the bridge skin layer. Values less than 100 will increase the gaps between the skin lines.", + "unit": "%", + "default_value": 100, + "type": "float", + "minimum_value": "5", + "maximum_value": "100", + "minimum_value_warning": "20", + "enabled": "bridge_settings_enabled", + "settable_per_mesh": true + }, "bridge_fan_speed": { "label": "Bridge Fan Speed", @@ -6315,10 +6328,10 @@ "enabled": "bridge_settings_enabled", "settable_per_mesh": true }, - "bridge_process_second_skin": + "bridge_enable_more_layers": { - "label": "Enable Second Bridge Layer", - "description": "If enabled, the skin regions on the second layer above the air are printed using bridge second skin settings. Otherwise, those skin regions are printed using the normal skin settings.", + "label": "Bridge Has Multiple Layers", + "description": "If enabled, the second and third layers above the air are printed using the following settings. Otherwise, those layers are printed using the normal settings.", "type": "bool", "default_value": true, "enabled": "bridge_settings_enabled", @@ -6333,9 +6346,9 @@ "minimum_value": "cool_min_speed", "maximum_value": "math.sqrt(machine_max_feedrate_x ** 2 + machine_max_feedrate_y ** 2)", "maximum_value_warning": "300", - "default_value": 15, + "default_value": 25, "value": "bridge_skin_speed", - "enabled": "bridge_settings_enabled and bridge_process_second_skin", + "enabled": "bridge_settings_enabled and bridge_enable_more_layers", "settable_per_mesh": true }, "bridge_skin_material_flow_2": @@ -6343,13 +6356,26 @@ "label": "Bridge Second Skin Flow", "description": "When printing the second bridge skin layer, the amount of material extruded is multiplied by this value.", "unit": "%", - "default_value": 125, + "default_value": 100, "type": "float", "minimum_value": "5", "maximum_value": "500", "minimum_value_warning": "50", "maximum_value_warning": "150", - "enabled": "bridge_settings_enabled and bridge_process_second_skin", + "enabled": "bridge_settings_enabled and bridge_enable_more_layers", + "settable_per_mesh": true + }, + "bridge_skin_density_2": + { + "label": "Bridge Second Skin Density", + "description": "The density of the second bridge skin layer. Values less than 100 will increase the gaps between the skin lines.", + "unit": "%", + "default_value": 75, + "type": "float", + "minimum_value": "5", + "maximum_value": "100", + "minimum_value_warning": "20", + "enabled": "bridge_settings_enabled and bridge_enable_more_layers", "settable_per_mesh": true }, "bridge_fan_speed_2": @@ -6361,7 +6387,60 @@ "maximum_value": "100", "default_value": 0, "type": "float", - "enabled": "bridge_settings_enabled and bridge_process_second_skin", + "enabled": "bridge_settings_enabled and bridge_enable_more_layers", + "settable_per_mesh": true + }, + "bridge_skin_speed_3": + { + "label": "Bridge Third Skin Speed", + "description": "Print speed to use when printing the third bridge skin layer.", + "unit": "mm/s", + "type": "float", + "minimum_value": "cool_min_speed", + "maximum_value": "math.sqrt(machine_max_feedrate_x ** 2 + machine_max_feedrate_y ** 2)", + "maximum_value_warning": "300", + "default_value": 15, + "value": "bridge_skin_speed", + "enabled": "bridge_settings_enabled and bridge_enable_more_layers", + "settable_per_mesh": true + }, + "bridge_skin_material_flow_3": + { + "label": "Bridge Third Skin Flow", + "description": "When printing the third bridge skin layer, the amount of material extruded is multiplied by this value.", + "unit": "%", + "default_value": 110, + "type": "float", + "minimum_value": "5", + "maximum_value": "500", + "minimum_value_warning": "50", + "maximum_value_warning": "150", + "enabled": "bridge_settings_enabled and bridge_enable_more_layers", + "settable_per_mesh": true + }, + "bridge_skin_density_3": + { + "label": "Bridge Third Skin Density", + "description": "The density of the third bridge skin layer. Values less than 100 will increase the gaps between the skin lines.", + "unit": "%", + "default_value": 80, + "type": "float", + "minimum_value": "5", + "maximum_value": "100", + "minimum_value_warning": "20", + "enabled": "bridge_settings_enabled and bridge_enable_more_layers", + "settable_per_mesh": true + }, + "bridge_fan_speed_3": + { + "label": "Bridge Third Skin Fan Speed", + "description": "Percentage fan speed to use when printing the third bridge skin layer.", + "unit": "%", + "minimum_value": "0", + "maximum_value": "100", + "default_value": 0, + "type": "float", + "enabled": "bridge_settings_enabled and bridge_enable_more_layers", "settable_per_mesh": true } } From 29792bbdd82ff62a4cc782e515a76058d4ce954f Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Wed, 7 Mar 2018 11:42:57 +0100 Subject: [PATCH 28/31] Reschedule update upon incomplete data in MaterialManager CURA-5056 --- cura/Machines/MaterialManager.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cura/Machines/MaterialManager.py b/cura/Machines/MaterialManager.py index 56577b5655..92bdbd0e86 100644 --- a/cura/Machines/MaterialManager.py +++ b/cura/Machines/MaterialManager.py @@ -107,7 +107,7 @@ class MaterialManager(QObject): Logger.log("e", "Missing root material node for [%s]. Probably caused by update using incomplete data." " Check all related signals for further debugging.", material_group.name) - # Do nothing here, we wait for a next signal to trigger an update. + self._update_timer.start() return guid = material_group.root_material_node.metadata["GUID"] self._guid_material_groups_map[guid].append(material_group) @@ -217,6 +217,7 @@ class MaterialManager(QObject): self.materialsUpdated.emit() def _updateMaps(self): + Logger.log("i", "Updating material lookup data ...") self.initialize() def _onContainerMetadataChanged(self, container): From 77e3be68b3de78924088aaf236fbc78eaaa3031d Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Wed, 7 Mar 2018 13:23:25 +0100 Subject: [PATCH 29/31] Add removeMaterialByRootId() in MaterialManager CURA-5056 --- cura/Machines/MaterialManager.py | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/cura/Machines/MaterialManager.py b/cura/Machines/MaterialManager.py index 92bdbd0e86..89b3a76f9a 100644 --- a/cura/Machines/MaterialManager.py +++ b/cura/Machines/MaterialManager.py @@ -371,6 +371,16 @@ class MaterialManager(QObject): material_diameter, root_material_id) return node + def removeMaterialByRootId(self, root_material_id: str): + material_group = self.getMaterialGroup(root_material_id) + if not material_group: + Logger.log("i", "Unable to remove the material with id %s, because it doesn't exist.", root_material_id) + return + + nodes_to_remove = [material_group.root_material_node] + material_group.derived_material_node_list + for node in nodes_to_remove: + self._container_registry.removeContainer(node.metadata["id"]) + # # Methods for GUI # @@ -394,14 +404,7 @@ class MaterialManager(QObject): @pyqtSlot("QVariant") def removeMaterial(self, material_node: "MaterialNode"): root_material_id = material_node.metadata["base_file"] - material_group = self.getMaterialGroup(root_material_id) - if not material_group: - Logger.log("d", "Unable to remove the material with id %s, because it doesn't exist.", root_material_id) - return - - nodes_to_remove = [material_group.root_material_node] + material_group.derived_material_node_list - for node in nodes_to_remove: - self._container_registry.removeContainer(node.metadata["id"]) + self.removeMaterialByRootId(root_material_id) # # Creates a duplicate of a material, which has the same GUID and base_file metadata. From 618bcebd8251beb7b74298442b4504a9bfbec77a Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Wed, 7 Mar 2018 13:24:22 +0100 Subject: [PATCH 30/31] Fix create new for conflicting materials in project loading CURA-5056 --- plugins/3MFReader/ThreeMFWorkspaceReader.py | 74 +++++++++++++++++---- 1 file changed, 60 insertions(+), 14 deletions(-) diff --git a/plugins/3MFReader/ThreeMFWorkspaceReader.py b/plugins/3MFReader/ThreeMFWorkspaceReader.py index 6b56ec89f5..01ca136bcf 100755 --- a/plugins/3MFReader/ThreeMFWorkspaceReader.py +++ b/plugins/3MFReader/ThreeMFWorkspaceReader.py @@ -97,6 +97,14 @@ class ThreeMFWorkspaceReader(WorkspaceReader): # In Cura 2.5 and 2.6, the empty profiles used to have those long names self._old_empty_profile_id_dict = {"empty_%s" % k: "empty" for k in ["material", "variant"]} + self._old_new_materials = {} + self._materials_to_select = {} + + def _clearState(self): + self._id_mapping = {} + self._old_new_materials = {} + self._materials_to_select = {} + ## Get a unique name based on the old_id. This is different from directly calling the registry in that it caches results. # This has nothing to do with speed, but with getting consistent new naming for instances & objects. def getNewId(self, old_id): @@ -449,10 +457,15 @@ class ThreeMFWorkspaceReader(WorkspaceReader): # To avoid this, we postpone all signals so they don't get emitted immediately. But, please also be aware that, # because of this, do not expect to have the latest data in the lookup tables in project loading. # - with postponeSignals(*signals, compress = CompressTechnique.CompressSingle): + with postponeSignals(*signals, compress = CompressTechnique.NoCompression): return self._read(file_name) def _read(self, file_name): + application = CuraApplication.getInstance() + material_manager = application.getMaterialManager() + + self._clearState() + archive = zipfile.ZipFile(file_name, "r") cura_file_names = [name for name in archive.namelist() if name.startswith("Cura/")] @@ -545,31 +558,41 @@ class ThreeMFWorkspaceReader(WorkspaceReader): if self._material_container_suffix is None: self._material_container_suffix = ContainerRegistry.getMimeTypeForContainer(xml_material_profile).suffixes[0] if xml_material_profile: + to_deserialize_material = False material_container_files = [name for name in cura_file_names if name.endswith(self._material_container_suffix)] for material_container_file in material_container_files: container_id = self._stripFileToId(material_container_file) + need_new_name = False materials = self._container_registry.findInstanceContainers(id = container_id) if not materials: - material_container = xml_material_profile(container_id) - material_container.deserialize(archive.open(material_container_file).read().decode("utf-8"), - file_name = material_container_file) - containers_to_add.append(material_container) + # No material found, deserialize this material later and add it + to_deserialize_material = True else: material_container = materials[0] + old_material_root_id = material_container.getMetaDataEntry("base_file") if not self._container_registry.isReadOnly(container_id): # Only create new materials if they are not read only. + to_deserialize_material = True + if self._resolve_strategies["material"] == "override": - material_container.deserialize(archive.open(material_container_file).read().decode("utf-8"), - file_name = material_container_file) + # Remove the old materials and then deserialize the one from the project + root_material_id = material_container.getMetaDataEntry("base_file") + material_manager.removeMaterialByRootId(root_material_id) elif self._resolve_strategies["material"] == "new": # Note that we *must* deserialize it with a new ID, as multiple containers will be # auto created & added. - material_container = xml_material_profile(self.getNewId(container_id)) - material_container.deserialize(archive.open(material_container_file).read().decode("utf-8"), - file_name = material_container_file) - containers_to_add.append(material_container) + container_id = self.getNewId(container_id) + self._old_new_materials[old_material_root_id] = container_id + need_new_name = True - material_containers.append(material_container) + if to_deserialize_material: + material_container = xml_material_profile(container_id) + material_container.deserialize(archive.open(material_container_file).read().decode("utf-8"), + file_name = container_id + "." + self._material_container_suffix) + if need_new_name: + new_name = ContainerRegistry.getInstance().uniqueName(material_container.getName()) + material_container.setName(new_name) + containers_to_add.append(material_container) Job.yieldThread() Logger.log("d", "Workspace loading is checking instance containers...") @@ -1081,11 +1104,18 @@ class ThreeMFWorkspaceReader(WorkspaceReader): old_to_new_material_dict[old_id] = each_material break + global_stack.quality = empty_quality_container + # replace old material in global and extruder stacks with new self._replaceStackMaterialWithNew(global_stack, old_to_new_material_dict) if extruder_stacks: - for each_extruder_stack in extruder_stacks: - self._replaceStackMaterialWithNew(each_extruder_stack, old_to_new_material_dict) + for extruder_stack in extruder_stacks: + if extruder_stack.material.getId() in ("empty", "empty_material"): + continue + old_root_material_id = extruder_stack.material.getMetaDataEntry("base_file") + if old_root_material_id in self._old_new_materials: + new_root_material_id = self._old_new_materials[old_root_material_id] + self._materials_to_select[extruder_stack.getMetaDataEntry("position")] = new_root_material_id if extruder_stacks: for stack in extruder_stacks: @@ -1123,6 +1153,22 @@ class ThreeMFWorkspaceReader(WorkspaceReader): def _updateActiveMachine(self, global_stack): # Actually change the active machine. machine_manager = Application.getInstance().getMachineManager() + material_manager = Application.getInstance().getMaterialManager() + + # Switch materials if new materials are created due to conflicts + # We do it here because MaterialManager hasn't been updated in _read() yet. + for position, root_material_id in self._materials_to_select.items(): + extruder_stack = global_stack.extruders[position] + material_diameter = extruder_stack.materialDiameter + material_node = material_manager.getMaterialNode(global_stack.getMetaDataEntry("definition"), + extruder_stack.variant.getName(), + material_diameter, root_material_id) + if material_node is None: + Application.getInstance().callLater(self._updateActiveMachine, global_stack) + return + extruder_stack.material = material_node.getContainer() + Logger.log("d", "Changed extruder [%s] to material [%s]", position, root_material_id) + machine_manager.setActiveMachine(global_stack.getId()) # Notify everything/one that is to notify about changes. From 2a10c9a2d72dd4672032847e9856b222a63f7a55 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Thu, 8 Mar 2018 09:10:43 +0100 Subject: [PATCH 31/31] Move assertion in _performMerge() CURA-5070 --- cura/Settings/ContainerManager.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/cura/Settings/ContainerManager.py b/cura/Settings/ContainerManager.py index f910f0c0e2..345c25ded9 100644 --- a/cura/Settings/ContainerManager.py +++ b/cura/Settings/ContainerManager.py @@ -389,8 +389,6 @@ class ContainerManager(QObject): return ContainerManager.getInstance() def _performMerge(self, merge_into, merge, clear_settings = True): - assert isinstance(merge, type(merge_into)) - if merge == merge_into: return