Просмотр исходного кода

Merge branch 'main' into fix_postprocessing_script_folders

fieldOfView 1 год назад
Родитель
Сommit
378e5fedea

+ 2 - 2
.github/ISSUE_TEMPLATE/bugreport.yaml

@@ -1,6 +1,6 @@
 name: Bug Report
 description: Create a report to help us fix issues.
-labels: "Type: Bug"
+labels: ["Type: Bug", "Status: Triage"]
 body:
 - type: markdown
   attributes:
@@ -14,7 +14,7 @@ body:
   attributes:
     label: Application Version
     description: The version of Cura this issue occurs with.
-    placeholder: 4.9.0
+    placeholder: 5.0.0
   validations:
     required: true
 - type: input

+ 0 - 13
.github/no-response.yml

@@ -1,13 +0,0 @@
-# Configuration for probot-no-response - https://github.com/probot/no-response
-
-# Number of days of inactivity before an Issue is closed for lack of response
-daysUntilClose: 14
-# Label requiring a response
-responseRequiredLabel: 'Status: Needs Info'
-# Comment to post when closing an Issue for lack of response. Set to `false` to disable
-closeComment: >
-  This issue has been automatically closed because there has been no response
-  to our request for more information from the original author. With only the
-  information that is currently in the issue, we don't have enough information
-  to take action. Please reach out if you have or find the answers we need so
-  that we can investigate further.

+ 3 - 0
.github/workflows/ci.yml

@@ -8,6 +8,9 @@ on:
       - '4.*'
       - 'CURA-*'
   pull_request:
+permissions:
+  contents: read
+
 jobs:
   build:
     runs-on: ubuntu-latest

+ 215 - 0
.github/workflows/cura-installer.yml

@@ -0,0 +1,215 @@
+name: Cura Installer
+
+on:
+    workflow_dispatch:
+        inputs:
+            cura_conan_version:
+                description: 'Cura Conan Version'
+                # Fixme: default to cura/latest@testing (which is main)
+                default: 'cura/latest@ultimaker/stable'
+                required: true
+            conan_config:
+                description: 'Conan config branch to use'
+                default: ''
+                required: false
+            enterprise:
+                description: 'Build Cura as an Enterprise edition'
+                required: true
+                default: false
+                type: boolean
+            staging:
+                description: 'Use staging API'
+                required: true
+                default: false
+                type: boolean
+            installer:
+                description: 'Create the installer'
+                required: true
+                default: false
+                type: boolean
+
+# Run the nightly at 5:25 UTC on working days
+    schedule:
+    - cron: '25 3 * * 1-5'
+
+env:
+    CONAN_LOGIN_USERNAME_CURA: ${{ secrets.CONAN_USER }}
+    CONAN_PASSWORD_CURA: ${{ secrets.CONAN_PASS }}
+    CONAN_LOGIN_USERNAME_CURA_CE: ${{ secrets.CONAN_USER }}
+    CONAN_PASSWORD_CURA_CE: ${{ secrets.CONAN_PASS }}
+    CONAN_LOG_RUN_TO_OUTPUT: 1
+    CONAN_LOGGING_LEVEL: ${{ inputs.conan_logging_level }}
+    CONAN_NON_INTERACTIVE: 1
+    CODESIGN_IDENTITY: ${{ secrets.CODESIGN_IDENTITY }}
+    MAC_NOTARIZE_USER: ${{ secrets.MAC_NOTARIZE_USER }}
+    MAC_NOTARIZE_PASS: ${{ secrets.MAC_NOTARIZE_PASS }}
+    MACOS_CERT_P12: ${{ secrets.MACOS_CERT_P12 }}
+    MACOS_CERT_PASS: ${{ secrets.MACOS_CERT_PASS }}
+    MACOS_CERT_USER: ${{ secrets.MACOS_CERT_USER }}
+    GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
+    MACOS_CERT_PASSPHRASE: ${{ secrets.MACOS_CERT_PASSPHRASE }}
+
+jobs:
+    cura-installer-create:
+        runs-on: ${{ matrix.os }}
+
+        strategy:
+            fail-fast: false
+            matrix:
+                os: [ macos-10.15, windows-2022, ubuntu-20.04 ]
+
+        steps:
+            -   name: Checkout
+                uses: actions/checkout@v3
+
+            -   name: Setup Python and pip
+                uses: actions/setup-python@v4
+                with:
+                    python-version: '3.10.x'
+                    cache: 'pip'
+                    cache-dependency-path: .github/workflows/requirements-conan-package.txt
+
+            -   name: Install Python requirements and Create default Conan profile
+                run: |
+                    pip install -r .github/workflows/requirements-conan-package.txt
+                    conan profile new default --detect
+
+            -   name: Use Conan download cache (Bash)
+                if: ${{ runner.os != 'Windows' }}
+                run: conan config set storage.download_cache="$HOME/.conan/conan_download_cache"
+
+            -   name: Use Conan download cache (Powershell)
+                if: ${{ runner.os == 'Windows' }}
+                run: conan config set storage.download_cache="C:\Users\runneradmin\.conan\conan_download_cache"
+
+            -   name: Cache Conan local repository packages (Bash)
+                uses: actions/cache@v3
+                if: ${{ runner.os != 'Windows' }}
+                with:
+                    path: |
+                        $HOME/.conan/data
+                        $HOME/.conan/conan_download_cache
+                    key: conan-${{ runner.os }}-${{ runner.arch }}
+
+            -   name: Cache Conan local repository packages (Powershell)
+                uses: actions/cache@v3
+                if: ${{ runner.os == 'Windows' }}
+                with:
+                    path: |
+                        C:\Users\runneradmin\.conan\data
+                        C:\.conan
+                        C:\Users\runneradmin\.conan\conan_download_cache
+                    key: conan-${{ runner.os }}-${{ runner.arch }}
+
+            -   name: Install MacOS system requirements
+                if:  ${{ runner.os == 'Macos' }}
+                run: brew install autoconf automake ninja
+
+            -   name: Install Linux system requirements
+                if: ${{ runner.os == 'Linux' }}
+                run: |
+                    sudo apt install build-essential checkinstall zlib1g-dev libssl-dev ninja-build autoconf libx11-dev libx11-xcb-dev libfontenc-dev libice-dev libsm-dev libxau-dev libxaw7-dev libxcomposite-dev libxcursor-dev libxdamage-dev libxdmcp-dev libxext-dev libxfixes-dev libxi-dev libxinerama-dev libxkbfile-dev libxmu-dev libxmuu-dev libxpm-dev libxrandr-dev libxrender-dev libxres-dev libxss-dev libxt-dev libxtst-dev libxv-dev libxvmc-dev libxxf86vm-dev xtrans-dev libxcb-render0-dev libxcb-render-util0-dev libxcb-xkb-dev libxcb-icccm4-dev libxcb-image0-dev libxcb-keysyms1-dev libxcb-randr0-dev libxcb-shape0-dev libxcb-sync-dev libxcb-xfixes0-dev libxcb-xinerama0-dev xkb-data libxcb-dri3-dev uuid-dev libxcb-util-dev -y
+                    wget --no-check-certificate --quiet https://github.com/AppImage/AppImageKit/releases/download/continuous/appimagetool-x86_64.AppImage -O $GITHUB_WORKSPACE/appimagetool
+                    chmod +x $GITHUB_WORKSPACE/appimagetool
+                    echo "APPIMAGETOOL_LOCATION=$GITHUB_WORKSPACE/appimagetool" >> $GITHUB_ENV
+
+            -   name: Configure GPG Key Linux (Bash)
+                if: ${{ runner.os == 'Linux' }}
+                run: echo -n "$GPG_PRIVATE_KEY" | base64 --decode | gpg --import
+
+            -   name: Configure Macos keychain (Bash)
+                if: ${{ runner.os == 'Macos' }}
+                run: |
+                    CERTIFICATE_PATH=$RUNNER_TEMP/um_keychain.p12
+                    echo -n "$MACOS_CERT_P12" | base64 --decode --output $CERTIFICATE_PATH
+                    security import $CERTIFICATE_PATH -p $MACOS_CERT_PASSPHRASE -A
+                    security unlock -p $MACOS_CERT_USER $CERTIFICATE_PATH
+
+            -   name: Clean Conan local cache
+                if: ${{ inputs.conan_clean_local_cache }}
+                run: conan remove "*" -f
+
+            -   name: Get Conan configuration from branch
+                if: ${{ inputs.conan_config_branch != '' }}
+                run: conan config install https://github.com/Ultimaker/conan-config.git -a "-b ${{ inputs.conan_config_branch }}"
+
+            -   name: Get Conan configuration
+                if: ${{ inputs.conan_config_branch == '' }}
+                run: conan config install https://github.com/Ultimaker/conan-config.git
+
+            -   name: Create the Packages
+                run: conan install ${{ inputs.cura_conan_version }} --build=missing --update -c tools.env.virtualenv:powershell=True -if cura_inst -g VirtualPythonEnv -o cura:enterprise=${{ inputs.enterprise }} -o cura:staging=${{ inputs.staging }}
+
+            -   name: Set Environment variables for Cura (bash)
+                if: ${{ runner.os != 'Windows' }}
+                run: |
+                    . ./cura_inst/bin/activate_github_actions_env.sh
+                    . ./cura_inst/bin/activate_github_actions_version_env.sh
+
+            -   name: Set Environment variables for Cura (Powershell)
+                if: ${{ runner.os == 'Windows' }}
+                run: |
+                    .\cura_inst\Scripts\activate_github_actions_env.ps1
+                    .\cura_inst\Scripts\activate_github_actions_version_env.ps1
+
+            -   name: Create the Cura dist
+                run: pyinstaller ./cura_inst/Ultimaker-Cura.spec
+
+            -   name: Archive the artifacts (bash)
+                if: ${{ github.event.inputs.installer == 'false' && runner.os != 'Windows' }}
+                run: tar -zcf "./Ultimaker-Cura-$CURA_VERSION_FULL-${{ runner.os }}-${{ runner.arch }}.tar.gz" "./Ultimaker-Cura/"
+                working-directory: dist
+
+            -   name: Archive the artifacts (Powershell)
+                if: ${{ github.event.inputs.installer == 'false' && runner.os == 'Windows' }}
+                run: Compress-Archive -Path ".\Ultimaker-Cura" -DestinationPath ".\Ultimaker-Cura-$Env:CURA_VERSION_FULL-${{ runner.os }}-${{ runner.arch }}.zip"
+                working-directory: dist
+
+            -   name: Create the Windows exe installer (Powershell)
+                if: ${{ github.event.inputs.installer == 'true' && runner.os == 'Windows' }}
+                run: |
+                    python ..\cura_inst\packaging\NSIS\nsis-configurator.py ".\Ultimaker-Cura" "..\cura_inst\packaging\NSIS\Ultimaker-Cura.nsi.jinja" "Ultimaker Cura" "Ultimaker-Cura.exe" "$Env:CURA_VERSION_MAJOR" "$Env:CURA_VERSION_MINOR" "$Env:CURA_VERSION_PATCH" "$Env:CURA_VERSION_BUILD" "Ultimaker B.V." "https://ultimaker.com" "..\cura_inst\packaging\cura_license.txt" "LZMA" "..\cura_inst\packaging\NSIS\cura_banner_nsis.bmp" "..\cura_inst\packaging\icons\Cura.ico" "Ultimaker-Cura-$Env:CURA_VERSION_FULL-${{ runner.os }}-${{ runner.arch }}.exe"
+                    makensis /V2 /P4 Ultimaker-Cura.nsi
+                working-directory: dist
+
+            -   name: Create the Linux AppImage (Bash)
+                if: ${{ github.event.inputs.installer == 'true' && runner.os == 'Linux' }}
+                run: python ../cura_inst/packaging/AppImage/create_appimage.py ./Ultimaker-Cura $CURA_VERSION_FULL
+                working-directory: dist
+
+            -   name: Create the MacOS dmg (Bash) alternative
+                if: ${{ github.event.inputs.installer == 'true' && runner.os == 'Macos' }}
+                run: create-dmg --window-pos 640 360 --volicon "../cura_inst/packaging/icons/VolumeIcons_Cura.icns" --window-size 690 503 --icon-size 90 --icon "Ultimaker-Cura.app" 169 272 --app-drop-link 520 272 --eula "../cura_inst/packaging/cura_license.txt" --background "../cura_inst/packaging/icons/cura_background_dmg.png" --rez Rez "./Ultimaker-Cura.dmg" "./Ultimaker-Cura.app"
+                working-directory: dist
+
+            -   name: Sign the MacOS dmg (Bash) alternative
+                if: ${{ github.event.inputs.installer == 'true' && runner.os == 'Macos' }}
+                run: codesign -s "$CODESIGN_IDENTITY" --timestamp -i "nl.ultimaker.cura.dmg" "./Ultimaker-Cura.dmg"
+                working-directory: dist
+
+            -   name: Notarize the MacOS dmg (Bash) alternative
+                if: ${{ github.event.inputs.installer == 'true' && runner.os == 'Macos' }}
+                run: xcrun altool --notarize-app --primary-bundle-id "nl.ultimaker.cura" --username "$MAC_NOTARIZE_USER" --password "$MAC_NOTARIZE_PASS" --file "./Ultimaker-Cura.dmg"
+                working-directory: dist
+
+            -   name: Create the MacOS dmg (Bash)
+                if: ${{ github.event.inputs.installer == 'true' && runner.os == 'Macos' }}
+                run: python ../cura_inst/packaging/dmg/dmg_sign_notarize.py
+                working-directory: dist
+                env:
+                    SOURCE_DIR: ${{ env.GITHUB_WORKSPACE }}/cura_inst
+                    DIST_DIR: ${{ env.GITHUB_WORKSPACE }}/dist
+
+            -   name: Upload the artifacts
+                uses: actions/upload-artifact@v3
+                with:
+                    name: Ultimaker-Cura-${{ env.CURA_VERSION_FULL }}-${{ runner.os }}-${{ runner.arch }}
+                    path: |
+                        dist/*.tar.gz
+                        dist/*.zip
+                        dist/*.exe
+                        dist/*.msi
+                        dist/*.dmg
+                        dist/*.AppImage
+                        dist/*.asc
+                    retention-days: 2

+ 31 - 0
.github/workflows/no-response.yml

@@ -0,0 +1,31 @@
+name: No Response
+
+# Both `issue_comment` and `scheduled` event types are required for this Action
+# to work properly.
+on:
+  issue_comment:
+    types: [created]
+  schedule:
+    # Schedule for ten minutes after the hour, every hour
+    - cron: '10 * * * *'
+
+# By specifying the access of one of the scopes, all of those that are not
+# specified are set to 'none'.
+permissions:
+  issues: write
+
+jobs:
+  noResponse:
+    runs-on: ubuntu-latest
+    steps:
+      - uses: lee-dohm/no-response@v0.5.0
+        with:
+          token: ${{ github.token }}
+          daysUntilClose: 14
+          responseRequiredLabel: 'Status: Needs Info'
+          closeComment: >
+                This issue has been automatically closed because there has been no response
+                to our request for more information from the original author. With only the
+                information that is currently in the issue, we don't have enough information
+                to take action. Please reach out if you have or find the answers we need so
+                that we can investigate further.

+ 2 - 0
.github/workflows/requirements-conan-package.txt

@@ -0,0 +1,2 @@
+conan
+sip==6.5.1

+ 2 - 0
.gitignore

@@ -38,6 +38,7 @@ cura.desktop
 .settings
 
 #Externally located plug-ins commonly installed by our devs.
+plugins/BarbarianPlugin
 plugins/cura-big-flame-graph
 plugins/cura-camera-position
 plugins/cura-god-mode-plugin
@@ -64,6 +65,7 @@ plugins/CuraRemoteSupport
 plugins/ModelCutter
 plugins/PrintProfileCreator
 plugins/MultiPrintPlugin
+plugins/CuraOrientationPlugin
 
 #Build stuff
 CMakeCache.txt

+ 27 - 8
CITATION.cff

@@ -1,11 +1,30 @@
 # YAML 1.2
 ---
-authors: 
-cff-version: "1.1.0"
-date-released: 2021-06-28
-license: "LGPL-3.0"
-message: "If you use this software, please cite it using these metadata."
-repository-code: "https://github.com/ultimaker/cura/"
-title: "Ultimaker Cura"
-version: "4.12.0"
+cff-version: 1.2.0
+type: software
+message: >-
+  If you use this software, please cite it using the
+  metadata from this file.
+title: Ultimaker Cura
+abstract: >-
+  A state-of-the-art slicer application built on top
+  of the Uranium framework.
+authors:
+  - name: Ultimaker B.V.
+contact:
+  - email: info@ultimaker.com
+    name: "Ultimaker B.V."
+url: 'https://ultimaker.com/software/ultimaker-cura'
+repository-code: 'https://github.com/Ultimaker/Cura'
+license: LGPL-3.0
+license-url: "https://github.com/Ultimaker/Cura/blob/main/LICENSE"
+version: 5.0.0
+date-released: '2022-05-17'
+keywords:
+  - Ultimaker
+  - Cura
+  - Uranium
+  - Arachne
+  - 3DPrinting
+  - Slicer
 ...

+ 2 - 1
com.ultimaker.cura.appdata.xml

@@ -25,9 +25,10 @@
   </description>
   <screenshots>
     <screenshot type="default">
-      <image>https://raw.githubusercontent.com/Ultimaker/Cura/master/screenshot.png</image>
+      <image>https://raw.githubusercontent.com/Ultimaker/Cura/main/cura-logo.PNG</image>
     </screenshot>
   </screenshots>
   <url type="homepage">https://ultimaker.com/software/ultimaker-cura?utm_source=cura&amp;utm_medium=software&amp;utm_campaign=cura-update-linux</url>
   <translation type="gettext">Cura</translation>
+  <content_rating type="oars-1.1" />
 </component>

+ 11 - 18
cura/BuildVolume.py

@@ -565,8 +565,8 @@ class BuildVolume(SceneNode):
         self._updateScaleFactor()
 
         self._volume_aabb = AxisAlignedBox(
-            minimum = Vector(min_w, min_h - 1.0, min_d).scale(self._scale_vector),
-            maximum = Vector(max_w, max_h - self._raft_thickness - self._extra_z_clearance, max_d).scale(self._scale_vector)
+            minimum = Vector(min_w, min_h - 1.0, min_d),
+            maximum = Vector(max_w, max_h - self._raft_thickness - self._extra_z_clearance, max_d)
         )
 
         bed_adhesion_size = self.getEdgeDisallowedSize()
@@ -575,8 +575,8 @@ class BuildVolume(SceneNode):
         # This is probably wrong in all other cases. TODO!
         # The +1 and -1 is added as there is always a bit of extra room required to work properly.
         scale_to_max_bounds = AxisAlignedBox(
-            minimum = Vector(min_w + bed_adhesion_size + 1, min_h, min_d + self._disallowed_area_size - bed_adhesion_size + 1).scale(self._scale_vector),
-            maximum = Vector(max_w - bed_adhesion_size - 1, max_h - self._raft_thickness - self._extra_z_clearance, max_d - self._disallowed_area_size + bed_adhesion_size - 1).scale(self._scale_vector)
+            minimum = Vector(min_w + bed_adhesion_size + 1, min_h, min_d + self._disallowed_area_size - bed_adhesion_size + 1),
+            maximum = Vector(max_w - bed_adhesion_size - 1, max_h - self._raft_thickness - self._extra_z_clearance, max_d - self._disallowed_area_size + bed_adhesion_size - 1)
         )
 
         self._application.getController().getScene()._maximum_bounds = scale_to_max_bounds  # type: ignore
@@ -645,7 +645,7 @@ class BuildVolume(SceneNode):
             for extruder in extruders:
                 extruder.propertyChanged.connect(self._onSettingPropertyChanged)
 
-            self._width = self._global_container_stack.getProperty("machine_width", "value") * self._scale_vector.x
+            self._width = self._global_container_stack.getProperty("machine_width", "value")
             machine_height = self._global_container_stack.getProperty("machine_height", "value")
             if self._global_container_stack.getProperty("print_sequence", "value") == "one_at_a_time" and len(self._scene_objects) > 1:
                 self._height = min(self._global_container_stack.getProperty("gantry_height", "value") * self._scale_vector.z, machine_height)
@@ -656,7 +656,7 @@ class BuildVolume(SceneNode):
             else:
                 self._height = self._global_container_stack.getProperty("machine_height", "value")
                 self._build_volume_message.hide()
-            self._depth = self._global_container_stack.getProperty("machine_depth", "value") * self._scale_vector.y
+            self._depth = self._global_container_stack.getProperty("machine_depth", "value")
             self._shape = self._global_container_stack.getProperty("machine_shape", "value")
 
             self._updateDisallowedAreas()
@@ -752,8 +752,8 @@ class BuildVolume(SceneNode):
             return
         self._updateScaleFactor()
         self._height = self._global_container_stack.getProperty("machine_height", "value") * self._scale_vector.z
-        self._width = self._global_container_stack.getProperty("machine_width", "value") * self._scale_vector.x
-        self._depth = self._global_container_stack.getProperty("machine_depth", "value") * self._scale_vector.y
+        self._width = self._global_container_stack.getProperty("machine_width", "value")
+        self._depth = self._global_container_stack.getProperty("machine_depth", "value")
         self._shape = self._global_container_stack.getProperty("machine_shape", "value")
 
     def _updateDisallowedAreasAndRebuild(self):
@@ -770,14 +770,6 @@ class BuildVolume(SceneNode):
         self._extra_z_clearance = self._calculateExtraZClearance(ExtruderManager.getInstance().getUsedExtruderStacks())
         self.rebuild()
 
-    def _scaleAreas(self, result_areas: List[Polygon]) -> None:
-        if self._global_container_stack is None:
-            return
-        for i, polygon in enumerate(result_areas):
-            result_areas[i] = polygon.scale(
-                100.0 / max(100.0, self._global_container_stack.getProperty("material_shrinkage_percentage_xy", "value"))
-            )
-
     def _updateDisallowedAreas(self) -> None:
         if not self._global_container_stack:
             return
@@ -833,11 +825,9 @@ class BuildVolume(SceneNode):
 
         self._disallowed_areas = []
         for extruder_id in result_areas:
-            self._scaleAreas(result_areas[extruder_id])
             self._disallowed_areas.extend(result_areas[extruder_id])
         self._disallowed_areas_no_brim = []
         for extruder_id in result_areas_no_brim:
-            self._scaleAreas(result_areas_no_brim[extruder_id])
             self._disallowed_areas_no_brim.extend(result_areas_no_brim[extruder_id])
 
     def _computeDisallowedAreasPrinted(self, used_extruders):
@@ -993,6 +983,9 @@ class BuildVolume(SceneNode):
             half_machine_width = self._global_container_stack.getProperty("machine_width", "value") / 2
             half_machine_depth = self._global_container_stack.getProperty("machine_depth", "value") / 2
 
+            # We need at a minimum a very small border around the edge so that models can't go off the build plate
+            border_size = max(border_size, 0.1)
+
             if self._shape != "elliptic":
                 if border_size - left_unreachable_border > 0:
                     result[extruder_id].append(Polygon(numpy.array([

Некоторые файлы не были показаны из-за большого количества измененных файлов