Compare commits

..

82 Commits

Author SHA1 Message Date
Noisyfox
8a42aed683 Fix issue with auto orient a scaled object. (#3904)
Partly revert 73ab032e82
2024-02-15 20:08:33 +08:00
Noisyfox
989fab03c0 Fix some rotation-related issues (#3890)
* Fix issue with max_z after rotation

* Don't use `object.bounding_box()`, use `bounding_box_exact()` instead.

* Fix auto-orient

---------

Co-authored-by: SoftFever <softfeverever@gmail.com>
2024-02-15 20:08:28 +08:00
SoftFever
ffe91cc718 bump version to 1.9.1 2024-02-14 21:00:48 +08:00
SoftFever
1a6a1b4964 Security: skip more print_host related info 2024-02-14 21:00:33 +08:00
SoftFever
90cfdbf37c Security: skip writing print_host and apikey in gcode (#4030) 2024-02-14 19:35:57 +08:00
Noisyfox
40f678006d Fix painting Gizmo rendering on AMD Vega GPUs (#3663)
* Fix painting gizmo rendering on AMD Vega GPUs

* Fix issue that support & seam painting gizmo rendering issue if wireframe is enabled in MMU gizmo
2024-02-14 19:35:20 +08:00
Ioannis Giannakas
3cda86827f [Bug fix] Fixes retraction on layer change being performed when retract travel threshold is set to 0 (#3614)
Fixes retraction on layer change being performed when retract travel threshold is set to 0
2024-02-14 19:35:20 +08:00
Ioannis Giannakas
9e8efa510d Fix issue with PA pattern test using travel acceleration and jerk for the PA patterns (#3851) 2024-02-14 19:35:20 +08:00
Ioannis Giannakas
8a03dd1b09 Bug: Fix retraction issues with PA pattern calibration (#3314)
* Attempt to fix retraction issues with PA pattern calibration

* PA pattern test fix - retract and wipe on layer change

* Naming convention

* fix crash
2024-02-14 19:34:30 +08:00
SoftFever
9f6f40ac96 Enforce retraction before wipe (#3888)
enforce retraction before wipe
2024-02-14 19:34:30 +08:00
SoftFever
51cd5a2237 bump version profile version to "01.09.00.02" 2024-01-05 07:58:39 +08:00
SoftFever
0ca6822406 Fixed an issue that some profiles has ironings enabled by default 2024-01-05 07:57:09 +08:00
SoftFever
cf0d5de649 Added an option to enable multiple bed type support for printers 2024-01-04 23:12:36 +08:00
SoftFever
6902098b37 Fixed crashes when send gcode to BBL printers 2024-01-04 19:30:21 +08:00
SoftFever
ea760432ae update gitignore 2024-01-04 19:30:21 +08:00
SoftFever
cb537a42b1 fix object exclusion regression on BBL printers 2024-01-04 19:30:21 +08:00
SoftFever
65ac5cebf6 skip writting object info for BBL printers 2024-01-04 19:30:21 +08:00
Noisyfox
002208fc8c QoL: Keyboard shortcuts updates & fixes (#3457)
* Bring back the shortcut to zoom in & out

* Update keyboard shortcut info

* Update keyboard shortcut info

* Different handling of shortcut 'T' for emboss text

Cherry-picked from prusa3d/PrusaSlicer@58e3143ad8

Co-authored-by: Filip Sykala - NTB T15p <Filip.Sykala@prusa3d.cz>

---------

Co-authored-by: Filip Sykala - NTB T15p <Filip.Sykala@prusa3d.cz>
2024-01-04 19:28:19 +08:00
SoftFever
77b6225060 Feature/update deps (#3445)
* update deps

* fix win build errors

* fix mac build

* update linux
2024-01-04 06:50:11 +08:00
Noisyfox
08d938b8e7 Fix NaN when adding negative part (#3423) (#3431)
(cherry picked from commit 1ea33f0919)
2024-01-02 20:49:20 +08:00
SoftFever
54ab738323 some profile changes based on feedbacks
(cherry picked from commit 8e3f7e7bf2)
2024-01-02 20:49:17 +08:00
SoftFever
b2ce4c1880 Fix boost download server issue 2024-01-02 16:25:08 +08:00
SoftFever
6b1c1a6b6b bump to 1.9.0 official version 2024-01-02 16:03:58 +08:00
Noisyfox
b624aa0580 Fix issue that "Per-glyph" option not working when UI is in Chinese (#3425)
(cherry picked from commit 712478c240)
2024-01-02 16:01:29 +08:00
SoftFever
cc593f99f8 Improve rendering quality when model color is pure black
(cherry picked from commit 9e443baf95)
2024-01-02 15:47:16 +08:00
SoftFever
1e0b5b5c68 Set CMAKE_OSX_DEPLOYMENT_TARGET properly on dev machine when calling build_release_mac.sh
(cherry picked from commit 8d5bb6cc4b)
2024-01-02 15:47:13 +08:00
SoftFever
9d26cbf80f bump version to 1.9.0 rc 2024-01-01 20:14:28 +08:00
Thomas
89f23b76be Added PAUSE command for change_filament_gcode on Elegoo Neptune 4 series (#3411)
Added PAUSE command for change_filament_gcode

on-behalf-of: @tomsbasement <tom@tomsbasement.shop>
(cherry picked from commit 9701ab18e8)
2024-01-01 20:06:21 +08:00
SufficentMuffin
38087db380 Update 0.48mm Standard @BBL X1C 0.8 nozzle.json (#3379)
* Update 0.48mm Standard @BBL X1C 0.8 nozzle.json

Removed P1S 0.6mm nozzle from process profile.

* fix

---------

Co-authored-by: SoftFever <softfeverever@gmail.com>
(cherry picked from commit f99394b53c)
2024-01-01 20:06:21 +08:00
Thomas
d165b6b2c5 Updated French translations. (#3410)
on-behalf-of: @tomsbasement tom@tomsbasement.shop
(cherry picked from commit 2cfcd0d03a)
2024-01-01 20:06:21 +08:00
SoftFever
766d1a4fca fix intermittent crashes caused by detect_overhang_wall
(cherry picked from commit 4d1885e7a4)
2024-01-01 20:06:21 +08:00
SoftFever
b62ce6095d Fxied a regression that wall order can't be set in height modifier
(cherry picked from commit 5683729b17)
2024-01-01 20:06:21 +08:00
SoftFever
7b43991a36 Fixed crashes caused by pressure eq when support is used (#3407)
Fixed crashed caused by pressure eq when support is used

(cherry picked from commit 2f916f5ee9)
2024-01-01 20:06:20 +08:00
Thomas
90c88a4c41 Creality K1/K1 Max, Ender 3 V3 Series and Ender 5 S1 baseplates (#3365)
* Fixed retraction speed and added missing parameters.

* Fixes for manual filament change

* More tunings and fixes.

* Fixes and tunings

* Formatting

* Decrease z-hop for K1

* K1/K1 Max, Ender 3 V3 and Ender 5 S1 correct build platforms (Thanks Henlor !)

(cherry picked from commit 967dc3d487)
2024-01-01 20:06:20 +08:00
SoftFever
0a223c5f0e Revert "Improve ExtrusionLine::simplify, eliminating many very-short extrusion segments which led to blemishes in thin-wall models sliced with Arachne (#3014)"
This reverts commit 3ca290d503.

Fixed #3340 #3375

(cherry picked from commit a36df66083)
2024-01-01 20:06:20 +08:00
Olcay ÖREN
2f4549441b Update OrcaSlicer_tr.po - TURKISH translation update (#3396)
* Update OrcaSlicer_tr.po - TURKISH translation update

* Update OrcaSlicer_tr.po - TURKISH translation update

---------

Co-authored-by: SoftFever <softfeverever@gmail.com>
(cherry picked from commit 1dfaef3948)
2024-01-01 20:06:20 +08:00
Vitalii Kutia
bf8deb95cd edit Ukrainian translation (#3403)
(cherry picked from commit c623070395)
2024-01-01 20:06:20 +08:00
Lee Jong Mun
bd23b9c5b7 kor translation update (#3406)
(cherry picked from commit 52c08ca481)
2024-01-01 20:06:20 +08:00
Noisyfox
7ddaa8d383 Fix crash when click the color paint gizmo when object part is selected (#3405)
Fix crash when click the color paint gizmo when object part is selected (#3404)

Cherry-picked from bambulab/BambuStudio@1e99ce9535

Co-authored-by: liz.li <liz.li@bambulab.com>
(cherry picked from commit 8fd4477110)
2024-01-01 20:06:20 +08:00
Silence
2511360495 Update README.md to provide alternative download links of webview2 runtimes (#3384)
Improve install and build instructions slightly.

(cherry picked from commit 60ab79cae0)
2024-01-01 20:06:20 +08:00
Thomas
ef8e4e4bfb Creality Ender 3 V3/KE important fixes and some fine-tunings (#3362)
* Fixed retraction speed and added missing parameters.

* Fixes for manual filament change

* More tunings and fixes.

* Fixes and tunings

* Formatting

* Decrease z-hop for K1

* Updated thumbnails sizes to the same as Creality Print has.

(cherry picked from commit 98a9bf6170)
2024-01-01 20:06:20 +08:00
Thomas
2ca195f6e1 Fr translations (#3361)
* Updated French translations.

* Reword "strength"

* Updated translations

* Added missing translations.

* Fixed place on face translation

* Fixed strings.

* Updated locales

* Better translation for "Brim ears"

* Other round of fixes

* Added missing strings

* Renaming studio to Orca.

* Rewording "Arc fitting"

* Flush means purge and not "rinçage"

(cherry picked from commit 8afb675cd7)
2024-01-01 20:06:20 +08:00
Heiko Liebscher
f8de5891f9 Fix de for 1.9 release (#3387)
fix some typos and new msgids
2023-12-31 19:11:16 +08:00
SoftFever
3da54f39da fixed a crash bug when switching to Bambu device page too fast 2023-12-31 13:28:19 +08:00
Noisyfox
08577429ac Fix preview legend window size (#3363)
Fix issue that the legend window expands to all available horizontal space if scrollbar is displayed

(cherry picked from commit a8ade1554f)
2023-12-30 22:03:07 +08:00
SoftFever
5a14fa2581 remove P1P-P1S warning
(cherry picked from commit 1d8cdf04d2)
2023-12-30 15:24:05 +08:00
SoftFever
b4633dc863 bump version to 1.9.0 beta 2023-12-30 10:34:42 +08:00
SoftFever
fbea2072f9 preset export small tweak 2023-12-30 10:34:42 +08:00
kpishere
0d49816796 Feature/build target 10.15 (#3252)
* Set target to 10.15, make porter templates explicit

* CMAKE_OSX_DEPLOYMENT_TARGET refactor

* Update build_release_macos.sh

fix typo

---------

Co-authored-by: SoftFever <softfeverever@gmail.com>
2023-12-30 10:34:42 +08:00
Olcay ÖREN
696778e8e2 Update OrcaSlicer_tr.po - TURKISH translation update (#3354)
Co-authored-by: SoftFever <softfeverever@gmail.com>
2023-12-30 10:34:42 +08:00
SoftFever
9b1f7ed928 fix po errors 2023-12-30 10:34:42 +08:00
SoftFever
3364fc4d4c Rename '.bbscfg/bbsflmt' to 'orca_printer/orca_filament' for clarity and to reduce user errors. Note: Configs may no longer be compatible with BS hence the change 2023-12-30 10:34:42 +08:00
SoftFever
a5f1bf7fa8 create datadir folder if not exist 2023-12-30 10:34:42 +08:00
Fabio Forcina
781b187e40 Updated Italian translation (#3347) 2023-12-30 10:34:42 +08:00
Heiko Liebscher
8e49fa1ade Update German translation for 1.9 (#3343) 2023-12-30 10:34:42 +08:00
Thomas
3607d805c7 Changed Slic3r mentions (#3344) 2023-12-30 10:34:42 +08:00
SoftFever
b46f46f47d update locale 2023-12-30 10:34:41 +08:00
SoftFever
08b1447276 check for new version rework, support "check for stable updates only" mode 2023-12-30 10:34:41 +08:00
SoftFever
bd700071f2 make exclude_object off by default 2023-12-30 10:34:41 +08:00
just-trey
9208767b18 Profile: Anker M5/C first layer consistency improvements (#3321)
first layer consistency improvments
2023-12-30 10:34:41 +08:00
Thomas
3537bd29ae Fixed typo (#3331)
* Fixed typo

* An other swtitch

* Main-i-fold(tm)
2023-12-30 10:34:41 +08:00
Thomas
90aa9b1268 Fixes and simplification of some Creality profiles. (#3315)
* Fixes and simplification of some Creality profiles.

* Set correct support_air_filtration for K1 Max
2023-12-30 10:34:41 +08:00
SoftFever
7101f5ba53 fix/update locale 2023-12-30 10:34:41 +08:00
SoftFever
f92cce494a add more hints 2023-12-30 10:34:41 +08:00
SoftFever
a9c0e3a1c5 Fixed a regression bug that --datadir was broken
fixed #3191
2023-12-30 10:34:41 +08:00
Ioannis Giannakas
6060777dd0 ENH: Port of "wipe inside before extruding an external perimeter" feature from super slicer (#3287)
* Wipe Inside at Start of perimeter

Co-Authored-By: Merill <6536403+supermerill@users.noreply.github.com>

* Cleaned up code and linked it to the wipe on loop parameter

* Trigger build

* Introduced wipe before external loop parameter.

* Removed redundant functions

---------

Co-authored-by: Merill <6536403+supermerill@users.noreply.github.com>
Co-authored-by: SoftFever <softfeverever@gmail.com>
2023-12-30 10:34:41 +08:00
Thomas
08ba3af15d Update OrcaSlicer_fr.po (#3295)
* Update OrcaSlicer_fr.po

Added missing translations.

* Update OrcaSlicer_fr.po

* Update OrcaSlicer_fr.po

* Update OrcaSlicer_fr.po

* Update OrcaSlicer_fr.po
2023-12-30 10:34:41 +08:00
Hukete
1a9332f91f QIDI: Add two new filaments (#3304)
* 10-25

Add TPU-95A HF

* 1030

Adding Introduction of Chamber Temperature Control Macros(M191) to Notes

* 1102

Add ABS-GF10 profile,
Remove a extra "s" from the "0.36mm Standard @Qidi XPlus3 0.6 nozzle.json" file

* 1106

Add the PA value to some genetic filament profiles

* Add new filaments profiles

Add new filaments profiles

* 1

1

* Add two new filaments

Add two new filaments
2023-12-30 10:34:41 +08:00
SoftFever
3f9fa08c92 Fixed a bug that spiral_mode_max_xy_smoothing was not hiden when vase is not enabled 2023-12-30 10:34:41 +08:00
SoftFever
bc76677e51 Fixed a regression that Turkish lang option was missing
Fixed #3278
2023-12-30 10:34:41 +08:00
SoftFever
cd029a3727 Layer height can't be zero. Fixed #3268 2023-12-30 10:34:41 +08:00
Lee Jong Mun
f82b50f521 kor translation update (#3288)
fix typo
2023-12-30 10:34:41 +08:00
Ikko Eltociear Ashimine
8396fc0622 Update README.md (#3281)
bellow -> below
2023-12-30 10:34:41 +08:00
Lee Jong Mun
e1c9915d49 kor translation update (#3272)
fix type

다리 -> 브릿지
프리셋 -> 사전설정
퇴출 -> 후퇴
갭 -> 간격
인쇄 -> 출력
2023-12-30 10:34:40 +08:00
Olcay ÖREN
0de3b0352d Update Turkish translation (#3270)
* Update OrcaSlicer_tr.po

New English terms were translated into Turkish.

* Update OrcaSlicer_tr.po

* Turkish language sentences were added.

* Turkish words were edited.

* Turkish words were edited.

* Turkish words were edited.

* Turkish words were edited.

* Turkish words were edited.

* Turkish translation update

* Update Turkish translation
2023-12-30 10:34:40 +08:00
SoftFever
5b3b064954 Don't hide exclude_object option for Marlin/RRF firmwares as Orca now support these firmwares
Fixed #3267
2023-12-30 10:34:40 +08:00
SoftFever
485e1ccc49 workaround to solve unwanted zstd dependency on runner (#3298)
* trigger build

* Remove zstd only for dep build

* reinstall zstd after building completed
2023-12-27 07:43:05 +00:00
SoftFever
fedd2bd1d0 downgrade to macos-12 as there are not many macos-13 runner instances availble yet 2023-12-26 21:09:58 +08:00
SoftFever
2436988e4d upgrade to macos 13 (#3289)
brew uninstall --ignore-dependencies zstd
Use local curl
remove brew/macport dependency
2023-12-26 20:56:58 +08:00
SoftFever
38b22fcee6 upgrade libjpeg-turbo to 3.0.1 to properly suppor cross compile 2023-12-25 18:31:12 +08:00
SoftFever
0b0fd2f518 force to use own glew even if the system has installed one(brew) 2023-12-25 18:30:30 +08:00
SoftFever
0fa5100933 Move DL_CACHE into deps folder. Make cross compile easier 2023-12-25 18:29:18 +08:00
9293 changed files with 173833 additions and 679706 deletions

View File

@@ -1,10 +0,0 @@
# Add directories or file patterns to ignore during indexing (e.g. foo/ or *.csv)
deps/
build_*/
build/
localization/
sandboxes/
resources/*
!resources/web/
!resources/dailytip
!resources/shaders

View File

@@ -1,2 +0,0 @@
ARG BASE_IMAGE
FROM ${BASE_IMAGE}

View File

@@ -1,51 +0,0 @@
{
"name": "OrcaSlicer",
"build": {
"dockerfile": "Dockerfile",
"args": {
"PLATFORM": "linux/amd64",
"BASE_IMAGE": "mcr.microsoft.com/devcontainers/cpp:ubuntu-22.04"
},
"options": ["--platform=linux/amd64"]
},
"runArgs": ["--platform=linux/amd64"],
"features": {
"ghcr.io/devcontainers/features/desktop-lite:1": {
"password": "orca"
}
},
"customizations": {
"vscode": {
"settings": {
"cmake.configureArgs": [
"-DSLIC3R_GTK=3",
"-DBBL_RELEASE_TO_PUBLIC=1",
"-DBBL_INTERNAL_TESTING=0",
"-DSLIC3R_STATIC=1",
"-DCMAKE_PREFIX_PATH=${workspaceFolder}/deps/build/destdir/usr/local"
]
},
// Add the IDs of extensions you want installed when the container is created.
"extensions": [
"ms-vscode.cmake-tools",
"ms-vscode.cpptools-extension-pack"
]
}
},
"forwardPorts": [6080],
"portsAttributes": {
"6080": {
"label": "VNC web client (noVNC)",
"onAutoForward": "silent"
}
},
"otherPortsAttributes": {
"onAutoForward": "ignore"
},
"onCreateCommand": {
"Set postCreate executable flag": "chmod +x .devcontainer/postCreate.sh"
},
"postCreateCommand": "sudo .devcontainer/postCreate.sh"
}

View File

@@ -1,15 +0,0 @@
#!/bin/bash
# Update and upgrade all system packages
apt update
apt upgrade -y
build_linux="./build_linux.sh -u"
echo "-----------------------------------------"
echo "Running ${build_linux}..."
echo "-----------------------------------------"
${build_linux}
echo "------------------------------"
echo "Installing missing packages..."
echo "------------------------------"
apt install -y libgl1-mesa-dev m4 autoconf libtool

View File

@@ -22,7 +22,6 @@ deps/build-linux/*
**/.DS_Store **/.DS_Store
install_* install_*
build_*/ build_*/
!build_linux.sh
SVG SVG
Dockerfile Dockerfile
DockerBuild.sh DockerBuild.sh

2
.gitattributes vendored
View File

@@ -1,2 +0,0 @@
# Set the default behavior, in case people don't have core.autocrlf set.
* text=auto

1
.github/FUNDING.yml vendored
View File

@@ -1,3 +1,2 @@
github: SoftFever
ko_fi: SoftFever ko_fi: SoftFever
custom: https://paypal.me/softfever3d custom: https://paypal.me/softfever3d

View File

@@ -1,58 +1,36 @@
name: 🐞 Bug Report name: Bug Report
description: File a bug report description: File a bug report
labels: ["bug"] labels: bug
body: body:
- type: markdown - type: markdown
attributes: attributes:
value: | value: |
**Thank you for using Orca Slicer and wanting to report a bug.** **Thank you for using Orca Slicer and wanting to report a bug.**
Please note that this is not the place to make feature requests or ask for help.
For this, please use the [Feature request](https://github.com/SoftFever/OrcaSlicer/issues/new?assignees=&labels=&projects=&template=feature_request.yml) issue type or you can discuss your idea on our [Discord server](https://discord.gg/P4VE9UY9gJ) with others.
Before filing, please check if the issue already exists (either open or closed) by using the search bar on the issues page. If it does, comment there. Even if it's closed, we can reopen it based on your comment. Before filing, please check if the issue already exists (either open or closed) by using the search bar on the issues page. If it does, comment there. Even if it's closed, we can reopen it based on your comment.
- type: checkboxes
attributes:
label: Is there an existing issue for this problem?
description: Please search to see if an issue already exists for the bug you encountered.
options:
- label: I have searched the existing issues
required: true
- type: input - type: input
id: version id: version
attributes: attributes:
label: OrcaSlicer Version label: OrcaSlicer Version
description: Which version of Orca Slicer are you running? You can see the full version in `Help` -> `About Orca Slicer`. description: Which version of Orca Slicer are you running? You can see the full version in `Help` -> `About Orca Slicer`.
placeholder: e.g. 1.9.0 placeholder: e.g. 1.6.6
validations:
required: true
- type: dropdown
id: os_type
attributes:
label: "Operating System (OS)"
description: "What OSes are you are experiencing issues on?"
multiple: true
options:
- Linux
- macOS
- Windows
validations: validations:
required: true required: true
- type: input - type: input
id: os_version id: os_info
attributes: attributes:
label: "OS Version" label: OS version
description: "What OS version does this relate to?" description: Which OS version are you using?
placeholder: "i.e. OS: Windows 7/8/10/11 ..., Ubuntu 22.04/Fedora 36 ..., macOS 10.15/11.1/12.3 ..." placeholder: |
OS: Windows 7/8/10/11 ... , Ubuntu 22.04/Fedora 36 ... , macOS 10.15/11.1/12.3 ...
validations: validations:
required: true required: true
- type: textarea - type: textarea
id: system_info id: system_info
attributes: attributes:
label: Additional system information label: Additional system information
description: For the performance issue, please also show the CPU, Memory information; For the 3D Rendering issue, please also show the Display Card information. description: For the performance issue, please also show the CPUMemory information; For the 3D Rendering issue, please also show the Display Card information.
placeholder: | placeholder: |
CPU: 11th gen Intel r core tm i7-1185g7/AMD Ryzen 7 6800h/... CPU: 11th gen intel r core tm i7-1185g7/amd ryzen 7 6800h/...
Memory: 32/16 GB... Memory: 32/16 GB...
Display Card: NVIDIA Quadro P400/... Display Card: NVIDIA Quadro P400/...
validations: validations:
@@ -72,8 +50,8 @@ body:
description: Please described the detailed steps to reproduce this issue description: Please described the detailed steps to reproduce this issue
placeholder: | placeholder: |
1. Go to '...' 1. Go to '...'
2. Click on '...' 2. Click on '....'
3. Scroll down to '...' 3. Scroll down to '....'
4. See error 4. See error
validations: validations:
required: true required: true
@@ -122,12 +100,3 @@ body:
options: options:
- label: Log file - label: Log file
- label: Project file - label: Project file
- type: textarea
attributes:
label: Anything else?
description: |
Screenshots? References? Anything that will give us more context about the issue you are encountering!
Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in.
validations:
required: false

View File

@@ -1,8 +0,0 @@
blank_issues_enabled: false
contact_links:
- name: Community Support (Discord channel)
url: https://discord.gg/P4VE9UY9gJ
about: Please ask and answer support "how do I?"questions here.
- name: Discussion Forum
url: https://github.com/SoftFever/OrcaSlicer/discussions
about: Please raise ideas and feature suggestions here.

View File

@@ -0,0 +1,23 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''
---
**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
**Which printers will be beneficial to this feature**
E.g. Voron/Klipper based printer/etc...
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.
**Additional context**
Add any other context or screenshots about the feature request here.

View File

@@ -1,66 +0,0 @@
name: 🚀 Feature Request / Enhancement
description: Suggest an improvement to make Orca Slicer even better!
labels: ["enhancement"]
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to fill out this feature request!
If your idea is still at the formulation stage, or you're not sure it would
be useful to many users, you can raise it as a discussion topic under [Ideas](https://github.com/SoftFever/OrcaSlicer/discussions/categories/ideas)
or you can raise it on the [Discord server](https://discord.gg/P4VE9UY9gJ).
- type: checkboxes
attributes:
label: Is there an existing issue for this feature request?
description: |
Please search to see if an issue already exists for a feature, or perhaps one similar.
You can then comment and react so that we know know much interest there is in the feature request.
options:
- label: I have searched the existing issues
required: true
- type: textarea
attributes:
label: Is your feature request related to a problem?
description: A clear and concise description of what the problem is.
placeholder: I'm always frustrated when [...]
validations:
required: true
- type: dropdown
attributes:
label: Which printers will be beneficial to this feature?
description: Select affected printer firmware type.
multiple: true
options:
- Klipper
- Marlin
- Others
- All
validations:
required: true
- type: textarea
attributes:
label: Describe the solution you'd like
description: A clear and concise description of what you want to happen.
placeholder: It should do [...]
validations:
required: true
- type: textarea
attributes:
label: Describe alternatives you've considered
description: A clear and concise description of any alternative solutions or features you've considered.
placeholder: |
1. [...]
2. [...]
3. [...]
validations:
required: false
- type: textarea
attributes:
label: Additional context
description: |
Add any other context, diagrams, illustations or screenshots about the feature request here.
Tip: You can attach images or log files by clicking this area to highlight it and then dragging files in.
validations:
required: false

View File

@@ -1,18 +0,0 @@
version: 2
updates:
# Only care about major updates to github actions
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "monthly"
ignore: # Only suggest major updates for built-in actions
- dependency-name: "github/*"
update-types: ["version-update:semver-patch", "version-update:semver-minor"]
- dependency-name: "actions/*"
update-types: ["version-update:semver-patch", "version-update:semver-minor"]
# Docker dependencies
- package-ecosystem: "docker"
directory: "/"
schedule:
interval: "monthly"
# no support for c/cpp

View File

@@ -1,21 +0,0 @@
# Description
<!--
> Please provide a summary of the changes made in this PR. Include details such as:
> * What issue does this PR address or fix?
> * What new features or enhancements does this PR introduce?
> * Are there any breaking changes or dependencies that need to be considered?
-->
# Screenshots/Recordings/Graphs
<!--
> Please attach relevant screenshots to showcase the UI changes.
> Please attach images that can help explain the changes.
-->
## Tests
<!--
> Please describe the tests that you have conducted to verify the changes made in this PR.
-->

View File

@@ -13,7 +13,6 @@ on:
- 'localization/**' - 'localization/**'
- 'resources/**' - 'resources/**'
- ".github/workflows/build_*.yml" - ".github/workflows/build_*.yml"
- 'flatpak/**'
pull_request: pull_request:
branches: branches:
@@ -25,10 +24,6 @@ on:
- '**/CMakeLists.txt' - '**/CMakeLists.txt'
- 'version.inc' - 'version.inc'
- ".github/workflows/build_*.yml" - ".github/workflows/build_*.yml"
- 'build_linux.sh'
- 'build_release_vs2022.bat'
- 'build_release_macos.sh'
- 'flatpak/**'
workflow_dispatch: # allows for manual dispatch workflow_dispatch: # allows for manual dispatch
inputs: inputs:
@@ -49,76 +44,15 @@ jobs:
fail-fast: false fail-fast: false
matrix: matrix:
include: include:
# Deprecate 20.04appimage - os: ubuntu-20.04
# - os: ubuntu-20.04
- os: ubuntu-24.04
- os: windows-latest - os: windows-latest
- os: macos-14 - os: macos-12
arch: x86_64
- os: macos-12
arch: arm64 arch: arm64
uses: ./.github/workflows/build_check_cache.yml uses: ./.github/workflows/build_check_cache.yml
with: with:
os: ${{ matrix.os }} os: ${{ matrix.os }}
arch: ${{ matrix.arch }} arch: ${{ matrix.arch }}
build-deps-only: ${{ inputs.build-deps-only || false }} build-deps-only: ${{ inputs.build-deps-only || false }}
secrets: inherit secrets: inherit
flatpak:
name: "Flatpak"
container:
image: ghcr.io/flathub-infra/flatpak-github-actions:gnome-47
options: --privileged
volumes:
- /usr/local/lib/android:/usr/local/lib/android
- /usr/share/dotnet:/usr/share/dotnet
- /opt/ghc:/opt/ghc1
- /usr/local/share/boost:/usr/local/share/boost1
strategy:
matrix:
variant:
- arch: x86_64
runner: ubuntu-24.04
- arch: aarch64
runner: ubuntu-24.04-arm
runs-on: ${{ matrix.variant.runner }}
env:
date:
ver:
ver_pure:
steps:
- name: "Remove unneeded stuff to free disk space"
run:
rm -rf /usr/local/lib/android/* /usr/share/dotnet/* /opt/ghc1/* "/usr/local/share/boost1/*"
- uses: actions/checkout@v4
- name: Get the version and date
run: |
ver_pure=$(grep 'set(SoftFever_VERSION' version.inc | cut -d '"' -f2)
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
ver="PR-${{ github.event.number }}"
else
ver=V$ver_pure
fi
echo "ver=$ver" >> $GITHUB_ENV
echo "ver_pure=$ver_pure" >> $GITHUB_ENV
echo "date=$(date +'%Y%m%d')" >> $GITHUB_ENV
shell: bash
- uses: flathub-infra/flatpak-github-actions/flatpak-builder@master
with:
bundle: OrcaSlicer-Linux-flatpak_${{ env.ver }}_${{ matrix.variant.arch }}.flatpak
manifest-path: flatpak/io.github.softfever.OrcaSlicer.yml
cache: true
arch: ${{ matrix.variant.arch }}
upload-artifact: false
- name: Upload artifacts Flatpak
uses: actions/upload-artifact@v4
with:
name: OrcaSlicer-Linux-flatpak_${{ env.ver }}_${{ matrix.variant.arch }}.flatpak
path: '/__w/OrcaSlicer/OrcaSlicer/OrcaSlicer-Linux-flatpak_${{ env.ver }}_${{ matrix.variant.arch }}.flatpak'
- name: Deploy Flatpak to nightly release
if: ${{github.ref == 'refs/heads/main'}}
uses: WebFreak001/deploy-nightly@v3.2.0
with:
upload_url: https://uploads.github.com/repos/SoftFever/OrcaSlicer/releases/137995723/assets{?name,label}
release_id: 137995723
asset_path: /__w/OrcaSlicer/OrcaSlicer/OrcaSlicer-Linux-flatpak_${{ env.ver }}_${{ matrix.variant.arch }}.flatpak
asset_name: OrcaSlicer-Linux-flatpak_${{ env.ver }}_${{ matrix.variant.arch }}.flatpak
asset_content_type: application/octet-stream
max_releases: 1 # optional, if there are more releases than this matching the asset_name, the oldest ones are going to be deleted

View File

@@ -23,23 +23,22 @@ jobs:
valid-cache: ${{ steps.cache_deps.outputs.cache-hit }} valid-cache: ${{ steps.cache_deps.outputs.cache-hit }}
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v3
with:
lfs: 'true'
- name: set outputs - name: set outputs
id: set_outputs id: set_outputs
env: env:
# todo: this is mad! refactor other build scripts to use same name underscore-arch: ${{ inputs.os == 'macos-12' && '_' || ''}}${{ inputs.os == 'macos-12' && inputs.arch || '' }} # if is macos, make a string that does "_{arch}", else output nothing
dep-folder-name: ${{ inputs.os == 'windows-latest' && '/OrcaSlicer_dep' || inputs.os == 'macos-14' && '' || inputs.os != 'macos-14' && '/destdir' || '' }} dash-arch: ${{ inputs.os == 'macos-12' && '-' || ''}}${{ inputs.os == 'macos-12' && inputs.arch || '' }} # if is macos, make a string that does "-{arch}", else output nothing
dep-folder-name: ${{ (inputs.os == 'windows-latest' || inputs.os == 'macos-12') && 'OrcaSlicer_dep' || 'destdir' }}
output-cmd: ${{ inputs.os == 'windows-latest' && '$env:GITHUB_OUTPUT' || '"$GITHUB_OUTPUT"'}} output-cmd: ${{ inputs.os == 'windows-latest' && '$env:GITHUB_OUTPUT' || '"$GITHUB_OUTPUT"'}}
run: | run: |
echo cache-key=${{ inputs.os }}-cache-orcaslicer_deps-build-${{ hashFiles('deps/**') }} >> ${{ env.output-cmd }} echo cache-key=${{ runner.os }}${{ env.dash-arch }}-cache-orcaslicer_deps-build-${{ hashFiles('deps/**') }} >> ${{ env.output-cmd }}
echo cache-path=${{ github.workspace }}/deps/build${{ env.dep-folder-name }} >> ${{ env.output-cmd }} echo cache-path=${{ github.workspace }}/deps/build${{ env.underscore-arch }}/${{ env.dep-folder-name }}${{ env.underscore-arch }} >> ${{ env.output-cmd }}
- name: load cache - name: load cache
id: cache_deps id: cache_deps
uses: actions/cache@v4 uses: actions/cache@v3
with: with:
path: ${{ steps.set_outputs.outputs.cache-path }} path: ${{ steps.set_outputs.outputs.cache-path }}
key: ${{ steps.set_outputs.outputs.cache-key }} key: ${{ steps.set_outputs.outputs.cache-key }}

View File

@@ -28,114 +28,98 @@ jobs:
env: env:
date: date:
steps: steps:
# Setup the environment # Setup the environment
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v3
with:
lfs: 'true'
- name: load cached deps - name: load cached deps
uses: actions/cache@v4 uses: actions/cache@v3
with: with:
path: ${{ inputs.cache-path }} path: ${{ inputs.cache-path }}
key: ${{ inputs.cache-key }} key: ${{ inputs.cache-key }}
- uses: lukka/get-cmake@latest
with:
cmakeVersion: "~3.28.0" # use most recent 3.28.x version
- name: setup dev on Windows - name: setup dev on Windows
if: inputs.os == 'windows-latest' if: inputs.os == 'windows-latest'
uses: microsoft/setup-msbuild@v2 uses: microsoft/setup-msbuild@v1.1
- name: Get the date on Ubuntu and macOS - name: Get the date on Ubuntu and macOS
if: inputs.os != 'windows-latest' if: inputs.os != 'windows-latest'
run: echo "date=$(date +'%Y%m%d')" >> $GITHUB_ENV run: echo "date=$(date +'%Y%m%d')" >> $GITHUB_ENV
shell: bash shell: bash
- name: Get the date on Windows - name: Get the date on Windows
if: inputs.os == 'windows-latest' if: inputs.os == 'windows-latest'
run: echo "date=$(Get-Date -Format 'yyyyMMdd')" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8 run: echo "date=$(Get-Date -Format 'yyyyMMdd')" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8
shell: pwsh shell: pwsh
# Build Dependencies # Build Dependencies
- name: Build on Windows - name: Build on Windows
if: inputs.os == 'windows-latest' if: inputs.os == 'windows-latest'
working-directory: ${{ github.workspace }} working-directory: ${{ github.workspace }}
run: | run: |
choco install strawberryperl choco install strawberryperl
mkdir ${{ github.workspace }}/deps/build
mkdir ${{ github.workspace }}/deps/build/OrcaSlicer_dep
.\build_release_vs2022.bat deps .\build_release_vs2022.bat deps
.\build_release_vs2022.bat pack .\build_release_vs2022.bat pack
cd ${{ github.workspace }}/deps/build cd ${{ github.workspace }}/deps/build
- name: Build on Mac ${{ inputs.arch }} - name: Build on Mac ${{ inputs.arch }}
if: inputs.os == 'macos-14' if: inputs.os == 'macos-12'
working-directory: ${{ github.workspace }} working-directory: ${{ github.workspace }}
run: | run: |
brew install automake texinfo libtool brew install cmake git gettext automake texinfo
brew list brew list
mkdir -p ${{ github.workspace }}/deps/build_${{ inputs.arch }}
mkdir -p ${{ github.workspace }}/deps/build_${{ inputs.arch }}/OrcaSlicer_dep_${{ inputs.arch }}
brew uninstall --ignore-dependencies zstd brew uninstall --ignore-dependencies zstd
./build_release_macos.sh -dx -a universal -t 10.15 -1 ./build_release_macos.sh -dp -a ${{ inputs.arch }} -t 10.15
for arch in arm64 x86_64; do
(cd "${{ github.workspace }}/deps/build/${arch}" && \
find . -mindepth 1 -maxdepth 1 ! -name 'OrcaSlicer_dep' -exec rm -rf {} +)
done
brew install zstd brew install zstd
- name: Install Ubuntu Build Dependencies
if: inputs.os == 'ubuntu-20.04' || inputs.os == 'ubuntu-24.04'
working-directory: ${{ github.workspace }}
env:
apt-cmd: ${{ (inputs.os == 'ubuntu-20.04' && 'apt-fast') || (inputs.os == 'ubuntu-24.04' && 'sudo apt-get') || '' }}
webkit-ver: ${{ (inputs.os == 'ubuntu-20.04' && '4.0') || (inputs.os == 'ubuntu-24.04' && '4.1') || '' }}
run: |
${{ env.apt-cmd }} update
${{ env.apt-cmd }} install -y cmake git g++ build-essential libgl1-mesa-dev m4 \
libwayland-dev libxkbcommon-dev wayland-protocols extra-cmake-modules pkgconf \
libglu1-mesa-dev libcairo2-dev libgtk-3-dev libsoup2.4-dev libwebkit2gtk-${{ env.webkit-ver }}-dev \
libgstreamer1.0-dev libgstreamer-plugins-good1.0-dev libgstreamer-plugins-base1.0-dev \
gstreamer1.0-plugins-bad wget sudo autoconf curl libunwind-dev texinfo
- name: Build on Ubuntu - name: Build on Ubuntu
if: inputs.os == 'ubuntu-20.04' || inputs.os == 'ubuntu-24.04' if: inputs.os == 'ubuntu-20.04'
working-directory: ${{ github.workspace }} working-directory: ${{ github.workspace }}
run: | run: |
sudo apt-get update
sudo apt-get install -y cmake git g++ build-essential libgl1-mesa-dev m4 \
libwayland-dev libxkbcommon-dev wayland-protocols extra-cmake-modules pkgconf \
libglu1-mesa-dev libcairo2-dev libgtk-3-dev libsoup2.4-dev libwebkit2gtk-4.0-dev \
libgstreamer1.0-dev libgstreamer-plugins-good1.0-dev libgstreamer-plugins-base1.0-dev \
gstreamer1.0-plugins-bad libosmesa6-dev wget sudo autoconf curl libunwind-dev texinfo
mkdir -p ${{ github.workspace }}/deps/build mkdir -p ${{ github.workspace }}/deps/build
mkdir -p ${{ github.workspace }}/deps/build/destdir mkdir -p ${{ github.workspace }}/deps/build/destdir
sudo ./build_linux.sh -ur sudo ./BuildLinux.sh -ur
sudo chown $USER -R ./ sudo chown $USER -R ./
./build_linux.sh -dr ./BuildLinux.sh -dr
cd deps/build cd deps/build
tar -czvf OrcaSlicer_dep_ubuntu_$(date +"%Y%m%d").tar.gz destdir tar -czvf OrcaSlicer_dep_ubuntu_$(date +"%Y%m%d").tar.gz destdir
# Upload Artifacts # Upload Artifacts
# - name: Upload Mac ${{ inputs.arch }} artifacts - name: Upload Mac ${{ inputs.arch }} artifacts
# if: inputs.os == 'macos-14' if: inputs.os == 'macos-12'
# uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v3
# with: with:
# name: OrcaSlicer_dep_mac_${{ env.date }} name: OrcaSlicer_dep_mac_${{ inputs.arch }}_${{ env.date }}
# path: ${{ github.workspace }}/deps/build/OrcaSlicer_dep*.tar.gz path: ${{ github.workspace }}/deps/build_${{ inputs.arch }}/OrcaSlicer_dep*.tar.gz
- name: Upload Windows artifacts - name: Upload Windows artifacts
if: inputs.os == 'windows-latest' if: inputs.os == 'windows-latest'
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v3
with: with:
name: OrcaSlicer_dep_win64_${{ env.date }} name: OrcaSlicer_dep_win64_${{ env.date }}
path: ${{ github.workspace }}/deps/build/OrcaSlicer_dep*.zip path: ${{ github.workspace }}/deps/build/OrcaSlicer_dep*.zip
- name: Upload Ubuntu artifacts - name: Upload Ubuntu artifacts
if: ${{ ! env.ACT && inputs.os == 'ubuntu-20.04' || inputs.os == 'ubuntu-24.04' }} if: inputs.os == 'ubuntu-20.04'
env: uses: actions/upload-artifact@v3
ubuntu-ver: ${{ (inputs.os == 'ubuntu-20.04' && '2004') || (inputs.os == 'ubuntu-24.04' && '2404') || '' }}
uses: actions/upload-artifact@v4
with: with:
name: OrcaSlicer_dep_ubuntu_${{ env.ubuntu-ver }}_${{ env.date }} name: OrcaSlicer_dep_ubuntu_${{ env.date }}
path: ${{ github.workspace }}/deps/build/OrcaSlicer_dep_ubuntu_*.tar.gz path: ${{ github.workspace }}/deps/build/OrcaSlicer_dep_ubuntu_*.tar.gz
build_orca: build_orca:
name: Build OrcaSlicer name: Build OrcaSlicer
needs: [build_deps] needs: [build_deps]
@@ -147,3 +131,4 @@ jobs:
os: ${{ inputs.os }} os: ${{ inputs.os }}
arch: ${{ inputs.arch }} arch: ${{ inputs.arch }}
secrets: inherit secrets: inherit

View File

@@ -21,36 +21,23 @@ jobs:
env: env:
date: date:
ver: ver:
ver_pure:
steps: steps:
- name: Checkout - name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v3
with:
lfs: 'true'
- name: load cached deps
uses: actions/cache@v4
with:
path: ${{ inputs.cache-path }}
key: ${{ inputs.cache-key }}
fail-on-cache-miss: true
- uses: lukka/get-cmake@latest
with:
cmakeVersion: "~3.28.0" # use most recent 3.28.x version
- name: Get the version and date on Ubuntu and macOS - name: Get the version and date on Ubuntu and macOS
if: inputs.os != 'windows-latest' if: inputs.os != 'windows-latest'
run: | run: |
ver_pure=$(grep 'set(SoftFever_VERSION' version.inc | cut -d '"' -f2) if [ "${{ github.ref }}" == "refs/heads/main" ]; then
if [[ "${{ github.event_name }}" == "pull_request" ]]; then ver="nightly$(date +'%y%m%d')"
ver="PR-${{ github.event.number }}" elif [[ "${{ github.event_name }}" == "pull_request" ]]; then
ver="PR${{ github.event.number }}"
else else
ver=V$ver_pure ver=$(grep 'set(SoftFever_VERSION' version.inc | cut -d '"' -f2)
ver=V$ver
fi fi
echo "ver=$ver" >> $GITHUB_ENV echo "ver=$ver" >> $GITHUB_ENV
echo "ver_pure=$ver_pure" >> $GITHUB_ENV
echo "date=$(date +'%Y%m%d')" >> $GITHUB_ENV echo "date=$(date +'%Y%m%d')" >> $GITHUB_ENV
shell: bash shell: bash
@@ -61,8 +48,10 @@ jobs:
$ref = "${{ github.ref }}" $ref = "${{ github.ref }}"
$eventName = "${{ github.event_name }}" $eventName = "${{ github.event_name }}"
$prNumber = "${{ github.event.number }}" $prNumber = "${{ github.event.number }}"
if ($eventName -eq 'pull_request') { if ($ref -eq 'refs/heads/main') {
$ver = "nightly" + $date.Substring(2)
} elseif ($eventName -eq 'pull_request') {
$ver = "PR" + $prNumber $ver = "PR" + $prNumber
} else { } else {
$versionContent = Get-Content version.inc -Raw $versionContent = Get-Content version.inc -Raw
@@ -71,37 +60,37 @@ jobs:
} }
$ver = "V$ver" $ver = "V$ver"
} }
echo "ver=$ver" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8 echo "ver=$ver" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8
echo "date=$date" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8 echo "date=$date" | Out-File -Append -FilePath $env:GITHUB_ENV -Encoding utf8
echo "date: ${{ env.date }} version: ${{ env.ver }}" echo "date: ${{ env.date }} version: ${{ env.ver }}"
shell: pwsh shell: pwsh
- name: load cached deps
uses: actions/cache@v3
with:
path: ${{ inputs.cache-path }}
key: ${{ inputs.cache-key }}
# Mac # Mac
- name: Install tools mac - name: Install tools mac
if: inputs.os == 'macos-14' if: inputs.os == 'macos-12'
run: | run: |
brew install libtool brew install cmake git gettext tree
brew list brew list
mkdir -p ${{ github.workspace }}/deps/build mkdir -p ${{ github.workspace }}/deps/build_${{inputs.arch}}
mkdir -p ${{ github.workspace }}/deps/build_${{inputs.arch}}/OrcaSlicer_dep_${{inputs.arch}}
- name: Free disk space tree ${{ github.workspace }}/deps/build_${{inputs.arch}}/OrcaSlicer_dep_${{inputs.arch}}
if: inputs.os == 'macos-14'
run: |
df -hI /dev/disk3s1s1
sudo find /Applications -maxdepth 1 -type d -name "Xcode_*.app" ! -name "Xcode_15.4.app" -exec rm -rf {} +
sudo rm -rf ~/Library/Developer/CoreSimulator/Caches/*
df -hI /dev/disk3s1s1
- name: Build slicer mac - name: Build slicer mac
if: inputs.os == 'macos-14' if: inputs.os == 'macos-12'
working-directory: ${{ github.workspace }} working-directory: ${{ github.workspace }}
run: | run: |
./build_release_macos.sh -s -n -x -a universal -t 10.15 -1 ./build_release_macos.sh -s -n -a ${{inputs.arch}} -t 10.15
# Thanks to RaySajuuk, it's working now # Thanks to RaySajuuk, it's working now
- name: Sign app and notary - name: Sign app and notary
if: (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/')) && inputs.os == 'macos-14' if: (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/heads/release/')) && inputs.os == 'macos-12'
working-directory: ${{ github.workspace }} working-directory: ${{ github.workspace }}
env: env:
BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }} BUILD_CERTIFICATE_BASE64: ${{ secrets.BUILD_CERTIFICATE_BASE64 }}
@@ -118,93 +107,32 @@ jobs:
security import $CERTIFICATE_PATH -P $P12_PASSWORD -A -t cert -f pkcs12 -k $KEYCHAIN_PATH security import $CERTIFICATE_PATH -P $P12_PASSWORD -A -t cert -f pkcs12 -k $KEYCHAIN_PATH
security list-keychain -d user -s $KEYCHAIN_PATH security list-keychain -d user -s $KEYCHAIN_PATH
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k $P12_PASSWORD $KEYCHAIN_PATH security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k $P12_PASSWORD $KEYCHAIN_PATH
codesign --deep --force --verbose --options runtime --timestamp --entitlements ${{ github.workspace }}/scripts/disable_validation.entitlements --sign "$CERTIFICATE_ID" ${{ github.workspace }}/build/universal/OrcaSlicer/OrcaSlicer.app codesign --deep --force --verbose --options runtime --timestamp --entitlements ${{ github.workspace }}/scripts/disable_validation.entitlements --sign "$CERTIFICATE_ID" ${{ github.workspace }}/build_${{inputs.arch}}/OrcaSlicer/OrcaSlicer.app
# Sign OrcaSlicer_profile_validator.app if it exists ln -s /Applications ${{ github.workspace }}/build_${{inputs.arch}}/OrcaSlicer/Applications
if [ -f "${{ github.workspace }}/build/universal/OrcaSlicer/OrcaSlicer_profile_validator.app/Contents/MacOS/OrcaSlicer_profile_validator" ]; then hdiutil create -volname "OrcaSlicer" -srcfolder ${{ github.workspace }}/build_${{inputs.arch}}/OrcaSlicer -ov -format UDZO OrcaSlicer_Mac_${{inputs.arch}}_${{ env.ver }}.dmg
codesign --deep --force --verbose --options runtime --timestamp --entitlements ${{ github.workspace }}/scripts/disable_validation.entitlements --sign "$CERTIFICATE_ID" ${{ github.workspace }}/build/universal/OrcaSlicer/OrcaSlicer_profile_validator.app codesign --deep --force --verbose --options runtime --timestamp --entitlements ${{ github.workspace }}/scripts/disable_validation.entitlements --sign "$CERTIFICATE_ID" OrcaSlicer_Mac_${{inputs.arch}}_${{ env.ver }}.dmg
fi
# Create main OrcaSlicer DMG
ln -s /Applications ${{ github.workspace }}/build/universal/OrcaSlicer/Applications
hdiutil create -volname "OrcaSlicer" -srcfolder ${{ github.workspace }}/build/universal/OrcaSlicer -ov -format UDZO OrcaSlicer_Mac_universal_${{ env.ver }}.dmg
codesign --deep --force --verbose --options runtime --timestamp --entitlements ${{ github.workspace }}/scripts/disable_validation.entitlements --sign "$CERTIFICATE_ID" OrcaSlicer_Mac_universal_${{ env.ver }}.dmg
# Create separate OrcaSlicer_profile_validator DMG if the app exists
if [ -f "${{ github.workspace }}/build/universal/OrcaSlicer/OrcaSlicer_profile_validator.app/Contents/MacOS/OrcaSlicer_profile_validator" ]; then
mkdir -p ${{ github.workspace }}/build/universal/OrcaSlicer_profile_validator_dmg
cp -R ${{ github.workspace }}/build/universal/OrcaSlicer/OrcaSlicer_profile_validator.app ${{ github.workspace }}/build/universal/OrcaSlicer_profile_validator_dmg/
ln -s /Applications ${{ github.workspace }}/build/universal/OrcaSlicer_profile_validator_dmg/Applications
hdiutil create -volname "OrcaSlicer Profile Validator" -srcfolder ${{ github.workspace }}/build/universal/OrcaSlicer_profile_validator_dmg -ov -format UDZO OrcaSlicer_profile_validator_Mac_universal_${{ env.ver }}.dmg
codesign --deep --force --verbose --options runtime --timestamp --entitlements ${{ github.workspace }}/scripts/disable_validation.entitlements --sign "$CERTIFICATE_ID" OrcaSlicer_profile_validator_Mac_universal_${{ env.ver }}.dmg
fi
# Notarize main DMG
xcrun notarytool store-credentials "notarytool-profile" --apple-id "${{ secrets.APPLE_DEV_ACCOUNT }}" --team-id "${{ secrets.TEAM_ID }}" --password "${{ secrets.APP_PWD }}" xcrun notarytool store-credentials "notarytool-profile" --apple-id "${{ secrets.APPLE_DEV_ACCOUNT }}" --team-id "${{ secrets.TEAM_ID }}" --password "${{ secrets.APP_PWD }}"
xcrun notarytool submit "OrcaSlicer_Mac_universal_${{ env.ver }}.dmg" --keychain-profile "notarytool-profile" --wait xcrun notarytool submit "OrcaSlicer_Mac_${{inputs.arch}}_${{ env.ver }}.dmg" --keychain-profile "notarytool-profile" --wait
xcrun stapler staple OrcaSlicer_Mac_universal_${{ env.ver }}.dmg xcrun stapler staple OrcaSlicer_Mac_${{inputs.arch}}_${{ env.ver }}.dmg
# Notarize profile validator DMG if it exists
if [ -f "OrcaSlicer_profile_validator_Mac_universal_${{ env.ver }}.dmg" ]; then
xcrun notarytool submit "OrcaSlicer_profile_validator_Mac_universal_${{ env.ver }}.dmg" --keychain-profile "notarytool-profile" --wait
xcrun stapler staple OrcaSlicer_profile_validator_Mac_universal_${{ env.ver }}.dmg
fi
- name: Create DMG without notary - name: Create DMG without notary
if: github.ref != 'refs/heads/main' && inputs.os == 'macos-14' if: github.ref != 'refs/heads/main' && inputs.os == 'macos-12'
working-directory: ${{ github.workspace }} working-directory: ${{ github.workspace }}
run: | run: |
ln -s /Applications ${{ github.workspace }}/build/universal/OrcaSlicer/Applications ln -s /Applications ${{ github.workspace }}/build_${{inputs.arch}}/OrcaSlicer/Applications
hdiutil create -volname "OrcaSlicer" -srcfolder ${{ github.workspace }}/build/universal/OrcaSlicer -ov -format UDZO OrcaSlicer_Mac_universal_${{ env.ver }}.dmg hdiutil create -volname "OrcaSlicer" -srcfolder ${{ github.workspace }}/build_${{inputs.arch}}/OrcaSlicer -ov -format UDZO OrcaSlicer_Mac_${{inputs.arch}}_${{ env.ver }}.dmg
# Create separate OrcaSlicer_profile_validator DMG if the app exists
if [ -f "${{ github.workspace }}/build/universal/OrcaSlicer/OrcaSlicer_profile_validator.app/Contents/MacOS/OrcaSlicer_profile_validator" ]; then
mkdir -p ${{ github.workspace }}/build/universal/OrcaSlicer_profile_validator_dmg
cp -R ${{ github.workspace }}/build/universal/OrcaSlicer/OrcaSlicer_profile_validator.app ${{ github.workspace }}/build/universal/OrcaSlicer_profile_validator_dmg/
ln -s /Applications ${{ github.workspace }}/build/universal/OrcaSlicer_profile_validator_dmg/Applications
hdiutil create -volname "OrcaSlicer Profile Validator" -srcfolder ${{ github.workspace }}/build/universal/OrcaSlicer_profile_validator_dmg -ov -format UDZO OrcaSlicer_profile_validator_Mac_universal_${{ env.ver }}.dmg
fi
- name: Upload artifacts mac - name: Upload artifacts mac
if: inputs.os == 'macos-14' if: inputs.os == 'macos-12'
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v3
with: with:
name: OrcaSlicer_Mac_universal_${{ env.ver }} name: OrcaSlicer_Mac_${{inputs.arch}}_${{ env.ver }}
path: ${{ github.workspace }}/OrcaSlicer_Mac_universal_${{ env.ver }}.dmg path: ${{ github.workspace }}/OrcaSlicer_Mac_${{inputs.arch}}_${{ env.ver }}.dmg
- name: Upload OrcaSlicer_profile_validator DMG mac
if: inputs.os == 'macos-14'
uses: actions/upload-artifact@v4
with:
name: OrcaSlicer_profile_validator_Mac_universal_DMG_${{ env.ver }}
path: ${{ github.workspace }}/OrcaSlicer_profile_validator_Mac_universal_${{ env.ver }}.dmg
if-no-files-found: ignore
- name: Deploy Mac release
if: github.ref == 'refs/heads/main' && inputs.os == 'macos-14'
uses: WebFreak001/deploy-nightly@v3.2.0
with:
upload_url: https://uploads.github.com/repos/SoftFever/OrcaSlicer/releases/137995723/assets{?name,label}
release_id: 137995723
asset_path: ${{ github.workspace }}/OrcaSlicer_Mac_universal_${{ env.ver }}.dmg
asset_name: OrcaSlicer_Mac_universal_${{ env.ver }}.dmg
asset_content_type: application/octet-stream
max_releases: 1 # optional, if there are more releases than this matching the asset_name, the oldest ones are going to be deleted
- name: Deploy Mac OrcaSlicer_profile_validator DMG release
if: github.ref == 'refs/heads/main' && inputs.os == 'macos-14'
uses: WebFreak001/deploy-nightly@v3.2.0
with:
upload_url: https://uploads.github.com/repos/SoftFever/OrcaSlicer/releases/137995723/assets{?name,label}
release_id: 137995723
asset_path: ${{ github.workspace }}/OrcaSlicer_profile_validator_Mac_universal_${{ env.ver }}.dmg
asset_name: OrcaSlicer_profile_validator_Mac_universal_${{ env.ver }}.dmg
asset_content_type: application/octet-stream
max_releases: 1
# Windows # Windows
- name: setup MSVC - name: setup MSVC
if: inputs.os == 'windows-latest' if: inputs.os == 'windows-latest'
uses: microsoft/setup-msbuild@v2 uses: microsoft/setup-msbuild@v1.1
- name: Install nsis - name: Install nsis
if: inputs.os == 'windows-latest' if: inputs.os == 'windows-latest'
@@ -215,9 +143,6 @@ jobs:
- name: Build slicer Win - name: Build slicer Win
if: inputs.os == 'windows-latest' if: inputs.os == 'windows-latest'
working-directory: ${{ github.workspace }} working-directory: ${{ github.workspace }}
env:
WindowsSdkDir: 'C:\Program Files (x86)\Windows Kits\10\'
WindowsSDKVersion: '10.0.22000.0\'
run: .\build_release_vs2022.bat slicer run: .\build_release_vs2022.bat slicer
- name: Create installer Win - name: Create installer Win
@@ -237,172 +162,59 @@ jobs:
working-directory: ${{ github.workspace }}/build/src/Release working-directory: ${{ github.workspace }}/build/src/Release
shell: cmd shell: cmd
run: '"C:/Program Files/7-Zip/7z.exe" a -m0=lzma2 -mx9 Debug_PDB_${{ env.ver }}_for_developers_only.7z *.pdb' run: '"C:/Program Files/7-Zip/7z.exe" a -m0=lzma2 -mx9 Debug_PDB_${{ env.ver }}_for_developers_only.7z *.pdb'
- name: Upload artifacts Win zip - name: Upload artifacts Win zip
if: inputs.os == 'windows-latest' if: inputs.os == 'windows-latest'
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v3
with: with:
name: OrcaSlicer_Windows_${{ env.ver }}_portable name: OrcaSlicer_Windows_${{ env.ver }}_portable
path: ${{ github.workspace }}/build/OrcaSlicer path: ${{ github.workspace }}/build/OrcaSlicer_Windows_${{ env.ver }}_portable.zip
- name: Upload artifacts Win installer - name: Upload artifacts Win installer
if: inputs.os == 'windows-latest' if: inputs.os == 'windows-latest'
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v3
with: with:
name: OrcaSlicer_Windows_${{ env.ver }} name: OrcaSlicer_Windows_${{ env.ver }}
path: ${{ github.workspace }}/build/OrcaSlicer*.exe path: ${{ github.workspace }}/build/OrcaSlicer*.exe
- name: Upload artifacts Win PDB - name: Upload artifacts Win PDB
if: inputs.os == 'windows-latest' if: inputs.os == 'windows-latest'
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v3
with: with:
name: PDB name: PDB
path: ${{ github.workspace }}/build/src/Release/Debug_PDB_${{ env.ver }}_for_developers_only.7z path: ${{ github.workspace }}/build/src/Release/Debug_PDB_${{ env.ver }}_for_developers_only.7z
- name: Upload OrcaSlicer_profile_validator Win
if: inputs.os == 'windows-latest'
uses: actions/upload-artifact@v4
with:
name: OrcaSlicer_profile_validator_Windows_${{ env.ver }}
path: ${{ github.workspace }}/build/src/Release/OrcaSlicer_profile_validator.exe
- name: Deploy Windows release portable
if: github.ref == 'refs/heads/main' && inputs.os == 'windows-latest'
uses: WebFreak001/deploy-nightly@v3.2.0
with:
upload_url: https://uploads.github.com/repos/SoftFever/OrcaSlicer/releases/137995723/assets{?name,label}
release_id: 137995723
asset_path: ${{ github.workspace }}/build/OrcaSlicer_Windows_${{ env.ver }}_portable.zip
asset_name: OrcaSlicer_Windows_${{ env.ver }}_portable.zip
asset_content_type: application/x-zip-compressed
max_releases: 1
- name: Deploy Windows release installer
if: github.ref == 'refs/heads/main' && inputs.os == 'windows-latest'
uses: WebFreak001/deploy-nightly@v3.2.0
with:
upload_url: https://uploads.github.com/repos/SoftFever/OrcaSlicer/releases/137995723/assets{?name,label}
release_id: 137995723
asset_path: ${{ github.workspace }}/build/OrcaSlicer_Windows_Installer_${{ env.ver }}.exe
asset_name: OrcaSlicer_Windows_Installer_${{ env.ver }}.exe
asset_content_type: application/x-msdownload
max_releases: 1
- name: Deploy Windows OrcaSlicer_profile_validator release
if: github.ref == 'refs/heads/main' && inputs.os == 'windows-latest'
uses: WebFreak001/deploy-nightly@v3.2.0
with:
upload_url: https://uploads.github.com/repos/SoftFever/OrcaSlicer/releases/137995723/assets{?name,label}
release_id: 137995723
asset_path: ${{ github.workspace }}/build/src/Release/OrcaSlicer_profile_validator.exe
asset_name: OrcaSlicer_profile_validator_Windows_${{ env.ver }}.exe
asset_content_type: application/x-msdownload
max_releases: 1
# Ubuntu # Ubuntu
- name: Install dependencies - name: Install dependencies
if: inputs.os == 'ubuntu-20.04' || inputs.os == 'ubuntu-24.04' if: inputs.os == 'ubuntu-20.04'
env:
apt-cmd: ${{ (inputs.os == 'ubuntu-20.04' && 'apt-fast') || (inputs.os == 'ubuntu-24.04' && 'sudo apt-get') || '' }}
webkit-ver: ${{ (inputs.os == 'ubuntu-20.04' && '4.0') || (inputs.os == 'ubuntu-24.04' && '4.1') || '' }}
libfuse2-pkg: ${{ (inputs.os == 'ubuntu-20.04' && 'libfuse2') || (inputs.os == 'ubuntu-24.04' && 'libfuse2t64') || '' }}
run: | run: |
${{ env.apt-cmd }} update sudo apt-get update
${{ env.apt-cmd }} install -y autoconf build-essential cmake curl eglexternalplatform-dev \ sudo apt-get install -y autoconf build-essential cmake curl eglexternalplatform-dev \
extra-cmake-modules file git libcairo2-dev libcurl4-openssl-dev libdbus-1-dev libglew-dev libglu1-mesa-dev \ extra-cmake-modules file git libcairo2-dev libcurl4-openssl-dev libdbus-1-dev libglew-dev libglu1-mesa-dev \
libglu1-mesa-dev libgstreamer1.0-dev libgstreamerd-3-dev libgstreamer-plugins-base1.0-dev libgstreamer-plugins-good1.0-dev \ libglu1-mesa-dev libgstreamer1.0-dev libgstreamerd-3-dev libgstreamer-plugins-base1.0-dev libgstreamer-plugins-good1.0-dev \
libgtk-3-dev libgtk-3-dev libmspack-dev libsecret-1-dev libsoup2.4-dev libssl-dev libudev-dev libwayland-dev \ libgtk-3-dev libgtk-3-dev libmspack-dev libosmesa6-dev libsecret-1-dev libsoup2.4-dev libssl-dev libudev-dev libwayland-dev \
libwebkit2gtk-${{ env.webkit-ver }}-dev libxkbcommon-dev locales locales-all m4 pkgconf sudo wayland-protocols wget ${{ env.libfuse2-pkg }} libwebkit2gtk-4.0-dev libxkbcommon-dev locales locales-all m4 pkgconf sudo wayland-protocols wget
- name: Install dependencies from build_linux.sh - name: Install dependencies from BuildLinux.sh
if: inputs.os == 'ubuntu-20.04' || inputs.os == 'ubuntu-24.04' if: inputs.os == 'ubuntu-20.04'
shell: bash shell: bash
run: sudo ./build_linux.sh -ur run: sudo ./BuildLinux.sh -ur
- name: Fix permissions - name: Fix permissions
if: inputs.os == 'ubuntu-20.04' || inputs.os == 'ubuntu-24.04' if: inputs.os == 'ubuntu-20.04'
shell: bash shell: bash
run: sudo chown $USER -R ./ run: sudo chown $USER -R ./
- name: Build slicer - name: Build slicer
if: inputs.os == 'ubuntu-20.04' || inputs.os == 'ubuntu-24.04' if: inputs.os == 'ubuntu-20.04'
shell: bash
env:
ubuntu-ver-str: ${{ (inputs.os == 'ubuntu-24.04' && '_Ubuntu2404') || '' }}
run: |
./build_linux.sh -isr
mv -n ./build/OrcaSlicer_Linux_V${{ env.ver_pure }}.AppImage ./build/OrcaSlicer_Linux_AppImage${{ env.ubuntu-ver-str }}_${{ env.ver }}.AppImage
chmod +x ./build/OrcaSlicer_Linux_AppImage${{ env.ubuntu-ver-str }}_${{ env.ver }}.AppImage
- name: Build orca_custom_preset_tests
if: github.ref == 'refs/heads/main' && inputs.os == 'ubuntu-24.04'
working-directory: ${{ github.workspace }}/build/src
shell: bash shell: bash
run: | run: |
./OrcaSlicer_profile_validator -p ${{ github.workspace }}/resources/profiles -g 1 ./BuildLinux.sh -isr
cd ${{ github.workspace }}/resources/profiles chmod +x ./build/OrcaSlicer_ubu64.AppImage
zip -r orca_custom_preset_tests.zip user/
- name: Upload artifacts Ubuntu - name: Upload artifacts Ubuntu
if: ${{ ! env.ACT && inputs.os == 'ubuntu-20.04' || inputs.os == 'ubuntu-24.04' }} if: inputs.os == 'ubuntu-20.04'
env: uses: actions/upload-artifact@v3
ubuntu-ver: ${{ (inputs.os == 'ubuntu-20.04' && '2004') || (inputs.os == 'ubuntu-24.04' && '2404') || '' }}
ubuntu-ver-str: ${{ (inputs.os == 'ubuntu-24.04' && '_Ubuntu2404') || '' }}
uses: actions/upload-artifact@v4
with: with:
name: OrcaSlicer_Linux_ubuntu_${{ env.ubuntu-ver }}_${{ env.ver }} name: OrcaSlicer_Linux_${{ env.ver }}
path: './build/OrcaSlicer_Linux_AppImage${{ env.ubuntu-ver-str }}_${{ env.ver }}.AppImage' path: './build/OrcaSlicer_ubu64.AppImage'
- name: Upload OrcaSlicer_profile_validator Ubuntu
if: ${{ ! env.ACT && inputs.os == 'ubuntu-20.04' || inputs.os == 'ubuntu-24.04' }}
env:
ubuntu-ver: ${{ (inputs.os == 'ubuntu-20.04' && '2004') || (inputs.os == 'ubuntu-24.04' && '2404') || '' }}
uses: actions/upload-artifact@v4
with:
name: OrcaSlicer_profile_validator_Linux_ubuntu_${{ env.ubuntu-ver }}_${{ env.ver }}
path: './build/src/OrcaSlicer_profile_validator'
- name: Deploy Ubuntu release
if: ${{ ! env.ACT && github.ref == 'refs/heads/main' && (inputs.os == 'ubuntu-20.04' || inputs.os == 'ubuntu-24.04') }}
env:
ubuntu-ver-str: ${{ (inputs.os == 'ubuntu-24.04' && '_Ubuntu2404') || '' }}
uses: WebFreak001/deploy-nightly@v3.2.0
with:
upload_url: https://uploads.github.com/repos/SoftFever/OrcaSlicer/releases/137995723/assets{?name,label}
release_id: 137995723
asset_path: ./build/OrcaSlicer_Linux_AppImage${{ env.ubuntu-ver-str }}_${{ env.ver }}.AppImage
asset_name: OrcaSlicer_Linux_AppImage${{ env.ubuntu-ver-str }}_${{ env.ver }}.AppImage
asset_content_type: application/octet-stream
max_releases: 1 # optional, if there are more releases than this matching the asset_name, the oldest ones are going to be deleted
- name: Deploy Ubuntu release
if: ${{ ! env.ACT && github.ref == 'refs/heads/main' && inputs.os == 'ubuntu-24.04' }}
uses: rickstaa/action-create-tag@v1
with:
tag: "nightly-builds"
tag_exists_error: false
force_push_tag: true
message: "nightly-builds"
- name: Deploy Ubuntu OrcaSlicer_profile_validator release
if: ${{ ! env.ACT && github.ref == 'refs/heads/main' && (inputs.os == 'ubuntu-20.04' || inputs.os == 'ubuntu-24.04') }}
env:
ubuntu-ver-str: ${{ (inputs.os == 'ubuntu-24.04' && '_Ubuntu2404') || '' }}
uses: WebFreak001/deploy-nightly@v3.2.0
with:
upload_url: https://uploads.github.com/repos/SoftFever/OrcaSlicer/releases/137995723/assets{?name,label}
release_id: 137995723
asset_path: ./build/src/OrcaSlicer_profile_validator
asset_name: OrcaSlicer_profile_validator_Linux${{ env.ubuntu-ver-str }}_${{ env.ver }}
asset_content_type: application/octet-stream
max_releases: 1
- name: Deploy orca_custom_preset_tests
if: ${{ ! env.ACT && github.ref == 'refs/heads/main' && inputs.os == 'ubuntu-24.04' }}
uses: WebFreak001/deploy-nightly@v3.2.0
with:
upload_url: https://uploads.github.com/repos/SoftFever/OrcaSlicer/releases/137995723/assets{?name,label}
release_id: 137995723
asset_path: ${{ github.workspace }}/resources/profiles/orca_custom_preset_tests.zip
asset_name: orca_custom_preset_tests.zip
asset_content_type: application/octet-stream
max_releases: 1

View File

@@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v4 uses: actions/checkout@v3
- name: Install gettext - name: Install gettext
run: | run: |

View File

@@ -1,51 +0,0 @@
name: Check profiles
on:
pull_request:
branches:
- main
paths:
- 'resources/profiles/**'
- ".github/workflows/check_profiles.yml"
workflow_dispatch:
inputs:
logLevel:
description: 'Log level'
required: true
default: 'warning'
jobs:
check_translation:
name: Check profiles
runs-on: ubuntu-24.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Run extra JSON check
run: |
python3 ./scripts/orca_extra_profile_check.py
# download
- name: Download
working-directory: ${{ github.workspace }}
run: |
curl -LJO https://github.com/SoftFever/Orca_tools/releases/download/1/OrcaSlicer_profile_validator
chmod +x ./OrcaSlicer_profile_validator
# validate profiles
- name: validate system profiles
run: |
./OrcaSlicer_profile_validator -p ${{ github.workspace }}/resources/profiles -l 2
- name: validate custom presets
working-directory: ${{ github.workspace }}
run: |
curl -LJO https://github.com/SoftFever/OrcaSlicer/releases/download/nightly-builds/orca_custom_preset_tests.zip
unzip ./orca_custom_preset_tests.zip -d ${{ github.workspace }}/resources/profiles
./OrcaSlicer_profile_validator -p ${{ github.workspace }}/resources/profiles -l 2

View File

@@ -1,71 +0,0 @@
name: Claude Code Review
on:
workflow_dispatch:
jobs:
claude-review:
# Optional: Filter by PR author
# if: |
# github.event.pull_request.user.login == 'external-contributor' ||
# github.event.pull_request.user.login == 'new-developer' ||
# github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR'
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
issues: read
id-token: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Run Claude Code Review
id: claude-review
uses: anthropics/claude-code-action@beta
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
# Optional: Specify model (defaults to Claude Sonnet 4, uncomment for Claude Opus 4.1)
# model: "claude-opus-4-1-20250805"
# Direct prompt for automated review (no @claude mention needed)
direct_prompt: |
Please review this pull request and provide feedback on:
- Code quality and best practices
- Potential bugs or issues
- Performance considerations
- Security concerns
- Test coverage
Be constructive and helpful in your feedback.
# Optional: Use sticky comments to make Claude reuse the same comment on subsequent pushes to the same PR
# use_sticky_comment: true
# Optional: Customize review based on file types
# direct_prompt: |
# Review this PR focusing on:
# - For TypeScript files: Type safety and proper interface usage
# - For API endpoints: Security, input validation, and error handling
# - For React components: Performance, accessibility, and best practices
# - For tests: Coverage, edge cases, and test quality
# Optional: Different prompts for different authors
# direct_prompt: |
# ${{ github.event.pull_request.author_association == 'FIRST_TIME_CONTRIBUTOR' &&
# 'Welcome! Please review this PR from a first-time contributor. Be encouraging and provide detailed explanations for any suggestions.' ||
# 'Please provide a thorough code review focusing on our coding standards and best practices.' }}
# Optional: Add specific tools for running tests or linting
# allowed_tools: "Bash(npm run test),Bash(npm run lint),Bash(npm run typecheck)"
# Optional: Skip review for certain conditions
# if: |
# !contains(github.event.pull_request.title, '[skip-review]') &&
# !contains(github.event.pull_request.title, '[WIP]')

View File

@@ -1,64 +0,0 @@
name: Claude Code
on:
issue_comment:
types: [created]
pull_request_review_comment:
types: [created]
issues:
types: [opened, assigned]
pull_request_review:
types: [submitted]
jobs:
claude:
if: |
(github.event_name == 'issue_comment' && contains(github.event.comment.body, '@claude')) ||
(github.event_name == 'pull_request_review_comment' && contains(github.event.comment.body, '@claude')) ||
(github.event_name == 'pull_request_review' && contains(github.event.review.body, '@claude')) ||
(github.event_name == 'issues' && (contains(github.event.issue.body, '@claude') || contains(github.event.issue.title, '@claude')))
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
issues: read
id-token: write
actions: read # Required for Claude to read CI results on PRs
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Run Claude Code
id: claude
uses: anthropics/claude-code-action@beta
with:
claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}
# This is an optional setting that allows Claude to read CI results on PRs
additional_permissions: |
actions: read
# Optional: Specify model (defaults to Claude Sonnet 4, uncomment for Claude Opus 4.1)
# model: "claude-opus-4-1-20250805"
# Optional: Customize the trigger phrase (default: @claude)
# trigger_phrase: "/claude"
# Optional: Trigger when specific user is assigned to an issue
# assignee_trigger: "claude-bot"
# Optional: Allow Claude to run specific commands
# allowed_tools: "Bash(npm install),Bash(npm run build),Bash(npm run test:*),Bash(npm run lint:*)"
# Optional: Add custom instructions for Claude to customize its behavior for your project
# custom_instructions: |
# Follow our coding standards
# Ensure all new code has tests
# Use TypeScript for new files
# Optional: Custom environment variables for Claude
# claude_env: |
# NODE_ENV: test

View File

@@ -2,72 +2,25 @@ name: Orca bot
on: on:
schedule: schedule:
- cron: "0 0 * * *" - cron: "0 0 * * *"
workflow_dispatch:
inputs:
logLevel:
description: 'Log level'
required: true
default: 'warning'
jobs: jobs:
stale: close-issues:
runs-on: ubuntu-latest runs-on: ubuntu-latest
permissions: permissions:
issues: write issues: write
pull-requests: write pull-requests: write
contents: write # only for delete-branch option
steps: steps:
- uses: actions/stale@v9 - uses: actions/stale@v5
with: with:
# PAT for GitHub API authentication
repo-token: ${{ secrets.GITHUB_TOKEN }}
# Max number of operations per run
operations-per-run: 1000
# Order to get issues/PRs
ascending: true
# ISSUES
# Do not auto-close an issue if it is assigned to a milestone
exempt-all-issue-milestones: true
# Exempt all issues with assignees from stale
exempt-all-issue-assignees: true
# Exempt feature requests
exempt-issue-labels: "enhancement"
# Idle number of days before marking issues stale
days-before-issue-stale: 90 days-before-issue-stale: 90
# Idle number of days before marking issues close
days-before-issue-close: 7 days-before-issue-close: 7
# Label to apply on staled issues operations-per-run: 1000
stale-issue-label: "stale" stale-issue-label: "stale"
# Issue close reason ascending: true
close-issue-reason: not_planned stale-issue-message: "GitHub bot: this issue is stale because it has been open for 90 days with no activity."
# Remove stale label from issues on updates close-issue-message: "GitHub bot: This issue was closed because it has been inactive for 7 days since being marked as stale."
remove-issue-stale-when-updated: true
# Issue stale message
stale-issue-message: "Orca bot: this issue is stale because it has been open for 90 days with no activity."
# Issue closure message
close-issue-message: "Orca bot: This issue was closed because it has been inactive for 7 days since being marked as stale."
# PRs
# Do not auto-close a PR if it is assigned to a milestone
exempt-all-pr-milestones: true
# Exempt all PRs with assignees from stale
exempt-all-pr-assignees: true
# Skip the stale action for draft PRs
exempt-draft-pr: true
# Idle number of days before marking PRs stale
days-before-pr-stale: -1 days-before-pr-stale: -1
# Idle number of days before marking PRs close
days-before-pr-close: -1 days-before-pr-close: -1
# Label to apply on staled PRs remove-issue-stale-when-updated: true
stale-pr-label: "stale" remove-pr-stale-when-updated: true
# Label to apply on closed PRs repo-token: ${{ secrets.GITHUB_TOKEN }}
close-pr-label: not_planned
# Remove stale label from PRs on updates
remove-pr-stale-when-updated: true
# PR stale message
stale-pr-message: "Orca bot: this PR is stale because it has been open for XX days with no activity."
# PR closure message
close-pr-message: "Orca bot: This PR was closed because it has been inactive for X days since being marked as stale."
# Delete branch after closing a stale PR
delete-branch: true

View File

@@ -8,13 +8,6 @@ on:
branches: branches:
- main # This can be changed to any branch of your preference - main # This can be changed to any branch of your preference
workflow_dispatch:
inputs:
logLevel:
description: 'Log level'
required: true
default: 'warning'
env: env:
USER_TOKEN: ${{ secrets.GH_WIKI_PAT }} # This is the repository secret personal access token USER_TOKEN: ${{ secrets.GH_WIKI_PAT }} # This is the repository secret personal access token
USER_NAME: ${{ vars.BOT_USER_NAME }} # Enter the username of your (bot) account USER_NAME: ${{ vars.BOT_USER_NAME }} # Enter the username of your (bot) account
@@ -27,14 +20,14 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v4 uses: actions/checkout@v3
# 1. Clone the current wiki master branch to a folder named `tmp_wiki` # 1. Clone the current wiki master branch to a folder named `tmp_wiki`
- name: Pull content from wiki - name: Pull content from wiki
run: | run: |
git config --global user.name "$USER_NAME" git config --global user.name "$USER_NAME"
git config --global user.email "$USER_NAME"@users.noreply.github.com git config --global user.email "$USER_NAME"@users.noreply.github.com
git clone https://"$USER_TOKEN"@github.com/SoftFever/"$REPOSITORY_NAME".wiki.git tmp_wiki git clone https://"$USER_TOKEN"@github.com/"$OWNER"/"$REPOSITORY_NAME".wiki.git tmp_wiki
# 4. Synchronize differences between `doc` & `tmp_wiki` # 4. Synchronize differences between `doc` & `tmp_wiki`
# 5. Push new Wiki content # 5. Push new Wiki content
- name: Push main repo content to wiki - name: Push main repo content to wiki

View File

@@ -1,38 +0,0 @@
name: Update Translation Catalog
on:
# schedule:
# - cron: 0 0 * * 1
workflow_dispatch:
jobs:
update_translation:
name: Update translation
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Install gettext
run: |
sudo apt-get update
sudo apt-get install -y gettext
- name: Update translation catalog
run: |
./run_gettext.sh --full
git add localization/i18n/*
- name: Commit translation catalog updates
uses: qoomon/actions--create-commit@v1
id: commit
with:
message: Update translation catalog
skip-empty: true
- name: Push changes
run: git push

5
.gitignore vendored
View File

@@ -1,7 +1,7 @@
Build Build
Build.bat Build.bat
/build*/ /build*/
deps/build* deps/build
MYMETA.json MYMETA.json
MYMETA.yml MYMETA.yml
_build _build
@@ -32,6 +32,3 @@ src/OrcaSlicer-doc/
**/filament_full/ **/filament_full/
/deps/DL_CACHE/ /deps/DL_CACHE/
/deps/DL_CACHE /deps/DL_CACHE
**/.flatpak-builder/
resources/profiles/user/default
*.code-workspace

253
BuildLinux.sh Executable file
View File

@@ -0,0 +1,253 @@
#!/bin/bash
export ROOT=`pwd`
export NCORES=`nproc --all`
export CMAKE_BUILD_PARALLEL_LEVEL=${NCORES}
FOUND_GTK2=$(dpkg -l libgtk* | grep gtk2)
FOUND_GTK3=$(dpkg -l libgtk* | grep gtk-3)
set -e # exit on first error
function check_available_memory_and_disk() {
FREE_MEM_GB=$(free -g -t | grep 'Mem:' | rev | cut -d" " -f1 | rev)
MIN_MEM_GB=10
FREE_DISK_KB=$(df -k . | tail -1 | awk '{print $4}')
MIN_DISK_KB=$((10 * 1024 * 1024))
if [ ${FREE_MEM_GB} -le ${MIN_MEM_GB} ]; then
echo -e "\nERROR: Orca Slicer Builder requires at least ${MIN_MEM_GB}G of 'available' mem (systen has only ${FREE_MEM_GB}G available)"
echo && free -h && echo
exit 2
fi
if [[ ${FREE_DISK_KB} -le ${MIN_DISK_KB} ]]; then
echo -e "\nERROR: Orca Slicer Builder requires at least $(echo $MIN_DISK_KB |awk '{ printf "%.1fG\n", $1/1024/1024; }') (systen has only $(echo ${FREE_DISK_KB} | awk '{ printf "%.1fG\n", $1/1024/1024; }') disk free)"
echo && df -h . && echo
exit 1
fi
}
function usage() {
echo "Usage: ./BuildLinux.sh [-i][-u][-d][-s][-b][-g]"
echo " -i: Generate appimage (optional)"
echo " -g: force gtk2 build"
echo " -b: build in debug mode"
echo " -d: build deps (optional)"
echo " -s: build orca-slicer (optional)"
echo " -u: only update clock & dependency packets (optional and need sudo)"
echo " -r: skip free ram check (low ram compiling)"
echo "For a first use, you want to 'sudo ./BuildLinux.sh -u'"
echo " and then './BuildLinux.sh -dsi'"
}
unset name
while getopts ":dsiuhgbr" opt; do
case ${opt} in
u )
UPDATE_LIB="1"
;;
i )
BUILD_IMAGE="1"
;;
d )
BUILD_DEPS="1"
;;
s )
BUILD_ORCA="1"
;;
b )
BUILD_DEBUG="1"
;;
g )
FOUND_GTK3=""
;;
r )
SKIP_RAM_CHECK="1"
;;
h ) usage
exit 0
;;
esac
done
if [ $OPTIND -eq 1 ]
then
usage
exit 0
fi
# Addtional Dev packages for OrcaSlicer
export REQUIRED_DEV_PACKAGES="libmspack-dev libgstreamerd-3-dev libsecret-1-dev libwebkit2gtk-4.0-dev libosmesa6-dev libssl-dev libcurl4-openssl-dev eglexternalplatform-dev libudev-dev libdbus-1-dev extra-cmake-modules texinfo"
# libwebkit2gtk-4.1-dev ??
export DEV_PACKAGES_COUNT=$(echo ${REQUIRED_DEV_PACKAGES} | wc -w)
if [ $(dpkg --get-selections | grep -E "$(echo ${REQUIRED_DEV_PACKAGES} | tr ' ' '|')" | wc -l) -lt ${DEV_PACKAGES_COUNT} ]; then
sudo apt install -y ${REQUIRED_DEV_PACKAGES} git cmake wget file gettext
fi
#FIXME: require root for -u option
if [[ -n "$UPDATE_LIB" ]]
then
echo -n -e "Updating linux ...\n"
# hwclock -s # DeftDawg: Why does SuperSlicer want to do this?
apt update
if [[ -z "$FOUND_GTK3" ]]
then
echo -e "\nInstalling: libgtk2.0-dev libglew-dev libudev-dev libdbus-1-dev cmake git\n"
apt install -y libgtk2.0-dev libglew-dev libudev-dev libdbus-1-dev cmake git
else
echo -e "\nFind libgtk-3, installing: libgtk-3-dev libglew-dev libudev-dev libdbus-1-dev cmake git\n"
apt install -y libgtk-3-dev libglew-dev libudev-dev libdbus-1-dev cmake git
fi
# for ubuntu 22+ and 23+:
ubu_major_version="$(grep VERSION_ID /etc/os-release | cut -d "=" -f 2 | cut -d "." -f 1 | tr -d /\"/)"
if [ $ubu_major_version == "22" ] || [ $ubu_major_version == "23" ]
then
apt install -y curl libfuse-dev libssl-dev libcurl4-openssl-dev m4
fi
if [[ -n "$BUILD_DEBUG" ]]
then
echo -e "\nInstalling: libssl-dev libcurl4-openssl-dev\n"
apt install -y libssl-dev libcurl4-openssl-dev
fi
echo -e "done\n"
exit 0
fi
FOUND_GTK2_DEV=$(dpkg -l libgtk* | grep gtk2.0-dev || echo '')
FOUND_GTK3_DEV=$(dpkg -l libgtk* | grep gtk-3-dev || echo '')
echo "FOUND_GTK2=$FOUND_GTK2)"
if [[ -z "$FOUND_GTK2_DEV" ]]
then
if [[ -z "$FOUND_GTK3_DEV" ]]
then
echo "Error, you must install the dependencies before."
echo "Use option -u with sudo"
exit 0
fi
fi
echo "[1/9] Updating submodules..."
{
# update submodule profiles
pushd resources/profiles
git submodule update --init
popd
}
echo "[2/9] Changing date in version..."
{
# change date in version
sed -i "s/+UNKNOWN/_$(date '+%F')/" version.inc
}
echo "done"
# mkdir in deps
if [ ! -d "deps/build" ]
then
mkdir deps/build
fi
if ! [[ -n "$SKIP_RAM_CHECK" ]]
then
check_available_memory_and_disk
fi
if [[ -n "$BUILD_DEPS" ]]
then
echo "[3/9] Configuring dependencies..."
BUILD_ARGS=""
if [[ -n "$FOUND_GTK3_DEV" ]]
then
BUILD_ARGS="-DDEP_WX_GTK3=ON"
fi
if [[ -n "$BUILD_DEBUG" ]]
then
# have to build deps with debug & release or the cmake won't find evrything it needs
mkdir deps/build/release
pushd deps/build/release
cmake ../.. -DDESTDIR="../destdir" $BUILD_ARGS
make -j$NCORES
popd
BUILD_ARGS="${BUILD_ARGS} -DCMAKE_BUILD_TYPE=Debug"
fi
# cmake deps
pushd deps/build
cmake .. $BUILD_ARGS
echo "done"
# make deps
echo "[4/9] Building dependencies..."
make deps -j$NCORES
echo "done"
# rename wxscintilla # TODO: DeftDawg: Does OrcaSlicer need this?
# echo "[5/9] Renaming wxscintilla library..."
# pushd destdir/usr/local/lib
# if [[ -z "$FOUND_GTK3_DEV" ]]
# then
# cp libwxscintilla-3.1.a libwx_gtk2u_scintilla-3.1.a
# else
# cp libwxscintilla-3.1.a libwx_gtk3u_scintilla-3.1.a
# fi
# popd
# echo "done"
# FIXME: only clean deps if compiling succeeds; otherwise reruns waste tonnes of time!
# clean deps
# echo "[6/9] Cleaning dependencies..."
# rm -rf dep_*
popd
echo "done"
fi
# Create main "build" directory
if [ ! -d "build" ]
then
mkdir build
fi
if [[ -n "$BUILD_ORCA" ]]
then
echo "[7/9] Configuring Slic3r..."
BUILD_ARGS=""
if [[ -n "$FOUND_GTK3_DEV" ]]
then
BUILD_ARGS="-DSLIC3R_GTK=3"
fi
if [[ -n "$BUILD_DEBUG" ]]
then
BUILD_ARGS="${BUILD_ARGS} -DCMAKE_BUILD_TYPE=Debug -DBBL_INTERNAL_TESTING=1"
else
BUILD_ARGS="${BUILD_ARGS} -DBBL_RELEASE_TO_PUBLIC=1 -DBBL_INTERNAL_TESTING=0"
fi
# cmake
pushd build
cmake .. -DCMAKE_PREFIX_PATH="$PWD/../deps/build/destdir/usr/local" -DSLIC3R_STATIC=1 ${BUILD_ARGS}
echo "done"
# make Slic3r
echo "[8/9] Building Slic3r..."
make -j$NCORES OrcaSlicer # Slic3r
popd
./run_gettext.sh
echo "done"
fi
if [[ -e $ROOT/build/src/BuildLinuxImage.sh ]]; then
# Give proper permissions to script
chmod 755 $ROOT/build/src/BuildLinuxImage.sh
echo "[9/9] Generating Linux app..."
pushd build
if [[ -n "$BUILD_IMAGE" ]]
then
$ROOT/build/src/BuildLinuxImage.sh -i
else
$ROOT/build/src/BuildLinuxImage.sh
fi
popd
echo "done"
fi

116
CLAUDE.md
View File

@@ -1,116 +0,0 @@
# CLAUDE.md
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
## Overview
OrcaSlicer is an open-source 3D slicer application forked from Bambu Studio, built using C++ with wxWidgets for the GUI and CMake as the build system. The project uses a modular architecture with separate libraries for core slicing functionality, GUI components, and platform-specific code.
## Build Commands
### Building on macOS
```bash
# Build everything (dependencies and slicer)
./build_release_macos.sh
# Build only dependencies
./build_release_macos.sh -d
# Build only slicer (after deps are built)
./build_release_macos.sh -s
# Use Ninja generator for faster builds
./build_release_macos.sh -x
# Build for specific architecture
./build_release_macos.sh -a arm64 # or x86_64
```
### Building on Linux
```bash
# Build everything
./build_linux.sh
# Check system resources first (build requires 10GB+ RAM and disk)
./build_linux.sh -r # skip resource checks
```
### Build System
- Uses CMake with minimum version 3.13
- Primary build directory: `build/`
- Dependencies are built in `deps/build/`
- The build process is split into dependency building and main application building
### Testing
Tests are located in the `tests/` directory and can be run via CMake/CTest after building.
## Architecture
### Core Libraries
- **libslic3r/**: Core slicing engine and algorithms
- Contains the main slicing logic, geometry processing, G-code generation
- Platform-independent slicing functionality
- Key classes: Print, PrintObject, Layer, GCode, Config
- **src/slic3r/**: Main application framework
- GUI application entry points and main loops
- Integration between libslic3r and the GUI
### GUI Components
- Built with wxWidgets framework
- Located primarily in `src/slic3r/GUI/`
- Main application class: `GUI_App`
- Uses OpenGL for 3D visualization
### Key Modules
- **3MF Format Support**: `src/libslic3r/Format/3mf.cpp` - 3MF file format reading/writing
- **G-code Processing**: `src/libslic3r/GCode/` - G-code generation and processing
- **Geometry**: `src/libslic3r/Geometry.cpp` - 2D/3D geometry operations
- **Print Configuration**: `src/libslic3r/PrintConfig.cpp` - Print settings and presets
- **Model Handling**: `src/libslic3r/Model.cpp` - 3D model representation and manipulation
### External Dependencies
- **Clipper**: 2D polygon clipping operations
- **libigl**: Geometry processing library
- **OpenVDB**: Voxel data structures (optional)
- **TBB**: Threading Building Blocks for parallelization
- **wxWidgets**: Cross-platform GUI toolkit
- **OpenGL**: 3D graphics rendering
## File Organization
### Configuration and Profiles
- `resources/profiles/`: Printer and material profiles organized by manufacturer
- `resources/printers/`: Printer-specific configurations and G-code templates
### Internationalization
- `localization/i18n/`: Translation files
- `resources/i18n/`: Runtime language resources
### Platform-Specific Code
- Platform abstractions in `src/libslic3r/Platform.cpp`
- macOS-specific utilities in `src/libslic3r/MacUtils.mm`
## Development Workflow
### Code Style
- C++17 standard
- Use existing patterns found in libslic3r for consistency
- Follow existing naming conventions (PascalCase for classes, snake_case for functions)
### Common Tasks
- **Adding new print settings**: Extend `PrintConfig.cpp` and related GUI components
- **Modifying slicing algorithms**: Work in `libslic3r/` core modules
- **GUI changes**: Modify components in `src/slic3r/GUI/`
- **Adding printer support**: Add profiles in `resources/profiles/`
### Dependencies Management
Dependencies are managed through CMake and built separately from the main application. The `deps/` directory contains dependency build configurations.
## Important Notes
- The codebase is large and complex - use search tools to navigate effectively
- Many algorithms are performance-critical - consider computational complexity
- The project maintains backward compatibility with various file formats
- Cross-platform compatibility is important (Windows, macOS, Linux)
- The GUI uses a custom theming system supporting light/dark modes

View File

@@ -1,50 +1,5 @@
cmake_minimum_required(VERSION 3.13) cmake_minimum_required(VERSION 3.13)
# Verify that your CMake version is exactly 3.31.x series or lower on windows
if ( ((MSVC) OR (WIN32)) AND (${CMAKE_VERSION} VERSION_GREATER_EQUAL "4.0") )
message(FATAL_ERROR "Only cmake versions between 3.13.x and 3.31.x is supported on windows. Detected version: ${CMAKE_VERSION}")
endif()
if (WIN32)
# Detect known CI environments
set(IS_CI FALSE)
if(DEFINED ENV{CI})
set(IS_CI TRUE)
elseif(DEFINED ENV{GITHUB_ACTIONS})
set(IS_CI TRUE)
elseif(DEFINED ENV{GITLAB_CI})
set(IS_CI TRUE)
elseif(DEFINED ENV{TF_BUILD})
set(IS_CI TRUE)
elseif(DEFINED ENV{BUILD_NUMBER}) # Jenkins
set(IS_CI TRUE)
endif()
# Detect common misconfiguration (Strawberry Perl in PATH before CMake)
# We use ENV to check the PATH order
string(REPLACE "\\" "/" ENV_PATH "$ENV{PATH}")
string(FIND "${ENV_PATH}" "Strawberry/c/bin" STRAWBERRY_POS)
string(FIND "${ENV_PATH}" "Program Files/CMake/bin" CMAKE_POS)
if (STRAWBERRY_POS GREATER -1 AND CMAKE_POS GREATER -1 AND STRAWBERRY_POS LESS CMAKE_POS)
set(_warning_text "
#############################################################
Detected Strawberry Perl's 'c/bin' appearing before CMake in PATH.
This is known to cause CMake to misbehave (e.g., missing modules).
Please adjust your PATH so that:
C:\\Program Files\\CMake\\bin
appears before:
C:\\Strawberry\\c\\bin
You can do this in Environment Variables settings.
#############################################################
")
if(NOT IS_CI)
message(FATAL_ERROR "${_warning_text}")
endif()
endif()
endif ()
if (APPLE) if (APPLE)
# if CMAKE_OSX_DEPLOYMENT_TARGET is not set, set it to 11.3 # if CMAKE_OSX_DEPLOYMENT_TARGET is not set, set it to 11.3
if (NOT CMAKE_OSX_DEPLOYMENT_TARGET) if (NOT CMAKE_OSX_DEPLOYMENT_TARGET)
@@ -67,18 +22,6 @@ if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Build type (default Release)" FORCE) set(CMAKE_BUILD_TYPE "Release" CACHE STRING "Build type (default Release)" FORCE)
endif() endif()
find_package(Git)
if(GIT_FOUND AND EXISTS "${CMAKE_SOURCE_DIR}/.git")
# Check current Git commit hash
execute_process(
COMMAND ${GIT_EXECUTABLE} log -1 --format=%h
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE GIT_COMMIT_HASH
OUTPUT_STRIP_TRAILING_WHITESPACE
)
add_definitions("-DGIT_COMMIT_HASH=\"${GIT_COMMIT_HASH}\"")
endif()
if(DEFINED ENV{SLIC3R_STATIC}) if(DEFINED ENV{SLIC3R_STATIC})
set(SLIC3R_STATIC_INITIAL $ENV{SLIC3R_STATIC}) set(SLIC3R_STATIC_INITIAL $ENV{SLIC3R_STATIC})
else() else()
@@ -108,15 +51,6 @@ set(SLIC3R_GTK "2" CACHE STRING "GTK version to use with wxWidgets on Linux")
set(IS_CROSS_COMPILE FALSE) set(IS_CROSS_COMPILE FALSE)
option (COLORED_OUTPUT "Always produce ANSI-colored output (GNU/Clang only)." OFF)
if (${COLORED_OUTPUT})
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
add_compile_options (-fdiagnostics-color=always)
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
add_compile_options (-fcolor-diagnostics)
endif ()
endif ()
if (APPLE) if (APPLE)
set(CMAKE_FIND_FRAMEWORK LAST) set(CMAKE_FIND_FRAMEWORK LAST)
set(CMAKE_FIND_APPBUNDLE LAST) set(CMAKE_FIND_APPBUNDLE LAST)
@@ -135,7 +69,6 @@ endif ()
# Proposal for C++ unit tests and sandboxes # Proposal for C++ unit tests and sandboxes
option(SLIC3R_BUILD_SANDBOXES "Build development sandboxes" OFF) option(SLIC3R_BUILD_SANDBOXES "Build development sandboxes" OFF)
option(SLIC3R_BUILD_TESTS "Build unit tests" OFF) option(SLIC3R_BUILD_TESTS "Build unit tests" OFF)
option(ORCA_TOOLS "Build Orca tools" OFF)
if (IS_CROSS_COMPILE) if (IS_CROSS_COMPILE)
message("Detected cross compilation setup. Tests and encoding checks will be forcedly disabled!") message("Detected cross compilation setup. Tests and encoding checks will be forcedly disabled!")
@@ -187,9 +120,6 @@ if (MSVC)
# C4244: 'conversion' conversion from 'type1' to 'type2', possible loss of data. An integer type is converted to a smaller integer type. # C4244: 'conversion' conversion from 'type1' to 'type2', possible loss of data. An integer type is converted to a smaller integer type.
# C4267: The compiler detected a conversion from size_t to a smaller type. # C4267: The compiler detected a conversion from size_t to a smaller type.
add_compile_options(/wd4244 /wd4267) add_compile_options(/wd4244 /wd4267)
# Disable warnings on comparison of unsigned and signed
# C4018: signed/unsigned mismatch
add_compile_options(/wd4018)
endif () endif ()
if (${CMAKE_CXX_COMPILER_ID} STREQUAL "AppleClang" AND ${CMAKE_CXX_COMPILER_VERSION} VERSION_GREATER 15) if (${CMAKE_CXX_COMPILER_ID} STREQUAL "AppleClang" AND ${CMAKE_CXX_COMPILER_VERSION} VERSION_GREATER 15)
@@ -236,7 +166,7 @@ set(CMAKE_CXX_STANDARD_REQUIRED ON)
if(NOT WIN32) if(NOT WIN32)
# Add DEBUG flags to debug builds. # Add DEBUG flags to debug builds.
add_compile_definitions("$<IF:$<CONFIG:Debug>,DEBUG,NDEBUG>") add_compile_options("$<$<CONFIG:DEBUG>:-DDEBUG>")
endif() endif()
# To be able to link libslic3r with the Perl XS module. # To be able to link libslic3r with the Perl XS module.
@@ -273,7 +203,7 @@ if(WIN32)
if(WIN10SDK_INCLUDE_PATH) if(WIN10SDK_INCLUDE_PATH)
message("Building with Win10 Netfabb STL fixing service support") message("Building with Win10 Netfabb STL fixing service support")
add_definitions(-DHAS_WIN10SDK) add_definitions(-DHAS_WIN10SDK)
include_directories(SYSTEM "${WIN10SDK_INCLUDE_PATH}") include_directories("${WIN10SDK_INCLUDE_PATH}")
else() else()
message("Building without Win10 Netfabb STL fixing service support") message("Building without Win10 Netfabb STL fixing service support")
endif() endif()
@@ -301,7 +231,7 @@ if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
find_package(Threads REQUIRED) find_package(Threads REQUIRED)
find_package(DBus REQUIRED) find_package(DBus REQUIRED)
include_directories(SYSTEM ${DBUS_INCLUDE_DIRS}) include_directories(${DBUS_INCLUDE_DIRS})
endif() endif()
if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUXX) if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUXX)
@@ -318,22 +248,6 @@ if (NOT MSVC AND ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMP
# On GCC and Clang, no return from a non-void function is a warning only. Here, we make it an error. # On GCC and Clang, no return from a non-void function is a warning only. Here, we make it an error.
add_compile_options(-Werror=return-type) add_compile_options(-Werror=return-type)
# Since some portions of code are just commented out or put under conditional compilation, there are
# a bunch of warning related to unused functions and variables. Suppress those warnings to not pollute
# compilers diagnostics output with warnings we not going to look at
add_compile_options(-Wno-unused-function -Wno-unused-variable -Wno-unused-but-set-variable -Wno-unused-label -Wno-unused-local-typedefs)
# Ignore signed/unsigned comparison warnings
add_compile_options(-Wno-sign-compare)
# The mismatch of tabs and spaces throughout the project can sometimes
# cause this warning to appear even though the indentation is fine.
# Some includes also cause the warning
add_compile_options(-Wno-misleading-indentation)
# Disable warning if enum value does not have a corresponding case in switch statement
add_compile_options(-Wno-switch)
# removes LOTS of extraneous Eigen warnings (GCC only supports it since 6.1) # removes LOTS of extraneous Eigen warnings (GCC only supports it since 6.1)
# https://eigen.tuxfamily.org/bz/show_bug.cgi?id=1221 # https://eigen.tuxfamily.org/bz/show_bug.cgi?id=1221
if("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" OR CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 6.0) if("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang" OR CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 6.0)
@@ -347,31 +261,14 @@ if (NOT MSVC AND ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMP
add_compile_options(-Wno-deprecated-declarations) add_compile_options(-Wno-deprecated-declarations)
endif() endif()
if((${CMAKE_CXX_COMPILER_ID} STREQUAL "Clang" OR ${CMAKE_CXX_COMPILER_ID} STREQUAL "AppleClang") AND ${CMAKE_CXX_COMPILER_VERSION} VERSION_GREATER 15)
add_compile_options(-Wno-error=enum-constexpr-conversion)
endif()
#GCC generates loads of -Wunknown-pragmas when compiling igl. The fix is not easy due to a bug in gcc, see #GCC generates loads of -Wunknown-pragmas when compiling igl. The fix is not easy due to a bug in gcc, see
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66943 or # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66943 or
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53431 # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53431
# We will turn the warning of for GCC for now: # We will turn the warning of for GCC for now:
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
# GCC generates loads of -Wunknown-pragmas when compiling igl. The fix is not easy due to a bug in gcc, see
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66943 or
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53431
# We will turn the warning of for GCC for now:
add_compile_options(-Wno-unknown-pragmas) add_compile_options(-Wno-unknown-pragmas)
endif() endif()
# Bit of a hack for flatpak building: compress the debug info with zstd to save space in CI
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 13.0)
add_compile_options(-gz=zstd)
endif()
if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 14)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error=template-id-cdtor" )
endif()
endif() endif()
if (SLIC3R_ASAN) if (SLIC3R_ASAN)
@@ -384,8 +281,6 @@ if (SLIC3R_ASAN)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=address") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=address")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fsanitize=address") set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fsanitize=address")
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -fsanitize=address") set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -fsanitize=address")
else()
add_compile_definitions(_DISABLE_STRING_ANNOTATION=1 _DISABLE_VECTOR_ANNOTATION=1)
endif () endif ()
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
@@ -410,11 +305,11 @@ message(STATUS "LIBDIR: ${LIBDIR}")
message(STATUS "LIBDIR_BIN: ${LIBDIR_BIN}") message(STATUS "LIBDIR_BIN: ${LIBDIR_BIN}")
# For the bundled boost libraries (boost::nowide) # For the bundled boost libraries (boost::nowide)
include_directories(SYSTEM ${LIBDIR}) include_directories(${LIBDIR})
# For generated header files # For generated header files
include_directories(SYSTEM ${LIBDIR_BIN}/platform) include_directories(${LIBDIR_BIN}/platform)
# For ligigl # For ligigl
include_directories(SYSTEM ${LIBDIR}/libigl) include_directories(${LIBDIR}/libigl)
if(WIN32) if(WIN32)
add_definitions(-D_USE_MATH_DEFINES -D_WIN32 -D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS) add_definitions(-D_USE_MATH_DEFINES -D_WIN32 -D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS)
@@ -477,17 +372,14 @@ if(SLIC3R_STATIC)
set(Boost_USE_STATIC_LIBS ON) set(Boost_USE_STATIC_LIBS ON)
# Use boost libraries linked statically to the C++ runtime. # Use boost libraries linked statically to the C++ runtime.
# set(Boost_USE_STATIC_RUNTIME ON) # set(Boost_USE_STATIC_RUNTIME ON)
else()
add_definitions(-DBOOST_LOG_DYN_LINK)
endif() endif()
#set(Boost_DEBUG ON) #set(Boost_DEBUG ON)
# set(Boost_COMPILER "-mgw81") # set(Boost_COMPILER "-mgw81")
# boost::process was introduced first in version 1.64.0, # boost::process was introduced first in version 1.64.0,
# boost::beast::detail::base64 was introduced first in version 1.66.0 # boost::beast::detail::base64 was introduced first in version 1.66.0
if(POLICY CMP0167) set(MINIMUM_BOOST_VERSION "1.66.0")
cmake_policy(SET CMP0167 NEW) set(_boost_components "system;filesystem;thread;log;locale;regex;chrono;atomic;date_time;iostreams")
endif() find_package(Boost ${MINIMUM_BOOST_VERSION} REQUIRED COMPONENTS ${_boost_components})
find_package(Boost 1.83.0 REQUIRED COMPONENTS system filesystem thread log log_setup locale regex chrono atomic date_time iostreams program_options nowide)
add_library(boost_libs INTERFACE) add_library(boost_libs INTERFACE)
add_library(boost_headeronly INTERFACE) add_library(boost_headeronly INTERFACE)
@@ -504,7 +396,7 @@ endif()
function(slic3r_remap_configs targets from_Cfg to_Cfg) function(slic3r_remap_configs targets from_Cfg to_Cfg)
if(MSVC) if(MSVC)
string(TOUPPER ${from_Cfg} from_CFG) string(TOUPPER ${from_Cfg} from_CFG)
foreach(tgt ${targets}) foreach(tgt ${targets})
if(TARGET ${tgt}) if(TARGET ${tgt})
set_target_properties(${tgt} PROPERTIES MAP_IMPORTED_CONFIG_${from_CFG} ${to_Cfg}) set_target_properties(${tgt} PROPERTIES MAP_IMPORTED_CONFIG_${from_CFG} ${to_Cfg})
@@ -513,8 +405,28 @@ function(slic3r_remap_configs targets from_Cfg to_Cfg)
endif() endif()
endfunction() endfunction()
target_include_directories(boost_headeronly SYSTEM INTERFACE ${Boost_INCLUDE_DIRS}) if(TARGET Boost::system)
target_link_libraries(boost_libs INTERFACE boost_headeronly ${Boost_LIBRARIES}) message(STATUS "Boost::boost exists")
target_link_libraries(boost_headeronly INTERFACE Boost::boost)
# Only from cmake 3.12
# list(TRANSFORM _boost_components PREPEND Boost:: OUTPUT_VARIABLE _boost_targets)
set(_boost_targets "")
foreach(comp ${_boost_components})
list(APPEND _boost_targets "Boost::${comp}")
endforeach()
target_link_libraries(boost_libs INTERFACE
boost_headeronly # includes the custom compile definitions as well
${_boost_targets}
)
slic3r_remap_configs("${_boost_targets}" RelWithDebInfo Release)
else()
target_include_directories(boost_headeronly INTERFACE ${Boost_INCLUDE_DIRS})
target_link_libraries(boost_libs INTERFACE boost_headeronly ${Boost_LIBRARIES})
endif()
# Find and configure intel-tbb # Find and configure intel-tbb
if(SLIC3R_STATIC) if(SLIC3R_STATIC)
@@ -523,7 +435,7 @@ endif()
set(TBB_DEBUG 1) set(TBB_DEBUG 1)
set(CMAKE_MAP_IMPORTED_CONFIG_RELWITHDEBINFO RelWithDebInfo Release "") set(CMAKE_MAP_IMPORTED_CONFIG_RELWITHDEBINFO RelWithDebInfo Release "")
find_package(TBB REQUIRED) find_package(TBB REQUIRED)
# include_directories(SYSTEM ${TBB_INCLUDE_DIRS}) # include_directories(${TBB_INCLUDE_DIRS})
# add_definitions(${TBB_DEFINITIONS}) # add_definitions(${TBB_DEFINITIONS})
# if(MSVC) # if(MSVC)
# # Suppress implicit linking of the TBB libraries by the Visual Studio compiler. # # Suppress implicit linking of the TBB libraries by the Visual Studio compiler.
@@ -565,7 +477,7 @@ if (SLIC3R_STATIC AND NOT SLIC3R_STATIC_EXCLUDE_CURL)
find_package(OpenSSL REQUIRED) find_package(OpenSSL REQUIRED)
message("OpenSSL include dir: ${OPENSSL_INCLUDE_DIR}") message("OpenSSL include dir: ${OPENSSL_INCLUDE_DIR}")
message("OpenSSL libraries: ${OPENSSL_LIBRARIES}") message("OpenSSL libraries: ${OPENSSL_LIBRARIES}")
target_include_directories(libcurl SYSTEM INTERFACE ${OPENSSL_INCLUDE_DIR}) target_include_directories(libcurl INTERFACE ${OPENSSL_INCLUDE_DIR})
target_link_libraries(libcurl INTERFACE ${OPENSSL_LIBRARIES}) target_link_libraries(libcurl INTERFACE ${OPENSSL_LIBRARIES})
endif() endif()
endif() endif()
@@ -631,7 +543,7 @@ add_custom_target(gettext_make_pot
COMMAND xgettext --keyword=L --keyword=_L --keyword=_u8L --keyword=L_CONTEXT:1,2c --keyword=_L_PLURAL:1,2 --add-comments=TRN --from-code=UTF-8 --no-location --debug --boost COMMAND xgettext --keyword=L --keyword=_L --keyword=_u8L --keyword=L_CONTEXT:1,2c --keyword=_L_PLURAL:1,2 --add-comments=TRN --from-code=UTF-8 --no-location --debug --boost
-f "${BBL_L18N_DIR}/list.txt" -f "${BBL_L18N_DIR}/list.txt"
-o "${BBL_L18N_DIR}/OrcaSlicer.pot" -o "${BBL_L18N_DIR}/OrcaSlicer.pot"
COMMAND hintsToPot ${SLIC3R_RESOURCES_DIR} ${BBL_L18N_DIR} COMMAND hintsToPot ${SLIC3R_RESOURCES_DIR} ${BBL_L18N_DIR}
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
COMMENT "Generate pot file from strings in the source tree" COMMENT "Generate pot file from strings in the source tree"
) )
@@ -686,9 +598,11 @@ endif ()
find_path(SPNAV_INCLUDE_DIR spnav.h) find_path(SPNAV_INCLUDE_DIR spnav.h)
if (SPNAV_INCLUDE_DIR) if (SPNAV_INCLUDE_DIR)
find_library(SPNAV_LIB NAMES libspnav.a) # Force linking libspnav statically find_library(HAVE_SPNAV spnav)
if (SPNAV_LIB) if (HAVE_SPNAV)
add_definitions(-DHAVE_SPNAV) add_definitions(-DHAVE_SPNAV)
add_library(libspnav SHARED IMPORTED)
target_link_libraries(libspnav INTERFACE spnav)
message(STATUS "SPNAV library found") message(STATUS "SPNAV library found")
else() else()
message(STATUS "SPNAV library NOT found, Spacenavd not supported") message(STATUS "SPNAV library NOT found, Spacenavd not supported")
@@ -699,12 +613,10 @@ endif()
set(TOP_LEVEL_PROJECT_DIR ${PROJECT_SOURCE_DIR}) set(TOP_LEVEL_PROJECT_DIR ${PROJECT_SOURCE_DIR})
function(orcaslicer_copy_dlls target config postfix output_dlls) function(orcaslicer_copy_dlls target config postfix output_dlls)
if ("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "AMD64") if ("${CMAKE_SIZEOF_VOID_P}" STREQUAL "8")
set(_arch "x64") set(_bits 64)
elseif ("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "X86") elseif ("${CMAKE_SIZEOF_VOID_P}" STREQUAL "4")
set(_arch "x86") set(_bits 32)
else ()
message(FATAL_ERROR "Unable to detect architecture")
endif () endif ()
get_property(_is_multi GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) get_property(_is_multi GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
@@ -721,9 +633,9 @@ function(orcaslicer_copy_dlls target config postfix output_dlls)
message ("set out_dir to CMAKE_CURRENT_BINARY_DIR: ${_out_dir}") message ("set out_dir to CMAKE_CURRENT_BINARY_DIR: ${_out_dir}")
endif () endif ()
file(COPY ${TOP_LEVEL_PROJECT_DIR}/deps/GMP/gmp/lib/win-${_arch}/libgmp-10.dll file(COPY ${TOP_LEVEL_PROJECT_DIR}/deps/GMP/gmp/lib/win${_bits}/libgmp-10.dll
${TOP_LEVEL_PROJECT_DIR}/deps/MPFR/mpfr/lib/win-${_arch}/libmpfr-4.dll ${TOP_LEVEL_PROJECT_DIR}/deps/MPFR/mpfr/lib/win${_bits}/libmpfr-4.dll
${TOP_LEVEL_PROJECT_DIR}/deps/WebView2/lib/win-${_arch}/WebView2Loader.dll ${TOP_LEVEL_PROJECT_DIR}/deps/WebView2/lib/win${_bits}/WebView2Loader.dll
DESTINATION ${_out_dir}) DESTINATION ${_out_dir})
file(COPY ${CMAKE_PREFIX_PATH}/bin/occt/TKBO.dll file(COPY ${CMAKE_PREFIX_PATH}/bin/occt/TKBO.dll
@@ -791,7 +703,7 @@ function(orcaslicer_copy_dlls target config postfix output_dlls)
PARENT_SCOPE PARENT_SCOPE
) )
endfunction() endfunction()
@@ -818,7 +730,7 @@ endif()
if (NOT WIN32 AND NOT APPLE) if (NOT WIN32 AND NOT APPLE)
set(SLIC3R_APP_CMD "orca-slicer") set(SLIC3R_APP_CMD "orca-slicer")
configure_file(${LIBDIR}/platform/unix/build_appimage.sh.in ${CMAKE_CURRENT_BINARY_DIR}/build_appimage.sh USE_SOURCE_PERMISSIONS @ONLY) configure_file(${LIBDIR}/platform/unix/build_appimage.sh.in ${CMAKE_CURRENT_BINARY_DIR}/build_appimage.sh @ONLY)
endif() endif()
option(BUILD_BBS_TEST_TOOLS "Build bbs test tools" OFF) option(BUILD_BBS_TEST_TOOLS "Build bbs test tools" OFF)
@@ -831,7 +743,7 @@ endif()
if (WIN32) if (WIN32)
install(DIRECTORY "${SLIC3R_RESOURCES_DIR}/" DESTINATION "./resources") install(DIRECTORY "${SLIC3R_RESOURCES_DIR}/" DESTINATION "./resources")
set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP TRUE) set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP TRUE)
include(InstallRequiredSystemLibraries) include(InstallRequiredSystemLibraries)
install (PROGRAMS ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} DESTINATION ".") install (PROGRAMS ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} DESTINATION ".")
elseif (SLIC3R_FHS) elseif (SLIC3R_FHS)
# CMAKE_INSTALL_FULL_DATAROOTDIR: read-only architecture-independent data root (share) # CMAKE_INSTALL_FULL_DATAROOTDIR: read-only architecture-independent data root (share)
@@ -860,7 +772,7 @@ set (CPACK_PACKAGE_VENDOR "SoftFever")
set (CPACK_PACKAGE_VERSION_MAJOR "${ORCA_VERSION_MAJOR}") set (CPACK_PACKAGE_VERSION_MAJOR "${ORCA_VERSION_MAJOR}")
set (CPACK_PACKAGE_VERSION_MINOR "${ORCA_VERSION_MINOR}") set (CPACK_PACKAGE_VERSION_MINOR "${ORCA_VERSION_MINOR}")
set (CPACK_PACKAGE_VERSION_PATCH "${ORCA_VERSION_PATCH}") set (CPACK_PACKAGE_VERSION_PATCH "${ORCA_VERSION_PATCH}")
set (CPACK_PACKAGE_FILE_NAME "OrcaSlicer_Windows_Installer_V${SoftFever_VERSION}") set (CPACK_PACKAGE_FILE_NAME "OrcaSlicer_Windows_Installer_${SoftFever_VERSION}")
set (CPACK_PACKAGE_DESCRIPTION_SUMMARY "Orca Slicer is an open source slicer for FDM printers") set (CPACK_PACKAGE_DESCRIPTION_SUMMARY "Orca Slicer is an open source slicer for FDM printers")
set (CPACK_PACKAGE_HOMEPAGE_URL "https://github.com/SoftFever/OrcaSlicer") set (CPACK_PACKAGE_HOMEPAGE_URL "https://github.com/SoftFever/OrcaSlicer")
set (CPACK_PACKAGE_INSTALL_DIRECTORY ${CPACK_PACKAGE_NAME}) set (CPACK_PACKAGE_INSTALL_DIRECTORY ${CPACK_PACKAGE_NAME})

View File

@@ -1,15 +0,0 @@
#!/bin/bash
PROJECT_ROOT=$(cd -P -- "$(dirname -- "$0")" && printf '%s\n' "$(pwd -P)")
set -x
# Wishlist hint: For developers, creating a Docker Compose
# setup with persistent volumes for the build & deps directories
# would speed up recompile times significantly. For end users,
# the simplicity of a single Docker image and a one-time compilation
# seems better.
docker build -t orcaslicer \
--build-arg USER=$USER \
--build-arg UID=$(id -u) \
--build-arg GID=$(id -g) \
--build-arg NCORES=$NCORES \
$PROJECT_ROOT

View File

@@ -1,29 +0,0 @@
#!/bin/bash
set -x
# Just in case, here's some other things that might help:
# Force the container's hostname to be the same as your workstation
# -h $HOSTNAME \
# If there's problems with the X display, try this
# -v /tmp/.X11-unix:/tmp/.X11-unix \
# If you get an error like "Authorization required, but no authorization protocol specified," run line 9 in your terminal before rerunning this program
# xhost +local:docker
docker run \
`# Use the hosts networking. Printer wifi and also dbus communication` \
--net=host \
`# Some X installs will not have permissions to talk to sockets for shared memory` \
--ipc host \
`# Run as your workstations username to keep permissions the same` \
-u $USER \
`# Bind mount your home directory into the container for loading/saving files` \
-v $HOME:/home/$USER \
`# Pass the X display number to the container` \
-e DISPLAY=$DISPLAY \
`# It seems that libGL and dbus things need privileged mode` \
--privileged=true \
`# Attach tty for running orca slicer with command line things` \
-ti \
`# Clean up after yourself` \
--rm \
`# Pass all parameters from this script to the orca slicer ENTRYPOINT binary` \
orcaslicer $*

View File

@@ -1,100 +0,0 @@
FROM docker.io/ubuntu:24.04
LABEL maintainer "DeftDawg <DeftDawg@gmail.com>"
# Disable interactive package configuration
RUN apt-get update && \
echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
# Add a deb-src
RUN echo deb-src http://archive.ubuntu.com/ubuntu \
$(cat /etc/*release | grep VERSION_CODENAME | cut -d= -f2) main universe>> /etc/apt/sources.list
RUN apt-get update && apt-get install -y \
autoconf \
build-essential \
cmake \
curl \
eglexternalplatform-dev \
extra-cmake-modules \
file \
git \
gstreamer1.0-plugins-bad \
gstreamer1.0-libav \
libcairo2-dev \
libcurl4-openssl-dev \
libdbus-1-dev \
libglew-dev \
libglu1-mesa-dev \
libglu1-mesa-dev \
libgstreamer1.0-dev \
libgstreamerd-3-dev \
libgstreamer-plugins-base1.0-dev \
libgstreamer-plugins-good1.0-dev \
libgtk-3-dev \
libgtk-3-dev \
libsecret-1-dev \
libsoup2.4-dev \
libssl3 \
libssl-dev \
libtool \
libudev-dev \
libwayland-dev \
libwebkit2gtk-4.1-dev \
libxkbcommon-dev \
locales \
locales-all \
m4 \
pkgconf \
sudo \
wayland-protocols \
wget
# Change your locale here if you want. See the output
# of `locale -a` to pick the correct string formatting.
ENV LC_ALL=en_US.utf8
RUN locale-gen $LC_ALL
# Set this so that Orca Slicer doesn't complain about
# the CA cert path on every startup
ENV SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt
COPY ./ OrcaSlicer
WORKDIR OrcaSlicer
# These can run together, but we run them seperate for podman caching
# Update System dependencies
RUN ./build_linux.sh -u
# Build dependencies in ./deps
RUN ./build_linux.sh -dr
# Build slic3r
RUN ./build_linux.sh -sr
# Build AppImage
ENV container podman
RUN ./build_linux.sh -ir
# It's easier to run Orca Slicer as the same username,
# UID and GID as your workstation. Since we bind mount
# your home directory into the container, it's handy
# to keep permissions the same. Just in case, defaults
# are root.
SHELL ["/bin/bash", "-l", "-c"]
ARG USER=root
ARG UID=0
ARG GID=0
RUN if [[ "$UID" != "0" ]]; then \
# Create group if it doesn't exist \
groupadd -f -g $GID $USER; \
# Check if user with this UID already exists \
if getent passwd $UID > /dev/null 2>&1; then \
echo "User with UID $UID already exists, skipping user creation"; \
else \
useradd -u $UID -g $GID $USER; \
fi \
fi
# Using an entrypoint instead of CMD because the binary
# accepts several command line arguments.
ENTRYPOINT ["/OrcaSlicer/build/package/bin/orca-slicer"]

239
README.md
View File

@@ -1,147 +1,83 @@
<div align="center"> [![Build all](https://github.com/SoftFever/OrcaSlicer/actions/workflows/build_all.yml/badge.svg?branch=main)](https://github.com/SoftFever/OrcaSlicer/actions/workflows/build_all.yml)
# Orca Slicer
<picture> Orca Slicer is an open source slicer for FDM printers.
<img alt="OrcaSlicer logo" src="resources/images/OrcaSlicer.png" width="15%" height="15%"> You can download Orca Slicer here: [github releases page](https://github.com/SoftFever/OrcaSlicer/releases/).
</picture> ![discord-mark-blue](https://github.com/SoftFever/OrcaSlicer/assets/103989404/b97d5ffc-072d-4d0a-bbda-e67ef373876f) Join community: [OrcaSlicer Official Discord Server](https://discord.gg/P4VE9UY9gJ)
<a href="https://trendshift.io/repositories/952" target="_blank"><img src="https://trendshift.io/api/badge/repositories/952" alt="SoftFever%2FOrcaSlicer | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a>
[![GitHub Repo stars](https://img.shields.io/github/stars/SoftFever/OrcaSlicer)](https://github.com/SoftFever/OrcaSlicer/stargazers) [![Build all](https://github.com/SoftFever/OrcaSlicer/actions/workflows/build_all.yml/badge.svg?branch=main)](https://github.com/SoftFever/OrcaSlicer/actions/workflows/build_all.yml)
OrcaSlicer: an open source Next-Gen Slicing Software for Precision 3D Prints.
Optimize your prints with ultra-fast slicing, intelligent support generation, and seamless printer compatibility—engineered for perfection.
<h3>
# Official links and community
#### Official Website:
<a href="https://www.orcaslicer.com/" style="font-size:2em;">OrcaSlicer.com</a>
#### Github Repository:
<a href="https://github.com/SoftFever/OrcaSlicer"><img src="https://img.shields.io/badge/OrcaSlicer-181717?style=flat&logo=github&logoColor=white" width="200" alt="GitHub Logo"/> </a>
#### Follow us:
<a href="https://twitter.com/real_OrcaSlicer"><img src="https://img.shields.io/badge/real__OrcaSlicer-000000?style=flat&logo=x&logoColor=white" width="200" alt="X Logo"/> </a>
#### Join our Discord community:
<a href="https://discord.gg/P4VE9UY9gJ"><img src="https://img.shields.io/badge/-Discord-5865F2?style=flat&logo=discord&logoColor=fff" width="200" alt="discord logo"/> </a>
<table border="2" style="border-color: #ffa500; background-color:rgb(232, 220, 180); color: #856404;">
<tr>
<td>
<strong>⚠️ CAUTION:</strong><br><br>
There are several clickbait and malicious websites pretending to be Official OrcaSlicer. These sites may redirect you to dangerous downloads or contain misleading information.
<br><br>
If you come across any of these in search results, please report them as unsafe or spam to help keep the community secure.
</td>
</tr>
</table>
</div>
# Main features # Main features
- Auto calibrations for all printers
- Sandwich(inner-outer-inner) mode - an improved version of the `External perimeters first` mode
- [Precise wall](https://github.com/SoftFever/OrcaSlicer/wiki/Precise-wall)
- Polyholes conversion support [SuperSlicer Wiki: Polyholes](https://github.com/supermerill/SuperSlicer/wiki/Polyholes)
- Klipper support
- More granular controls
- More features can be found in [change notes](https://github.com/SoftFever/OrcaSlicer/releases/)
- **[Advanced Calibration Tools](https://github.com/SoftFever/OrcaSlicer/wiki/Calibration)** ### Some background
Comprehensive suite: temperature towers, flow rate, retraction & more for optimal performance. OrcaSlicer is fork of Bambu Studio
- **[Precise Wall](https://github.com/SoftFever/OrcaSlicer/wiki/quality_settings_precision#precise-wall) and [Seam Control](https://github.com/SoftFever/OrcaSlicer/wiki/quality_settings_seam)** It was previously known as BambuStudio-SoftFever
Adjust outer wall spacing and apply scarf seams to enhance print accuracy. Bambu Studio is forked from [PrusaSlicer](https://github.com/prusa3d/PrusaSlicer) by Prusa Research, which is from [Slic3r](https://github.com/Slic3r/Slic3r) by Alessandro Ranellucci and the RepRap community.
- **[Sandwich Mode](https://github.com/SoftFever/OrcaSlicer/wiki/quality_settings_wall_and_surfaces#innerouterinner) and [Polyholes](https://github.com/SoftFever/OrcaSlicer/wiki/quality_settings_precision#polyholes) Support** Orca Slicer incorporates a lot of features from SuperSlicer by @supermerill
Use varied infill patterns and accurate hole shapes for improved clarity. Orca Slicer's logo is designed by community member Justin Levine(@freejstnalxndr)
- **[Overhang](https://github.com/SoftFever/OrcaSlicer/wiki/quality_settings_overhangs) and [Support Optimization](https://github.com/SoftFever/OrcaSlicer/wiki#support-settings)**
Modify geometry for printable overhangs with precise support placement.
- **[Granular Controls](https://github.com/SoftFever/OrcaSlicer/wiki#process-settings) and Customization**
Fine-tune print speed, layer height, pressure, and temperature with precision.
- **Network Printer Support**
Seamless integration with Klipper, PrusaLink, and OctoPrint for remote control.
- **[Mouse Ear Brims](https://github.com/SoftFever/OrcaSlicer/wiki/others_settings_brim) & Adaptive Bed Mesh**
Automatic brims and adaptive mesh calibration ensure consistent adhesion.
- **User-Friendly Interface**
Intuitive drag-and-drop design with pre-made profiles for popular printers.
- **[Open-Source](https://github.com/SoftFever/OrcaSlicer) & [Community Driven](https://discord.gg/P4VE9UY9gJ)**
Regular updates fueled by continuous community contributions.
- **Wide Printer Compatibility**
Supports a broad range of printers: Bambu Lab, Prusa, Creality, Voron, and more.
- Additional features can be found in the [change notes](https://github.com/SoftFever/OrcaSlicer/releases/).
# Wiki
The wiki below aims to provide a detailed explanation of the slicer settings, including how to maximize their use and how to calibrate and set up your printer.
Please note that the wiki is a work in progress. We appreciate your patience as we continue to develop and improve it!
- **[Access the wiki here](https://github.com/SoftFever/OrcaSlicer/wiki)**
- **[Contribute to the wiki](https://github.com/SoftFever/OrcaSlicer/wiki/How-to-wiki)**
# Download
## Stable Release
📥 **[Download the Latest Stable Release](https://github.com/SoftFever/OrcaSlicer/releases/latest)**
Visit our GitHub Releases page for the latest stable version of Orca Slicer, recommended for most users.
## Nightly Builds
🌙 **[Download the Latest Nightly Build](https://github.com/SoftFever/OrcaSlicer/releases/tag/nightly-builds)**
Explore the latest developments in Orca Slicer with our nightly builds. Feedback on these versions is highly appreciated.
# How to install # How to install
## Windows **Windows**:
Download the **Windows Installer exe** for your preferred version from the [releases page](https://github.com/SoftFever/OrcaSlicer/releases). 1. Download the installer for your preferred version from the [releases page](https://github.com/SoftFever/OrcaSlicer/releases).
- *For convenience there is also a portable build available.*
- *For convenience there is also a portable build available.*
<details>
<summary>Troubleshooting</summary>
- *If you have troubles to run the build, you might need to install following runtimes:* - *If you have troubles to run the build, you might need to install following runtimes:*
- [MicrosoftEdgeWebView2RuntimeInstallerX64](https://github.com/SoftFever/OrcaSlicer/releases/download/v1.0.10-sf2/MicrosoftEdgeWebView2RuntimeInstallerX64.exe) - [MicrosoftEdgeWebView2RuntimeInstallerX64](https://github.com/SoftFever/BambuStudio-SoftFever/releases/download/v1.0.10-sf2/MicrosoftEdgeWebView2RuntimeInstallerX64.exe)
- [Details of this runtime](https://aka.ms/webview2) - [Details of this runtime](https://aka.ms/webview2)
- [Alternative Download Link Hosted by Microsoft](https://go.microsoft.com/fwlink/p/?LinkId=2124703) - [Alternative Download Link Hosted by Microsoft](https://go.microsoft.com/fwlink/p/?LinkId=2124703)
- [vcredist2019_x64](https://github.com/SoftFever/OrcaSlicer/releases/download/v1.0.10-sf2/vcredist2019_x64.exe) - [vcredist2019_x64](https://github.com/SoftFever/BambuStudio-SoftFever/releases/download/v1.0.10-sf2/vcredist2019_x64.exe)
- [Alternative Download Link Hosted by Microsoft](https://aka.ms/vs/17/release/vc_redist.x64.exe) - [Alternative Download Link Hosted by Microsoft](https://aka.ms/vs/17/release/vc_redist.x64.exe)
- This file may already be available on your computer if you've installed visual studio. Check the following location: `%VCINSTALLDIR%Redist\MSVC\v142` - This file may already be available on your computer if you've installed visual studio. Check the following location: `%VCINSTALLDIR%Redist\MSVC\v142`
</details>
Windows Package Manager:
```shell
winget install --id=SoftFever.OrcaSlicer --exact
```
## Mac:
1. Download the DMG for your computer: `arm64` version for Apple Silicon and `x86_64` for Intel CPU.
2. Drag OrcaSlicer.app to Application folder.
3. *If you want to run a build from a PR, you also need to follow the instructions below:*
<details>
<summary>Quarantine</summary>
**Mac**:
1. Download the DMG for your computer: `arm64` version for Apple Silicon and `x86_64` for Intel CPU.
2. Drag OrcaSlicer.app to Application folder.
3. *If you want to run a build from a PR, you also need following instructions below*
<details quarantine>
- Option 1 (You only need to do this once. After that the app can be opened normally.): - Option 1 (You only need to do this once. After that the app can be opened normally.):
- Step 1: Hold _cmd_ and right click the app, from the context menu choose **Open**. - Step 1: Hold _cmd_ and right click the app, from the context menu choose **Open**.
- Step 2: A warning window will pop up, click _Open_ - Step 2: A warning window will pop up, click _Open_
- Option 2: - Option 2:
Execute this command in terminal: Execute this command in terminal: `xattr -dr com.apple.quarantine /Applications/OrcaSlicer.app`
```shell ```console
xattr -dr com.apple.quarantine /Applications/OrcaSlicer.app` softfever@mac:~$ xattr -dr com.apple.quarantine /Applications/OrcaSlicer.app
``` ```
- Option 3: - Option 3:
- Step 1: open the app, a warning window will pop up - Step 1: open the app, a warning window will pop up
![mac_cant_open](./SoftFever_doc/mac_cant_open.png) ![image](./SoftFever_doc/mac_cant_open.png)
- Step 2: in `System Settings` -> `Privacy & Security`, click `Open Anyway`: - Step 2: in `System Settings` -> `Privacy & Security`, click `Open Anyway`:
![mac_security_setting](./SoftFever_doc/mac_security_setting.png) ![image](./SoftFever_doc/mac_security_setting.png)
</details> </details>
**Linux(Ubuntu)**:
1. If you run into trouble to execute it, try this command in terminal:
`chmod +x /path_to_appimage/OrcaSlicer_ubu64.AppImage`
# How to compile
- Windows 64-bit
- Tools needed: Visual Studio 2019, Cmake, git, Strawberry Perl.
- You will require cmake version 3.14 or later, which is available [on their website](https://cmake.org/download/).
- Strawberry Perl is [available on their github repository](https://github.com/StrawberryPerl/Perl-Dist-Strawberry/releases/).
- Run `build_release.bat` in `x64 Native Tools Command Prompt for VS 2019`
## Linux (Ubuntu): - Mac 64-bit
1. If you run into trouble executing it, try this command in the terminal: - Tools needed: Xcode, Cmake, git, gettext, libtool, automake, autoconf, texinfo
`chmod +x /path_to_appimage/OrcaSlicer_Linux.AppImage` - You can install most of them by running `brew install cmake gettext libtool automake autoconf texinfo`
- run `build_release_macos.sh`
# How to Compile - Ubuntu
All updated build instructions for Windows, macOS, and Linux are now available on the official [OrcaSlicer Wiki - How to build](https://github.com/SoftFever/OrcaSlicer/wiki/How-to-build) page. - Dependencies **Will be auto installed with the shell script**: `libmspack-dev libgstreamerd-3-dev libsecret-1-dev libwebkit2gtk-4.0-dev libosmesa6-dev libssl-dev libcurl4-openssl-dev eglexternalplatform-dev libudev-dev libdbus-1-dev extra-cmake-modules libgtk2.0-dev libglew-dev libudev-dev libdbus-1-dev cmake git texinfo`
- run 'sudo ./BuildLinux.sh -u'
- run './BuildLinux.sh -dsir'
Please refer to the wiki to ensure you're following the latest and most accurate steps for your platform.
# Klipper Note: # Note:
If you're running Klipper, it's recommended to add the following configuration to your `printer.cfg` file. If you're running Klipper, it's recommended to add the following configuration to your `printer.cfg` file.
```gcode ```
# Enable object exclusion # Enable object exclusion
[exclude_object] [exclude_object]
@@ -151,52 +87,49 @@ resolution: 0.1
``` ```
# Supports # Supports
**Orca Slicer** is an open-source project and I'm deeply grateful to all my sponsors and backers. **Orca Slicer** is an open-source project, and I'm deeply grateful to all my sponsors and backers.
Their generous support enables me to purchase filaments and other essential 3D printing materials for the project. Their generous support enables me to purchase filaments and other essential 3D printing materials for the project.
Thank you! :) Thank you! :)
## Sponsors: ### Sponsors:
<table> <table>
<tr> <tr>
<td> <td>
<a href="https://qidi3d.com/" style="display:inline-block; border-radius:8px; background:#fff;"> <a href="https://peopoly.net/">
<img src="SoftFever_doc\sponsor_logos\QIDI.png" alt="QIDI" width="100" height="100"> <img src="SoftFever_doc\sponsor_logos\peopoly-standard-logo.png" alt="Peopoly" width="64" height="">
</a> </a>
</td> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> <td>
<a href="https://bigtree-tech.com/" style="display:inline-block; border-radius:8px; background:#222;"> <a href="https://qidi3d.com/">
<img src="SoftFever_doc\sponsor_logos\BigTreeTech.png" alt="BIGTREE TECH" width="100" height="100"> <img src="SoftFever_doc\sponsor_logos\QIDI.png" alt="QIDI" width="64" height="">
</a> </a>
</td> </td>
</tr> </tr>
</table> </table>
## Backers: ### Backers:
**Ko-fi supporters** ☕: [Backers list](https://github.com/user-attachments/files/16147016/Supporters_638561417699952499.csv) Ko-fi supporters: [Backers list](https://github.com/SoftFever/OrcaSlicer/wiki/OrcaSlicer-backers-%E2%80%90-28-Oct-2023)
## Support me Support me
<a href="https://github.com/sponsors/SoftFever"><img src="https://img.shields.io/badge/GitHub%20Sponsors-30363D?style=flat&logo=GitHub-Sponsors&logoColor=EA4AAA" height="50"></a> [![ko-fi](https://ko-fi.com/img/githubbutton_sm.svg)](https://ko-fi.com/G2G5IP3CP)
<a href="https://ko-fi.com/G2G5IP3CP"><img src="https://img.shields.io/badge/Support_me_on_Ko--fi-FF5E5B?style=flat&logo=ko-fi&logoColor=white" height="50"></a>
<a href="https://paypal.me/softfever3d"><img src="https://img.shields.io/badge/PayPal-003087?style=flat&logo=paypal&logoColor=fff" height="50"></a>
## Some background
OrcaSlicer was originally forked from Bambu Studio, it was previously known as BambuStudio-SoftFever.
[Bambu Studio](https://github.com/bambulab/BambuStudio) is forked from [PrusaSlicer](https://github.com/prusa3d/PrusaSlicer) by Prusa Research, which is from [Slic3r](https://github.com/Slic3r/Slic3r) by Alessandro Ranellucci and the RepRap community.
Orca Slicer incorporates a lot of features from [SuperSlicer](https://github.com/supermerill/SuperSlicer) by @supermerill
Orca Slicer's logo is designed by community member Justin Levine(@freejstnalxndr).
# License # License
**Orca Slicer** is licensed under the GNU Affero General Public License, version 3. Orca Slicer is based on Bambu Studio by BambuLab. Orca Slicer is licensed under the GNU Affero General Public License, version 3. Orca Slicer is based on Bambu Studio by BambuLab.
**Bambu Studio** is licensed under the GNU Affero General Public License, version 3. Bambu Studio is based on PrusaSlicer by PrusaResearch. Bambu Studio is licensed under the GNU Affero General Public License, version 3. Bambu Studio is based on PrusaSlicer by PrusaResearch.
**PrusaSlicer** is licensed under the GNU Affero General Public License, version 3. PrusaSlicer is owned by Prusa Research. PrusaSlicer is originally based on Slic3r by Alessandro Ranellucci. PrusaSlicer is licensed under the GNU Affero General Public License, version 3. PrusaSlicer is owned by Prusa Research. PrusaSlicer is originally based on Slic3r by Alessandro Ranellucci.
**Slic3r** is licensed under the GNU Affero General Public License, version 3. Slic3r was created by Alessandro Ranellucci with the help of many other contributors. Slic3r is licensed under the GNU Affero General Public License, version 3. Slic3r was created by Alessandro Ranellucci with the help of many other contributors.
The GNU Affero General Public License, version 3 ensures that if you use any part of this software in any way (even behind a web server), your software must be released under the same license. The GNU Affero General Public License, version 3 ensures that if you use any part of this software in any way (even behind a web server), your software must be released under the same license.
Orca Slicer includes a pressure advance calibration pattern test adapted from Andrew Ellis' generator, which is licensed under GNU General Public License, version 3. Ellis' generator is itself adapted from a generator developed by Sineos for Marlin, which is licensed under GNU General Public License, version 3. Orca Slicer includes a pressure advance calibration pattern test adapted from Andrew Ellis' generator, which is licensed under GNU General Public License, version 3. Ellis' generator is itself adapted from a generator developed by Sineos for Marlin, which is licensed under GNU General Public License, version 3.
The Bambu networking plugin is based on non-free libraries from BambuLab. It is optional to the Orca Slicer and provides extended functionalities for Bambulab printer users. The bambu networking plugin is based on non-free libraries from Bambulab. It is optional to the Orca Slicer and provides extended functionalities for Bambulab printer users.

1
Readme.txt Normal file
View File

@@ -0,0 +1 @@
Init Version

View File

@@ -1,47 +0,0 @@
# Security Policy
At OrcaSlicer, we are committed to maintaining the security of our ecosystem. Our policy is to ensure that we do not introduce vulnerabilities and that any security issues are addressed promptly and responsibly. We appreciate your help in improving the security of OrcaSlicer and thank you for your responsible disclosure.
Reporting Security Bugs
## To report a security bug, please follow these guidelines:
* Email Security Bugs:
Send an email to the lead maintainer at softfeverever@gmail.com.
Include the word "SECURITY" in the subject line of your email.
* Response Times:
The lead maintainer will acknowledge receipt of your email within one week (7 days).
A detailed response will follow within 48 hours, outlining the next steps for handling your report.
After the initial reply, the security team will keep you informed about the progress toward a fix and any announcements.
* Information and Collaboration:
We may request additional information or guidance as we work on addressing the issue.
* Handling the Report:
OrcaSlicer will confirm the problem and determine the affected versions.
We will audit the code to find any similar issues and prepare fixes for all releases still under maintenance.
Fixes will be released as quickly as possible.
* Third-Party Modules:
Report security issues in third-party modules to the respective maintainer of those modules.
## Security Disclosure Guidelines
When disclosing a vulnerability, please follow these steps to ensure your report is clear and actionable:
* Provide Detailed Information:
Scope: Clearly define the scope of the vulnerability.
Potential Impact: Let us know who could be affected by this exploit.
Reproduction Steps: Document detailed steps to reproduce the vulnerability.
Reference OWASP Guidelines:
Follow the <a href="https://cheatsheetseries.owasp.org/cheatsheets/Vulnerability_Disclosure_Cheat_Sheet.html">OWASP Vulnerability Disclosure Cheat Sheet</a> for best practices in vulnerability disclosure.
## Security Recommendations
To enhance security when using OrcaSlicer, we recommend following these steps:
* SEE SOMETHING: If you notice anything suspicious or have concerns, please report it.
* SAY SOMETHING: If you have any doubts or need assistance, do not hesitate to contact us.
### Thank you for your commitment to the security of OrcaSlicer. Your efforts help us maintain a safe and reliable ecosystem.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 62 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 77 KiB

View File

@@ -1,226 +0,0 @@
#!/usr/bin/env bash
SCRIPT_NAME=$(basename "$0")
SCRIPT_PATH=$(dirname $(readlink -f ${0}))
pushd ${SCRIPT_PATH} > /dev/null
set -e # Exit immediately if a command exits with a non-zero status.
function check_available_memory_and_disk() {
FREE_MEM_GB=$(free --gibi --total | grep 'Mem' | rev | cut --delimiter=" " --fields=1 | rev)
MIN_MEM_GB=10
FREE_DISK_KB=$(df --block-size=1K . | tail -1 | awk '{print $4}')
MIN_DISK_KB=$((10 * 1024 * 1024))
if [[ ${FREE_MEM_GB} -le ${MIN_MEM_GB} ]] ; then
echo -e "\nERROR: Orca Slicer Builder requires at least ${MIN_MEM_GB}G of 'available' mem (system has only ${FREE_MEM_GB}G available)"
echo && free --human && echo
echo "Invoke with -r to skip RAM and disk checks."
exit 2
fi
if [[ ${FREE_DISK_KB} -le ${MIN_DISK_KB} ]] ; then
echo -e "\nERROR: Orca Slicer Builder requires at least $(echo ${MIN_DISK_KB} |awk '{ printf "%.1fG\n", $1/1024/1024; }') (system has only $(echo ${FREE_DISK_KB} | awk '{ printf "%.1fG\n", $1/1024/1024; }') disk free)"
echo && df --human-readable . && echo
echo "Invoke with -r to skip ram and disk checks."
exit 1
fi
}
function usage() {
echo "Usage: ./${SCRIPT_NAME} [-1][-b][-c][-d][-h][-i][-j N][-p][-r][-s][-u][-l]"
echo " -1: limit builds to one core (where possible)"
echo " -j N: limit builds to N cores (where possible)"
echo " -b: build in debug mode"
echo " -c: force a clean build"
echo " -C: enable ANSI-colored compile output (GNU/Clang only)"
echo " -d: download and build dependencies in ./deps/ (build prerequisite)"
echo " -h: prints this help text"
echo " -i: build the Orca Slicer AppImage (optional)"
echo " -p: boost ccache hit rate by disabling precompiled headers (default: ON)"
echo " -r: skip RAM and disk checks (low RAM compiling)"
echo " -s: build the Orca Slicer (optional)"
echo " -u: install system dependencies (asks for sudo password; build prerequisite)"
echo " -l: use Clang instead of GCC (default: GCC)"
echo "For a first use, you want to './${SCRIPT_NAME} -u'"
echo " and then './${SCRIPT_NAME} -dsi'"
}
SLIC3R_PRECOMPILED_HEADERS="ON"
unset name
while getopts ":1j:bcCdhiprsul" opt ; do
case ${opt} in
1 )
export CMAKE_BUILD_PARALLEL_LEVEL=1
;;
j )
export CMAKE_BUILD_PARALLEL_LEVEL=$OPTARG
;;
b )
BUILD_DEBUG="1"
;;
c )
CLEAN_BUILD=1
;;
C )
COLORED_OUTPUT="-DCOLORED_OUTPUT=ON"
;;
d )
BUILD_DEPS="1"
;;
h ) usage
exit 0
;;
i )
BUILD_IMAGE="1"
;;
p )
SLIC3R_PRECOMPILED_HEADERS="OFF"
;;
r )
SKIP_RAM_CHECK="1"
;;
s )
BUILD_ORCA="1"
;;
u )
UPDATE_LIB="1"
;;
l )
USE_CLANG="1"
;;
esac
done
if [ ${OPTIND} -eq 1 ] ; then
usage
exit 0
fi
# cmake 4.x compatibility workaround
export CMAKE_POLICY_VERSION_MINIMUM=3.5
DISTRIBUTION=$(awk -F= '/^ID=/ {print $2}' /etc/os-release | tr -d '"')
DISTRIBUTION_LIKE=$(awk -F= '/^ID_LIKE=/ {print $2}' /etc/os-release | tr -d '"')
# Check for direct distribution match to Ubuntu/Debian
if [ "${DISTRIBUTION}" == "ubuntu" ] || [ "${DISTRIBUTION}" == "linuxmint" ] ; then
DISTRIBUTION="debian"
# Check if distribution is Debian/Ubuntu-like based on ID_LIKE
elif [[ "${DISTRIBUTION_LIKE}" == *"debian"* ]] || [[ "${DISTRIBUTION_LIKE}" == *"ubuntu"* ]] ; then
DISTRIBUTION="debian"
elif [[ "${DISTRIBUTION_LIKE}" == *"arch"* ]] ; then
DISTRIBUTION="arch"
fi
if [ ! -f ./linux.d/${DISTRIBUTION} ] ; then
echo "Your distribution \"${DISTRIBUTION}\" is not supported by system-dependency scripts in ./linux.d/"
echo "Please resolve dependencies manually and contribute a script for your distribution to upstream."
exit 1
else
echo "resolving system dependencies for distribution \"${DISTRIBUTION}\" ..."
source ./linux.d/${DISTRIBUTION}
fi
echo "FOUND_GTK3=${FOUND_GTK3}"
if [[ -z "${FOUND_GTK3_DEV}" ]] ; then
echo "Error, you must install the dependencies before."
echo "Use option -u with sudo"
exit 1
fi
echo "Changing date in version..."
{
# change date in version
sed --in-place "s/+UNKNOWN/_$(date '+%F')/" version.inc
}
echo "done"
if ! [[ -n "${SKIP_RAM_CHECK}" ]] ; then
check_available_memory_and_disk
fi
export CMAKE_C_CXX_COMPILER_CLANG=""
if [[ -n "${USE_CLANG}" ]] ; then
export CMAKE_C_CXX_COMPILER_CLANG="-DCMAKE_C_COMPILER=/usr/bin/clang -DCMAKE_CXX_COMPILER=/usr/bin/clang++"
fi
if [[ -n "${BUILD_DEPS}" ]] ; then
echo "Configuring dependencies..."
BUILD_ARGS="${DEPS_EXTRA_BUILD_ARGS} -DDEP_WX_GTK3=ON"
if [[ -n "${CLEAN_BUILD}" ]]
then
rm -fr deps/build
fi
if [ ! -d "deps/build" ]
then
mkdir deps/build
fi
if [[ -n "${BUILD_DEBUG}" ]] ; then
# build deps with debug and release else cmake will not find required sources
if [ ! -d "deps/build/release" ] ; then
mkdir deps/build/release
fi
cmake ${CMAKE_C_CXX_COMPILER_CLANG} -S deps -B deps/build/release -DSLIC3R_PCH=${SLIC3R_PRECOMPILED_HEADERS} -G Ninja -DDESTDIR="${SCRIPT_PATH}/deps/build/destdir" -DDEP_DOWNLOAD_DIR="${SCRIPT_PATH}/deps/DL_CACHE" ${COLORED_OUTPUT} ${BUILD_ARGS}
cmake --build deps/build/release
BUILD_ARGS="${BUILD_ARGS} -DCMAKE_BUILD_TYPE=Debug"
fi
echo "cmake -S deps -B deps/build ${CMAKE_C_CXX_COMPILER_CLANG} -G Ninja ${BUILD_ARGS}"
cmake -S deps -B deps/build ${CMAKE_C_CXX_COMPILER_CLANG} -G Ninja ${COLORED_OUTPUT} ${BUILD_ARGS}
cmake --build deps/build
fi
if [[ -n "${BUILD_ORCA}" ]] ; then
echo "Configuring OrcaSlicer..."
if [[ -n "${CLEAN_BUILD}" ]] ; then
rm --force --recursive build
fi
BUILD_ARGS="${ORCA_EXTRA_BUILD_ARGS}"
if [[ -n "${FOUND_GTK3_DEV}" ]] ; then
BUILD_ARGS="${BUILD_ARGS} -DSLIC3R_GTK=3"
fi
if [[ -n "${BUILD_DEBUG}" ]] ; then
BUILD_ARGS="${BUILD_ARGS} -DCMAKE_BUILD_TYPE=Debug -DBBL_INTERNAL_TESTING=1"
else
BUILD_ARGS="${BUILD_ARGS} -DBBL_RELEASE_TO_PUBLIC=1 -DBBL_INTERNAL_TESTING=0"
fi
CMAKE_CMD="cmake -S . -B build ${CMAKE_C_CXX_COMPILER_CLANG} -G Ninja \
-DSLIC3R_PCH=${SLIC3R_PRECOMPILED_HEADERS} \
-DCMAKE_PREFIX_PATH="${SCRIPT_PATH}/deps/build/destdir/usr/local" \
-DSLIC3R_STATIC=1 \
-DORCA_TOOLS=ON \
${COLORED_OUTPUT} \
${BUILD_ARGS}"
echo -e "${CMAKE_CMD}"
${CMAKE_CMD}
echo "done"
echo "Building OrcaSlicer ..."
cmake --build build --target OrcaSlicer
echo "Building OrcaSlicer_profile_validator .."
cmake --build build --target OrcaSlicer_profile_validator
./run_gettext.sh
echo "done"
fi
if [[ -n "${BUILD_IMAGE}" || -n "${BUILD_ORCA}" ]] ; then
pushd build > /dev/null
echo "[9/9] Generating Linux app..."
build_linux_image="./src/build_linux_image.sh"
if [[ -e ${build_linux_image} ]] ; then
extra_script_args=""
if [[ -n "${BUILD_IMAGE}" ]] ; then
extra_script_args="-i"
fi
${build_linux_image} ${extra_script_args}
echo "done"
fi
popd > /dev/null # build
fi
popd > /dev/null # ${SCRIPT_PATH}

View File

@@ -1,50 +1,26 @@
set WP=%CD% set WP=%CD%
set debug=OFF
set debuginfo=OFF
if "%1"=="debug" set debug=ON
if "%2"=="debug" set debug=ON
if "%1"=="debuginfo" set debuginfo=ON
if "%2"=="debuginfo" set debuginfo=ON
if "%debug%"=="ON" (
set build_type=Debug
set build_dir=build-dbg
) else (
if "%debuginfo%"=="ON" (
set build_type=RelWithDebInfo
set build_dir=build-dbginfo
) else (
set build_type=Release
set build_dir=build
)
)
echo build type set to %build_type%
cd deps cd deps
mkdir %build_dir% mkdir build
cd %build_dir% cd build
set DEPS=%CD%/OrcaSlicer_dep set DEPS=%CD%/OrcaSlicer_dep
if "%1"=="slicer" ( if "%1"=="slicer" (
GOTO :slicer GOTO :slicer
) )
echo "building deps.." echo "building deps.."
cmake ../ -G "Visual Studio 16 2019" -DDESTDIR="%CD%/OrcaSlicer_dep" -DCMAKE_BUILD_TYPE=Release
echo cmake ../ -G "Visual Studio 16 2019" -A x64 -DDESTDIR="%CD%/OrcaSlicer_dep" -DCMAKE_BUILD_TYPE=%build_type% -DDEP_DEBUG=%debug% -DORCA_INCLUDE_DEBUG_INFO=%debuginfo% cmake --build . --config Release --target deps -- -m
cmake ../ -G "Visual Studio 16 2019" -A x64 -DDESTDIR="%CD%/OrcaSlicer_dep" -DCMAKE_BUILD_TYPE=%build_type% -DDEP_DEBUG=%debug% -DORCA_INCLUDE_DEBUG_INFO=%debuginfo%
cmake --build . --config %build_type% --target deps -- -m
if "%1"=="deps" exit /b 0 if "%1"=="deps" exit /b 0
:slicer :slicer
echo "building Orca Slicer..." echo "building Orca Slicer..."
cd %WP% cd %WP%
mkdir %build_dir% mkdir build
cd %build_dir% cd build
echo cmake .. -G "Visual Studio 16 2019" -A x64 -DBBL_RELEASE_TO_PUBLIC=1 -DCMAKE_PREFIX_PATH="%DEPS%/usr/local" -DCMAKE_INSTALL_PREFIX="./OrcaSlicer" -DCMAKE_BUILD_TYPE=%build_type% cmake .. -G "Visual Studio 16 2019" -DBBL_RELEASE_TO_PUBLIC=1 -DCMAKE_PREFIX_PATH="%DEPS%/usr/local" -DCMAKE_INSTALL_PREFIX="./OrcaSlicer" -DCMAKE_BUILD_TYPE=Release -DWIN10SDK_PATH="C:/Program Files (x86)/Windows Kits/10/Include/10.0.19041.0"
cmake .. -G "Visual Studio 16 2019" -A x64 -DBBL_RELEASE_TO_PUBLIC=1 -DCMAKE_PREFIX_PATH="%DEPS%/usr/local" -DCMAKE_INSTALL_PREFIX="./OrcaSlicer" -DCMAKE_BUILD_TYPE=%build_type% -DWIN10SDK_PATH="C:/Program Files (x86)/Windows Kits/10/Include/10.0.19041.0" cmake --build . --config Release --target ALL_BUILD -- -m
cmake --build . --config %build_type% --target ALL_BUILD -- -m
cd .. cd ..
call run_gettext.bat call run_gettext.bat
cd %build_dir% cd build
cmake --build . --target install --config %build_type% cmake --build . --target install --config Release

View File

@@ -1,10 +1,7 @@
#!/bin/bash #!/bin/sh
set -e while getopts ":a:sdpt:hn" opt; do
set -o pipefail case ${opt} in
while getopts ":dpa:snt:xbc:h" opt; do
case "${opt}" in
d ) d )
export BUILD_TARGET="deps" export BUILD_TARGET="deps"
;; ;;
@@ -23,76 +20,25 @@ while getopts ":dpa:snt:xbc:h" opt; do
t ) t )
export OSX_DEPLOYMENT_TARGET="$OPTARG" export OSX_DEPLOYMENT_TARGET="$OPTARG"
;; ;;
x )
export SLICER_CMAKE_GENERATOR="Ninja Multi-Config"
export SLICER_BUILD_TARGET="all"
export DEPS_CMAKE_GENERATOR="Ninja"
;;
b )
export BUILD_ONLY="1"
;;
c )
export BUILD_CONFIG="$OPTARG"
;;
1 )
export CMAKE_BUILD_PARALLEL_LEVEL=1
;;
h ) echo "Usage: ./build_release_macos.sh [-d]" h ) echo "Usage: ./build_release_macos.sh [-d]"
echo " -d: Build deps only" echo " -d: Build deps only"
echo " -a: Set ARCHITECTURE (arm64 or x86_64 or universal)" echo " -a: Set ARCHITECTURE (arm64 or x86_64)"
echo " -s: Build slicer only" echo " -s: Build slicer only"
echo " -n: Nightly build" echo " -n: Nightly build"
echo " -t: Specify minimum version of the target platform, default is 11.3" echo " -t: Specify minimum version of the target platform, default is 11.3"
echo " -x: Use Ninja Multi-Config CMake generator, default is Xcode"
echo " -b: Build without reconfiguring CMake"
echo " -c: Set CMake build configuration, default is Release"
echo " -1: Use single job for building"
exit 0 exit 0
;; ;;
* )
;;
esac esac
done done
# Set defaults if [ -z "$ARCH" ]
then
if [ -z "$ARCH" ]; then export ARCH=$(uname -m)
ARCH="$(uname -m)"
export ARCH
fi fi
if [ -z "$BUILD_CONFIG" ]; then echo "Arch: $ARCH"
export BUILD_CONFIG="Release" echo "BUILD_TARGET: $BUILD_TARGET"
fi echo "OSX_DEPLOYMENT_TARGET: $OSX_DEPLOYMENT_TARGET"
if [ -z "$BUILD_TARGET" ]; then
export BUILD_TARGET="all"
fi
if [ -z "$SLICER_CMAKE_GENERATOR" ]; then
export SLICER_CMAKE_GENERATOR="Xcode"
fi
if [ -z "$SLICER_BUILD_TARGET" ]; then
export SLICER_BUILD_TARGET="ALL_BUILD"
fi
if [ -z "$DEPS_CMAKE_GENERATOR" ]; then
export DEPS_CMAKE_GENERATOR="Unix Makefiles"
fi
if [ -z "$OSX_DEPLOYMENT_TARGET" ]; then
export OSX_DEPLOYMENT_TARGET="11.3"
fi
echo "Build params:"
echo " - ARCH: $ARCH"
echo " - BUILD_CONFIG: $BUILD_CONFIG"
echo " - BUILD_TARGET: $BUILD_TARGET"
echo " - CMAKE_GENERATOR: $SLICER_CMAKE_GENERATOR for Slicer, $DEPS_CMAKE_GENERATOR for deps"
echo " - OSX_DEPLOYMENT_TARGET: $OSX_DEPLOYMENT_TARGET"
echo
# if which -s brew; then # if which -s brew; then
# brew --prefix libiconv # brew --prefix libiconv
# brew --prefix zstd # brew --prefix zstd
@@ -106,199 +52,57 @@ echo
# exit 1 # exit 1
# fi # fi
PROJECT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT_BUILD_DIR="$PROJECT_DIR/build/$ARCH"
DEPS_DIR="$PROJECT_DIR/deps"
DEPS_BUILD_DIR="$DEPS_DIR/build/$ARCH"
DEPS="$DEPS_BUILD_DIR/OrcaSlicer_deps"
# For Multi-config generators like Ninja and Xcode
export BUILD_DIR_CONFIG_SUBDIR="/$BUILD_CONFIG"
function build_deps() {
# iterate over two architectures: x86_64 and arm64
for _ARCH in x86_64 arm64; do
# if ARCH is universal or equal to _ARCH
if [ "$ARCH" == "universal" ] || [ "$ARCH" == "$_ARCH" ]; then
PROJECT_BUILD_DIR="$PROJECT_DIR/build/$_ARCH"
DEPS_BUILD_DIR="$DEPS_DIR/build/$_ARCH"
DEPS="$DEPS_BUILD_DIR/OrcaSlicer_dep"
echo "Building deps..."
(
set -x
mkdir -p "$DEPS"
cd "$DEPS_BUILD_DIR"
if [ "1." != "$BUILD_ONLY". ]; then
cmake "${DEPS_DIR}" \
-G "${DEPS_CMAKE_GENERATOR}" \
-DDESTDIR="$DEPS" \
-DOPENSSL_ARCH="darwin64-${_ARCH}-cc" \
-DCMAKE_BUILD_TYPE="$BUILD_CONFIG" \
-DCMAKE_OSX_ARCHITECTURES:STRING="${_ARCH}" \
-DCMAKE_OSX_DEPLOYMENT_TARGET="${OSX_DEPLOYMENT_TARGET}"
fi
cmake --build . --config "$BUILD_CONFIG" --target deps
)
fi
done
}
function pack_deps() {
echo "Packing deps..."
(
set -x
cd "$DEPS_DIR"
tar -zcvf "OrcaSlicer_dep_mac_${ARCH}_$(date +"%Y%m%d").tar.gz" "build"
)
}
function build_slicer() {
# iterate over two architectures: x86_64 and arm64
for _ARCH in x86_64 arm64; do
# if ARCH is universal or equal to _ARCH
if [ "$ARCH" == "universal" ] || [ "$ARCH" == "$_ARCH" ]; then
PROJECT_BUILD_DIR="$PROJECT_DIR/build/$_ARCH"
DEPS_BUILD_DIR="$DEPS_DIR/build/$_ARCH"
DEPS="$DEPS_BUILD_DIR/OrcaSlicer_dep"
echo "Building slicer for $_ARCH..."
(
set -x
mkdir -p "$PROJECT_BUILD_DIR"
cd "$PROJECT_BUILD_DIR"
if [ "1." != "$BUILD_ONLY". ]; then
cmake "${PROJECT_DIR}" \
-G "${SLICER_CMAKE_GENERATOR}" \
-DBBL_RELEASE_TO_PUBLIC=1 \
-DORCA_TOOLS=ON \
-DCMAKE_PREFIX_PATH="$DEPS/usr/local" \
-DCMAKE_INSTALL_PREFIX="$PWD/OrcaSlicer" \
-DCMAKE_BUILD_TYPE="$BUILD_CONFIG" \
-DCMAKE_MACOSX_RPATH=ON \
-DCMAKE_INSTALL_RPATH="${DEPS}/usr/local" \
-DCMAKE_MACOSX_BUNDLE=ON \
-DCMAKE_OSX_ARCHITECTURES="${_ARCH}" \
-DCMAKE_OSX_DEPLOYMENT_TARGET="${OSX_DEPLOYMENT_TARGET}"
fi
cmake --build . --config "$BUILD_CONFIG" --target "$SLICER_BUILD_TARGET"
)
echo "Verify localization with gettext..."
(
cd "$PROJECT_DIR"
./run_gettext.sh
)
echo "Fix macOS app package..."
(
cd "$PROJECT_BUILD_DIR"
mkdir -p OrcaSlicer
cd OrcaSlicer
# remove previously built app
rm -rf ./OrcaSlicer.app
# fully copy newly built app
cp -pR "../src$BUILD_DIR_CONFIG_SUBDIR/OrcaSlicer.app" ./OrcaSlicer.app
# fix resources
resources_path=$(readlink ./OrcaSlicer.app/Contents/Resources)
rm ./OrcaSlicer.app/Contents/Resources
cp -R "$resources_path" ./OrcaSlicer.app/Contents/Resources
# delete .DS_Store file
find ./OrcaSlicer.app/ -name '.DS_Store' -delete
# Copy OrcaSlicer_profile_validator.app if it exists
if [ -f "../src$BUILD_DIR_CONFIG_SUBDIR/OrcaSlicer_profile_validator.app/Contents/MacOS/OrcaSlicer_profile_validator" ]; then
echo "Copying OrcaSlicer_profile_validator.app..."
rm -rf ./OrcaSlicer_profile_validator.app
cp -pR "../src$BUILD_DIR_CONFIG_SUBDIR/OrcaSlicer_profile_validator.app" ./OrcaSlicer_profile_validator.app
# delete .DS_Store file
find ./OrcaSlicer_profile_validator.app/ -name '.DS_Store' -delete
fi
)
# extract version
# export ver=$(grep '^#define SoftFever_VERSION' ../src/libslic3r/libslic3r_version.h | cut -d ' ' -f3)
# ver="_V${ver//\"}"
# echo $PWD
# if [ "1." != "$NIGHTLY_BUILD". ];
# then
# ver=${ver}_dev
# fi
# zip -FSr OrcaSlicer${ver}_Mac_${_ARCH}.zip OrcaSlicer.app
WD="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd $WD/deps
mkdir -p build_$ARCH
cd build_$ARCH
DEPS=$PWD/OrcaSlicer_dep_$ARCH
mkdir -p $DEPS
if [ "slicer." != $BUILD_TARGET. ];
then
echo "building deps..."
echo "cmake ../ -DDESTDIR=$DEPS -DOPENSSL_ARCH=darwin64-${ARCH}-cc -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES:STRING=${ARCH} -DCMAKE_OSX_DEPLOYMENT_TARGET=${OSX_DEPLOYMENT_TARGET}"
cmake ../ -DDESTDIR="$DEPS" -DOPENSSL_ARCH="darwin64-${ARCH}-cc" -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES:STRING=${ARCH} -DCMAKE_OSX_DEPLOYMENT_TARGET=${OSX_DEPLOYMENT_TARGET}
cmake --build . --config Release --target deps
if [ "1." == "$PACK_DEPS". ];
then
tar -zcvf OrcaSlicer_dep_mac_${ARCH}_$(date +"%Y%m%d").tar.gz OrcaSlicer_dep_$ARCH
fi fi
done
}
function build_universal() {
echo "Building universal binary..."
PROJECT_BUILD_DIR="$PROJECT_DIR/build/$ARCH"
# Create universal binary
echo "Creating universal binary..."
# PROJECT_BUILD_DIR="$PROJECT_DIR/build_Universal"
mkdir -p "$PROJECT_BUILD_DIR/OrcaSlicer"
UNIVERSAL_APP="$PROJECT_BUILD_DIR/OrcaSlicer/OrcaSlicer.app"
rm -rf "$UNIVERSAL_APP"
cp -R "$PROJECT_DIR/build/arm64/OrcaSlicer/OrcaSlicer.app" "$UNIVERSAL_APP"
# Get the binary path inside the .app bundle
BINARY_PATH="Contents/MacOS/OrcaSlicer"
# Create universal binary using lipo
lipo -create \
"$PROJECT_DIR/build/x86_64/OrcaSlicer/OrcaSlicer.app/$BINARY_PATH" \
"$PROJECT_DIR/build/arm64/OrcaSlicer/OrcaSlicer.app/$BINARY_PATH" \
-output "$UNIVERSAL_APP/$BINARY_PATH"
echo "Universal binary created at $UNIVERSAL_APP"
# Create universal binary for profile validator if it exists
if [ -f "$PROJECT_DIR/build/arm64/OrcaSlicer/OrcaSlicer_profile_validator.app/Contents/MacOS/OrcaSlicer_profile_validator" ] && \
[ -f "$PROJECT_DIR/build/x86_64/OrcaSlicer/OrcaSlicer_profile_validator.app/Contents/MacOS/OrcaSlicer_profile_validator" ]; then
echo "Creating universal binary for OrcaSlicer_profile_validator..."
UNIVERSAL_VALIDATOR_APP="$PROJECT_BUILD_DIR/OrcaSlicer/OrcaSlicer_profile_validator.app"
rm -rf "$UNIVERSAL_VALIDATOR_APP"
cp -R "$PROJECT_DIR/build/arm64/OrcaSlicer/OrcaSlicer_profile_validator.app" "$UNIVERSAL_VALIDATOR_APP"
# Get the binary path inside the profile validator .app bundle
VALIDATOR_BINARY_PATH="Contents/MacOS/OrcaSlicer_profile_validator"
# Create universal binary using lipo
lipo -create \
"$PROJECT_DIR/build/x86_64/OrcaSlicer/OrcaSlicer_profile_validator.app/$VALIDATOR_BINARY_PATH" \
"$PROJECT_DIR/build/arm64/OrcaSlicer/OrcaSlicer_profile_validator.app/$VALIDATOR_BINARY_PATH" \
-output "$UNIVERSAL_VALIDATOR_APP/$VALIDATOR_BINARY_PATH"
echo "Universal binary for OrcaSlicer_profile_validator created at $UNIVERSAL_VALIDATOR_APP"
fi
}
case "${BUILD_TARGET}" in
all)
build_deps
build_slicer
;;
deps)
build_deps
;;
slicer)
build_slicer
;;
*)
echo "Unknown target: $BUILD_TARGET. Available targets: deps, slicer, all."
exit 1
;;
esac
if [ "$ARCH" = "universal" ] && [ "$BUILD_TARGET" != "deps" ]; then
build_universal
fi fi
if [ "1." == "$PACK_DEPS". ]; then
pack_deps if [ "deps." == "$BUILD_TARGET". ];
then
exit 0
fi fi
cd $WD
mkdir -p build_$ARCH
cd build_$ARCH
echo "building slicer..."
cmake .. -GXcode -DBBL_RELEASE_TO_PUBLIC=1 -DCMAKE_PREFIX_PATH="$DEPS/usr/local" -DCMAKE_INSTALL_PREFIX="$PWD/OrcaSlicer" -DCMAKE_BUILD_TYPE=Release -DCMAKE_MACOSX_RPATH=ON -DCMAKE_INSTALL_RPATH="$DEPS/usr/local" -DCMAKE_MACOSX_BUNDLE=ON -DCMAKE_OSX_ARCHITECTURES=${ARCH} -DCMAKE_OSX_DEPLOYMENT_TARGET=${OSX_DEPLOYMENT_TARGET}
cmake --build . --config Release --target ALL_BUILD
cd ..
./run_gettext.sh
cd build_$ARCH
mkdir -p OrcaSlicer
cd OrcaSlicer
rm -r ./OrcaSlicer.app
cp -pR ../src/Release/OrcaSlicer.app ./OrcaSlicer.app
resources_path=$(readlink ./OrcaSlicer.app/Contents/Resources)
rm ./OrcaSlicer.app/Contents/Resources
cp -R $resources_path ./OrcaSlicer.app/Contents/Resources
# delete .DS_Store file
find ./OrcaSlicer.app/ -name '.DS_Store' -delete
# extract version
# export ver=$(grep '^#define SoftFever_VERSION' ../src/libslic3r/libslic3r_version.h | cut -d ' ' -f3)
# ver="_V${ver//\"}"
# echo $PWD
# if [ "1." != "$NIGHTLY_BUILD". ];
# then
# ver=${ver}_dev
# fi
# zip -FSr OrcaSlicer${ver}_Mac_${ARCH}.zip OrcaSlicer.app

View File

@@ -1,4 +1,4 @@
@REM OrcaSlicer build script for Windows @REM OcarSlicer build script for Windows
@echo off @echo off
set WP=%CD% set WP=%CD%
@@ -13,30 +13,10 @@ if "%1"=="pack" (
exit /b 0 exit /b 0
) )
set debug=OFF
set debuginfo=OFF
if "%1"=="debug" set debug=ON
if "%2"=="debug" set debug=ON
if "%1"=="debuginfo" set debuginfo=ON
if "%2"=="debuginfo" set debuginfo=ON
if "%debug%"=="ON" (
set build_type=Debug
set build_dir=build-dbg
) else (
if "%debuginfo%"=="ON" (
set build_type=RelWithDebInfo
set build_dir=build-dbginfo
) else (
set build_type=Release
set build_dir=build
)
)
echo build type set to %build_type%
setlocal DISABLEDELAYEDEXPANSION setlocal DISABLEDELAYEDEXPANSION
cd deps cd deps
mkdir %build_dir% mkdir build
cd %build_dir% cd build
set DEPS=%CD%/OrcaSlicer_dep set DEPS=%CD%/OrcaSlicer_dep
if "%1"=="slicer" ( if "%1"=="slicer" (
@@ -44,24 +24,22 @@ if "%1"=="slicer" (
) )
echo "building deps.." echo "building deps.."
echo on
cmake ../ -G "Visual Studio 17 2022" -A x64 -DDESTDIR="%DEPS%" -DCMAKE_BUILD_TYPE=%build_type% -DDEP_DEBUG=%debug% -DORCA_INCLUDE_DEBUG_INFO=%debuginfo% cmake ../ -G "Visual Studio 17 2022" -A x64 -DDESTDIR="%CD%/OrcaSlicer_dep" -DCMAKE_BUILD_TYPE=Release
cmake --build . --config %build_type% --target deps -- -m cmake --build . --config Release --target deps -- -m
@echo off
if "%1"=="deps" exit /b 0 if "%1"=="deps" exit /b 0
:slicer :slicer
echo "building Orca Slicer..." echo "building Orca Slicer..."
cd %WP% cd %WP%
mkdir %build_dir% mkdir build
cd %build_dir% cd build
echo on echo cmake .. -G "Visual Studio 17 2022" -A x64 -DBBL_RELEASE_TO_PUBLIC=1 -DCMAKE_PREFIX_PATH="%DEPS%/usr/local" -DCMAKE_INSTALL_PREFIX="./OrcaSlicer" -DCMAKE_BUILD_TYPE=Release
cmake .. -G "Visual Studio 17 2022" -A x64 -DBBL_RELEASE_TO_PUBLIC=1 -DORCA_TOOLS=ON -DCMAKE_PREFIX_PATH="%DEPS%/usr/local" -DCMAKE_INSTALL_PREFIX="./OrcaSlicer" -DCMAKE_BUILD_TYPE=%build_type% -DWIN10SDK_PATH="%WindowsSdkDir%Include\%WindowsSDKVersion%\" cmake .. -G "Visual Studio 17 2022" -A x64 -DBBL_RELEASE_TO_PUBLIC=1 -DCMAKE_PREFIX_PATH="%DEPS%/usr/local" -DCMAKE_INSTALL_PREFIX="./OrcaSlicer" -DCMAKE_BUILD_TYPE=Release -DWIN10SDK_PATH="C:/Program Files (x86)/Windows Kits/10/Include/10.0.22000.0"
cmake --build . --config %build_type% --target ALL_BUILD -- -m cmake --build . --config Release --target ALL_BUILD -- -m
@echo off
cd .. cd ..
call run_gettext.bat call run_gettext.bat
cd %build_dir% cd build
cmake --build . --target install --config %build_type% cmake --build . --target install --config Release

View File

@@ -1,15 +0,0 @@
find_path(LIBNOISE_INCLUDE_DIR libnoise/noise.h)
find_library(LIBNOISE_LIBRARY NAMES libnoise libnoise_static liblibnoise_static)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(libnoise DEFAULT_MSG
LIBNOISE_LIBRARY
LIBNOISE_INCLUDE_DIR
)
if(libnoise_FOUND)
add_library(noise::noise STATIC IMPORTED)
set_target_properties(noise::noise PROPERTIES
IMPORTED_LOCATION "${LIBNOISE_LIBRARY}"
INTERFACE_INCLUDE_DIRECTORIES "${LIBNOISE_INCLUDE_DIR}"
)
endif()

View File

@@ -26,19 +26,6 @@
<string>????</string> <string>????</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>${MACOSX_BUNDLE_BUNDLE_VERSION}</string> <string>${MACOSX_BUNDLE_BUNDLE_VERSION}</string>
<key>ATSApplicationFontsPath</key>
<string>fonts/</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
<key>CFBundleURLName</key>
<string>OrcaSlicer Downloads</string>
<key>CFBundleURLSchemes</key>
<array>
<string>orcaslicer</string>
</array>
</dict>
</array>
<key>CFBundleDocumentTypes</key> <key>CFBundleDocumentTypes</key>
<array> <array>
<dict> <dict>
@@ -48,7 +35,7 @@
<string>STL</string> <string>STL</string>
</array> </array>
<key>CFBundleTypeIconFile</key> <key>CFBundleTypeIconFile</key>
<string>images/stl.icns</string> <string>stl.icns</string>
<key>CFBundleTypeName</key> <key>CFBundleTypeName</key>
<string>STL</string> <string>STL</string>
<key>CFBundleTypeRole</key> <key>CFBundleTypeRole</key>
@@ -65,7 +52,7 @@
<string>OBJ</string> <string>OBJ</string>
</array> </array>
<key>CFBundleTypeIconFile</key> <key>CFBundleTypeIconFile</key>
<string>images/OrcaSlicer.icns</string> <string>OrcaSlicer.icns</string>
<key>CFBundleTypeName</key> <key>CFBundleTypeName</key>
<string>STL</string> <string>STL</string>
<key>CFBundleTypeRole</key> <key>CFBundleTypeRole</key>
@@ -82,7 +69,7 @@
<string>AMF</string> <string>AMF</string>
</array> </array>
<key>CFBundleTypeIconFile</key> <key>CFBundleTypeIconFile</key>
<string>images/OrcaSlicer.icns</string> <string>OrcaSlicer.icns</string>
<key>CFBundleTypeName</key> <key>CFBundleTypeName</key>
<string>AMF</string> <string>AMF</string>
<key>CFBundleTypeRole</key> <key>CFBundleTypeRole</key>
@@ -99,7 +86,7 @@
<string>3MF</string> <string>3MF</string>
</array> </array>
<key>CFBundleTypeIconFile</key> <key>CFBundleTypeIconFile</key>
<string>images/OrcaSlicer.icns</string> <string>OrcaSlicer.icns</string>
<key>CFBundleTypeName</key> <key>CFBundleTypeName</key>
<string>3MF</string> <string>3MF</string>
<key>CFBundleTypeRole</key> <key>CFBundleTypeRole</key>
@@ -116,7 +103,7 @@
<string>GCODE</string> <string>GCODE</string>
</array> </array>
<key>CFBundleTypeIconFile</key> <key>CFBundleTypeIconFile</key>
<string>images/gcode.icns</string> <string>gcode.icns</string>
<key>CFBundleTypeName</key> <key>CFBundleTypeName</key>
<string>GCODE</string> <string>GCODE</string>
<key>CFBundleTypeRole</key> <key>CFBundleTypeRole</key>

View File

@@ -1,59 +0,0 @@
--- a/BGL/include/CGAL/boost/graph/iterator.h 2022-10-07 19:04:41 UTC
+++ b/BGL/include/CGAL/boost/graph/iterator.h
@@ -213,18 +213,7 @@ class Halfedge_around_source_iterator { (public)
{}
#ifndef DOXYGEN_RUNNING
- // design patter: "safe bool"
- // will be replaced by explicit operator bool with C++11
- typedef void (Halfedge_around_source_iterator::*bool_type)() const;
- void this_type_does_not_support_comparisons() const {}
-
- operator bool_type() const
- {
- return (! (this->base() == nullptr)) ?
- &Halfedge_around_source_iterator::this_type_does_not_support_comparisons : 0;
- }
-
bool operator==( const Self& i) const {
CGAL_assertion( anchor == anchor);
return ( g == i.g) && ( pos == i.pos) && ( winding == i.winding);
@@ -313,18 +302,7 @@ class Halfedge_around_target_iterator { (public)
{}
#ifndef DOXYGEN_RUNNING
- // design patter: "safe bool"
- // will be replaced by explicit operator bool with C++11
- typedef void (Halfedge_around_target_iterator::*bool_type)() const;
- void this_type_does_not_support_comparisons() const {}
-
- operator bool_type() const
- {
- return (! (this->base() == nullptr)) ?
- &Halfedge_around_target_iterator::this_type_does_not_support_comparisons : 0;
- }
-
bool operator==( const Self& i) const {
CGAL_assertion( anchor == anchor);
return ( g == i.g) && ( pos == i.pos) && ( winding == i.winding);
@@ -411,18 +389,6 @@ class Halfedge_around_face_iterator { (public)
const value_type& operator * ( ) const { return pos; }
pointer operator -> ( ) { return &pos; }
const value_type* operator -> ( ) const { return &pos; }
-
- // design patter: "safe bool"
- // will be replaced by explicit operator bool with C++11
- typedef void (Halfedge_around_face_iterator::*bool_type)() const;
-
- void this_type_does_not_support_comparisons() const {}
-
- operator bool_type() const
- {
- return (! (this->base() == nullptr)) ?
- &Halfedge_around_face_iterator::this_type_does_not_support_comparisons : 0;
- }
bool operator==( const Self& i) const {
CGAL_assertion( anchor == anchor);

View File

@@ -1,7 +1,3 @@
if (IN_GIT_REPO)
set(CGAL_DIRECTORY_FLAG --directory ${BINARY_DIR_REL}/dep_CGAL-prefix/src/dep_CGAL)
endif ()
orcaslicer_add_cmake_project( orcaslicer_add_cmake_project(
CGAL CGAL
# GIT_REPOSITORY https://github.com/CGAL/cgal.git # GIT_REPOSITORY https://github.com/CGAL/cgal.git
@@ -9,7 +5,6 @@ orcaslicer_add_cmake_project(
# For whatever reason, this keeps downloading forever (repeats downloads if finished) # For whatever reason, this keeps downloading forever (repeats downloads if finished)
URL https://github.com/CGAL/cgal/archive/refs/tags/v5.4.zip URL https://github.com/CGAL/cgal/archive/refs/tags/v5.4.zip
URL_HASH SHA256=d7605e0a5a5ca17da7547592f6f6e4a59430a0bc861948974254d0de43eab4c0 URL_HASH SHA256=d7605e0a5a5ca17da7547592f6f6e4a59430a0bc861948974254d0de43eab4c0
PATCH_COMMAND git apply ${CGAL_DIRECTORY_FLAG} --verbose --ignore-space-change --whitespace=fix ${CMAKE_CURRENT_LIST_DIR}/0001-clang19.patch
DEPENDS dep_Boost dep_GMP dep_MPFR DEPENDS dep_Boost dep_GMP dep_MPFR
) )

171
deps/CMakeLists.txt vendored
View File

@@ -30,10 +30,6 @@ if (APPLE)
endif () endif ()
if(POLICY CMP0135) # DOWNLOAD_EXTRACT_TIMESTAMP
cmake_policy(SET CMP0135 NEW)
endif()
project(OrcaSlicer-deps) project(OrcaSlicer-deps)
include(ExternalProject) include(ExternalProject)
@@ -45,21 +41,16 @@ if (NPROC EQUAL 0)
endif () endif ()
set(DESTDIR "${CMAKE_CURRENT_BINARY_DIR}/destdir" CACHE PATH "Destination directory") set(DESTDIR "${CMAKE_CURRENT_BINARY_DIR}/destdir" CACHE PATH "Destination directory")
set(DEP_DOWNLOAD_DIR ${CMAKE_CURRENT_SOURCE_DIR}/DL_CACHE CACHE PATH "Path for downloaded source packages.") set(DEP_DOWNLOAD_DIR ${CMAKE_CURRENT_BINARY_DIR}/../DL_CACHE CACHE PATH "Path for downloaded source packages.")
set(FLATPAK FALSE CACHE BOOL "Toggles various build settings for flatpak, like /usr/local in DESTDIR or not building wxwidgets")
if (NOT FLATPAK)
set(DESTDIR "${DESTDIR}/usr/local/")
endif()
get_property(_is_multi GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG) option(DEP_DEBUG "Build debug variants (only applicable on Windows)" OFF)
if (_is_multi)
option(DEP_DEBUG "Build debug variants (only applicable on Windows)" OFF)
option(ORCA_INCLUDE_DEBUG_INFO "Includes debug information in a release build (like RelWithDebInfo) in a way that works with multi-configuration generators and incompatible dependencies. DEP_DEBUG option takes priority over this." OFF)
endif ()
if(CMAKE_SYSTEM_NAME STREQUAL "Linux") if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
option(DEP_WX_GTK3 "Build wxWidgets against GTK3" OFF) option(DEP_WX_GTK3 "Build wxWidgets against GTK3" OFF)
else()
if(POLICY CMP0135) # DOWNLOAD_EXTRACT_TIMESTAMP
cmake_policy(SET CMP0135 NEW)
endif()
endif() endif()
set(IS_CROSS_COMPILE FALSE) set(IS_CROSS_COMPILE FALSE)
@@ -88,7 +79,7 @@ endif ()
# option(DEP_BUILD_IGL_STATIC "Build IGL as a static library. Might cause link errors and increase binary size." OFF) # option(DEP_BUILD_IGL_STATIC "Build IGL as a static library. Might cause link errors and increase binary size." OFF)
message(STATUS "OrcaSlicer deps DESTDIR: ${DESTDIR}") message(STATUS "OrcaSlicer deps DESTDIR: ${DESTDIR}")
message(STATUS "OrcaSlicer download dir for source packages: ${DEP_DOWNLOAD_DIR}") message(STATUS "OrcaSlicer dowload dir for source packages: ${DEP_DOWNLOAD_DIR}")
message(STATUS "OrcaSlicer deps debug build: ${DEP_DEBUG}") message(STATUS "OrcaSlicer deps debug build: ${DEP_DEBUG}")
find_package(Git REQUIRED) find_package(Git REQUIRED)
@@ -96,6 +87,8 @@ find_package(Git REQUIRED)
# The default command line for patching. Only works for newer # The default command line for patching. Only works for newer
set(PATCH_CMD ${GIT_EXECUTABLE} apply --verbose --ignore-space-change --whitespace=fix) set(PATCH_CMD ${GIT_EXECUTABLE} apply --verbose --ignore-space-change --whitespace=fix)
get_property(_is_multi GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
if (NOT _is_multi AND NOT CMAKE_BUILD_TYPE) if (NOT _is_multi AND NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release) set(CMAKE_BUILD_TYPE Release)
message(STATUS "Forcing CMAKE_BUILD_TYPE to Release as it was not specified.") message(STATUS "Forcing CMAKE_BUILD_TYPE to Release as it was not specified.")
@@ -106,11 +99,7 @@ function(orcaslicer_add_cmake_project projectname)
set(_configs_line -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE}) set(_configs_line -DCMAKE_BUILD_TYPE:STRING=${CMAKE_BUILD_TYPE})
if (_is_multi OR MSVC) if (_is_multi OR MSVC)
if (ORCA_INCLUDE_DEBUG_INFO AND NOT DEP_DEBUG) set(_configs_line "")
set(_configs_line "-DCMAKE_C_FLAGS_RELEASE:STRING=${CMAKE_C_FLAGS_RELWITHDEBINFO} -DCMAKE_CXX_FLAGS_RELEASE:STRING=${CMAKE_CXX_FLAGS_RELWITHDEBINFO}")
else ()
set(_configs_line "")
endif ()
endif () endif ()
set(_gen "") set(_gen "")
@@ -124,13 +113,13 @@ if (NOT IS_CROSS_COMPILE OR NOT APPLE)
ExternalProject_Add( ExternalProject_Add(
dep_${projectname} dep_${projectname}
EXCLUDE_FROM_ALL ON EXCLUDE_FROM_ALL ON
INSTALL_DIR ${DESTDIR} INSTALL_DIR ${DESTDIR}/usr/local
DOWNLOAD_DIR ${DEP_DOWNLOAD_DIR}/${projectname} DOWNLOAD_DIR ${DEP_DOWNLOAD_DIR}/${projectname}
${_gen} ${_gen}
CMAKE_ARGS CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX:STRING=${DESTDIR} -DCMAKE_INSTALL_PREFIX:STRING=${DESTDIR}/usr/local
-DCMAKE_MODULE_PATH:STRING=${PROJECT_SOURCE_DIR}/../cmake/modules -DCMAKE_MODULE_PATH:STRING=${PROJECT_SOURCE_DIR}/../cmake/modules
-DCMAKE_PREFIX_PATH:STRING=${DESTDIR} -DCMAKE_PREFIX_PATH:STRING=${DESTDIR}/usr/local
-DCMAKE_DEBUG_POSTFIX:STRING=d -DCMAKE_DEBUG_POSTFIX:STRING=d
-DCMAKE_C_COMPILER:STRING=${CMAKE_C_COMPILER} -DCMAKE_C_COMPILER:STRING=${CMAKE_C_COMPILER}
-DCMAKE_CXX_COMPILER:STRING=${CMAKE_CXX_COMPILER} -DCMAKE_CXX_COMPILER:STRING=${CMAKE_CXX_COMPILER}
@@ -144,49 +133,16 @@ if (NOT IS_CROSS_COMPILE OR NOT APPLE)
BUILD_COMMAND ${CMAKE_COMMAND} --build . --config Release -- ${_build_j} BUILD_COMMAND ${CMAKE_COMMAND} --build . --config Release -- ${_build_j}
INSTALL_COMMAND ${CMAKE_COMMAND} --build . --target install --config Release INSTALL_COMMAND ${CMAKE_COMMAND} --build . --target install --config Release
) )
elseif(FLATPAK)
# the only reason this is here is because of the HACK at the bottom for ci
#
# note for future devs: shared libs may actually create a size reduction
# but orcaslicer_deps tends to get really funny regarding linking after that (notably boost)
# so, as much as I would like to use that, it's not happening
ExternalProject_Add(
dep_${projectname}
EXCLUDE_FROM_ALL ON
INSTALL_DIR ${DESTDIR}
DOWNLOAD_DIR ${DEP_DOWNLOAD_DIR}/${projectname}
${_gen}
CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX:STRING=${DESTDIR}
-DCMAKE_MODULE_PATH:STRING=${PROJECT_SOURCE_DIR}/../cmake/modules
-DCMAKE_PREFIX_PATH:STRING=${DESTDIR}
-DCMAKE_DEBUG_POSTFIX:STRING=d
-DCMAKE_C_COMPILER:STRING=${CMAKE_C_COMPILER}
-DCMAKE_CXX_COMPILER:STRING=${CMAKE_CXX_COMPILER}
-DCMAKE_TOOLCHAIN_FILE:STRING=${CMAKE_TOOLCHAIN_FILE}
-DBUILD_SHARED_LIBS:BOOL=OFF
${_cmake_osx_arch}
"${_configs_line}"
${DEP_CMAKE_OPTS}
${P_ARGS_CMAKE_ARGS}
${P_ARGS_UNPARSED_ARGUMENTS}
BUILD_COMMAND ${CMAKE_COMMAND} --build . --config Release -- ${_build_j}
INSTALL_COMMAND ${CMAKE_COMMAND} --build . --target install --config Release
# HACK: save space after each compile job, because CI
# reasoning: cmake changes directory after this command, so just keep only the folders
# so that it can navigate out
COMMAND find "${CMAKE_BINARY_DIR}/dep_${projectname}-prefix/" -type f -delete
)
else() else()
ExternalProject_Add( ExternalProject_Add(
dep_${projectname} dep_${projectname}
EXCLUDE_FROM_ALL ON EXCLUDE_FROM_ALL ON
INSTALL_DIR ${DESTDIR} INSTALL_DIR ${DESTDIR}/usr/local
DOWNLOAD_DIR ${DEP_DOWNLOAD_DIR}/${projectname} DOWNLOAD_DIR ${DEP_DOWNLOAD_DIR}/${projectname}
${_gen} ${_gen}
CMAKE_ARGS CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX:STRING=${DESTDIR} -DCMAKE_INSTALL_PREFIX:STRING=${DESTDIR}/usr/local
-DCMAKE_PREFIX_PATH:STRING=${DESTDIR} -DCMAKE_PREFIX_PATH:STRING=${DESTDIR}/usr/local
-DBUILD_SHARED_LIBS:BOOL=OFF -DBUILD_SHARED_LIBS:BOOL=OFF
${_cmake_osx_arch} ${_cmake_osx_arch}
"${_configs_line}" "${_configs_line}"
@@ -194,7 +150,7 @@ else()
${P_ARGS_CMAKE_ARGS} ${P_ARGS_CMAKE_ARGS}
${P_ARGS_UNPARSED_ARGUMENTS} ${P_ARGS_UNPARSED_ARGUMENTS}
BUILD_COMMAND ${CMAKE_COMMAND} --build . --config Release -- ${_build_j} BUILD_COMMAND ${CMAKE_COMMAND} --build . --config Release -- ${_build_j}
INSTALL_COMMAND ${CMAKE_COMMAND} --build . --target install --config Release INSTALL_COMMAND ${CMAKE_COMMAND} --build . --target install --config Release
) )
endif() endif()
@@ -203,13 +159,13 @@ endfunction(orcaslicer_add_cmake_project)
if (MSVC) if (MSVC)
if ("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "AMD64") if ("${CMAKE_SIZEOF_VOID_P}" STREQUAL "8")
message(STATUS "\nDetected X64 compiler => building X64 deps bundle\n") message(STATUS "\nDetected 64-bit compiler => building 64-bit deps bundle\n")
set(DEPS_ARCH "x64") set(DEPS_BITS 64)
include("deps-windows.cmake") include("deps-windows.cmake")
elseif ("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "X86") elseif ("${CMAKE_SIZEOF_VOID_P}" STREQUAL "4")
message(STATUS "\nDetected X86 compiler => building X86 deps bundle\n") message(STATUS "\nDetected 32-bit compiler => building 32-bit deps bundle\n")
set(DEPS_ARCH "x86") set(DEPS_BITS 32)
include("deps-windows.cmake") include("deps-windows.cmake")
else () else ()
message(FATAL_ERROR "Unable to detect architecture") message(FATAL_ERROR "Unable to detect architecture")
@@ -240,19 +196,6 @@ else()
include("deps-linux.cmake") include("deps-linux.cmake")
endif() endif()
if(FLATPAK)
# flatpak bundles some deps with the layer, so attempt to find them first
# also, yes, this reduces CI by not needing to vendor certain deps
find_package(ZLIB)
find_package(PNG)
find_package(EXPAT)
find_package(CURL)
find_package(JPEG)
find_package(Freetype)
find_package(OpenSSL 1.1...<3.2)
find_package(CURL)
endif()
set(ZLIB_PKG "") set(ZLIB_PKG "")
if (NOT ZLIB_FOUND) if (NOT ZLIB_FOUND)
include(ZLIB/ZLIB.cmake) include(ZLIB/ZLIB.cmake)
@@ -264,7 +207,6 @@ if (NOT PNG_FOUND)
set(PNG_PKG dep_PNG) set(PNG_PKG dep_PNG)
endif () endif ()
set(EXPAT_PKG "") set(EXPAT_PKG "")
find_package(EXPAT)
if (NOT EXPAT_FOUND) if (NOT EXPAT_FOUND)
include(EXPAT/EXPAT.cmake) include(EXPAT/EXPAT.cmake)
set(EXPAT_PKG dep_EXPAT) set(EXPAT_PKG dep_EXPAT)
@@ -277,7 +219,6 @@ include(Boost/Boost.cmake)
include(Cereal/Cereal.cmake) include(Cereal/Cereal.cmake)
include(Qhull/Qhull.cmake) include(Qhull/Qhull.cmake)
include(GLEW/GLEW.cmake) include(GLEW/GLEW.cmake)
include(GLFW/GLFW.cmake) include(GLFW/GLFW.cmake)
include(OpenCSG/OpenCSG.cmake) include(OpenCSG/OpenCSG.cmake)
@@ -292,83 +233,36 @@ include(MPFR/MPFR.cmake)
include(CGAL/CGAL.cmake) include(CGAL/CGAL.cmake)
include(NLopt/NLopt.cmake) include(NLopt/NLopt.cmake)
include(libnoise/libnoise.cmake)
include(OpenSSL/OpenSSL.cmake)
# I *think* 1.1 is used for *just* md5 hashing?
# 3.1 has everything in the right place, but the md5 funcs used are deprecated
# a grep across the repo shows it is used for other things
# TODO: update openssl and everything that uses <openssl/md5.h>
set(OPENSSL_PKG "")
if(NOT OPENSSL_FOUND)
include(OpenSSL/OpenSSL.cmake)
set(OPENSSL_PKG dep_OpenSSL)
endif()
# we don't want to load a "wrong" openssl when loading curl
# so, just don't even bother
# ...i think this is how it works? change if wrong
set(CURL_PKG "") set(CURL_PKG "")
if (NOT OPENSSL_FOUND OR NOT CURL_FOUND) if (NOT CURL_FOUND)
include(CURL/CURL.cmake) include(CURL/CURL.cmake)
set(CURL_PKG dep_CURL) set(CURL_PKG dep_CURL)
endif () endif ()
set(JPEG_PKG "") include(JPEG/JPEG.cmake)
if (NOT JPEG_FOUND) include(TIFF/TIFF.cmake)
include(JPEG/JPEG.cmake) include(wxWidgets/wxWidgets.cmake)
set(JPEG_PKG dep_JPEG)
endif()
# flatpak builds wxwidgets separately
set(WXWIDGETS_PKG "")
if (NOT FLATPAK)
include(wxWidgets/wxWidgets.cmake)
set(WXWIDGETS_PKG "dep_wxWidgets")
endif()
set(FREETYPE_PKG "")
if(NOT FREETYPE_FOUND)
include(FREETYPE/FREETYPE.cmake)
set(FREETYPE_PKG "dep_FREETYPE")
endif()
execute_process(
COMMAND ${GIT_EXECUTABLE} rev-parse --is-inside-work-tree
RESULT_VARIABLE REV_PARSE_RESULT
OUTPUT_VARIABLE REV_PARSE_OUTPUT
OUTPUT_STRIP_TRAILING_WHITESPACE
)
# Will output "true" and have a 0 return code if within a git repo
if((REV_PARSE_RESULT EQUAL 0) AND (REV_PARSE_OUTPUT STREQUAL "true"))
set(IN_GIT_REPO TRUE)
# Find relative path from root to source used for adjusting patch command
file(RELATIVE_PATH BINARY_DIR_REL ${CMAKE_SOURCE_DIR}/.. ${CMAKE_BINARY_DIR})
endif ()
include(OCCT/OCCT.cmake) include(OCCT/OCCT.cmake)
include(OpenCV/OpenCV.cmake) include(FREETYPE/FREETYPE.cmake)
set(_dep_list set(_dep_list
dep_Boost dep_Boost
dep_TBB dep_TBB
${OPENSSL_PKG}
${CURL_PKG} ${CURL_PKG}
${WXWIDGETS_PKG} dep_wxWidgets
dep_Cereal dep_Cereal
dep_NLopt dep_NLopt
dep_OpenVDB dep_OpenVDB
dep_OpenCSG dep_OpenCSG
dep_OpenCV
dep_CGAL dep_CGAL
dep_OpenSSL
dep_GLFW dep_GLFW
dep_OCCT
${FREETYPE_PKG}
${PNG_PKG} ${PNG_PKG}
${ZLIB_PKG} ${ZLIB_PKG}
${EXPAT_PKG} ${EXPAT_PKG}
dep_libnoise
) )
if (MSVC) if (MSVC)
@@ -380,6 +274,9 @@ else()
#list(APPEND _dep_list "dep_libigl") #list(APPEND _dep_list "dep_libigl")
endif() endif()
list(APPEND _dep_list "dep_OCCT")
list(APPEND _dep_list "dep_FREETYPE")
add_custom_target(deps ALL DEPENDS ${_dep_list}) add_custom_target(deps ALL DEPENDS ${_dep_list})
# Note: I'm not using any of the LOG_xxx options in ExternalProject_Add() commands # Note: I'm not using any of the LOG_xxx options in ExternalProject_Add() commands

View File

@@ -72,10 +72,9 @@ orcaslicer_add_cmake_project(CURL
${_curl_platform_flags} ${_curl_platform_flags}
) )
if(NOT OPENSSL_FOUND) # if (APPLE OR (CMAKE_SYSTEM_NAME STREQUAL "Linux"))
# (openssl may or may not be built) add_dependencies(dep_CURL dep_OpenSSL)
add_dependencies(dep_CURL ${OPENSSL_PKG}) # endif ()
endif()
if (MSVC) if (MSVC)
add_debug_dep(dep_CURL) add_debug_dep(dep_CURL)

View File

@@ -11,7 +11,7 @@ else()
endif() endif()
orcaslicer_add_cmake_project(FREETYPE orcaslicer_add_cmake_project(FREETYPE
URL https://github.com/SoftFever/orca_deps/releases/download/freetype-2.12.1.tar.gz/freetype-2.12.1.tar.gz URL https://mirror.ossplanet.net/nongnu/freetype/freetype-2.12.1.tar.gz
URL_HASH SHA256=efe71fd4b8246f1b0b1b9bfca13cfff1c9ad85930340c27df469733bbb620938 URL_HASH SHA256=efe71fd4b8246f1b0b1b9bfca13cfff1c9ad85930340c27df469733bbb620938
#DEPENDS ${ZLIB_PKG} #DEPENDS ${ZLIB_PKG}
#"${_patch_step}" #"${_patch_step}"

View File

@@ -22,6 +22,7 @@ https://github.com/nigels-com/glew
* [Install build tools](#install-build-tools) * [Install build tools](#install-build-tools)
* [Build](#build-1) * [Build](#build-1)
* [Linux EGL](#linux-egl) * [Linux EGL](#linux-egl)
* [Linux OSMesa](#linux-osmesa)
* [Linux mingw-w64](#linux-mingw-w64) * [Linux mingw-w64](#linux-mingw-w64)
* [Using cmake](#using-cmake) * [Using cmake](#using-cmake)
* [Install build tools](#install-build-tools-1) * [Install build tools](#install-build-tools-1)
@@ -94,6 +95,11 @@ _Note: you may need to call `make` in the **auto** folder first_
$ sudo apt install libegl1-mesa-dev $ sudo apt install libegl1-mesa-dev
$ make SYSTEM=linux-egl $ make SYSTEM=linux-egl
##### Linux OSMesa
$ sudo apt install libosmesa-dev
$ make SYSTEM=linux-osmesa
##### Linux mingw-w64 ##### Linux mingw-w64
$ sudo apt install mingw-w64 $ sudo apt install mingw-w64
@@ -134,6 +140,7 @@ RedHat/CentOS/Fedora: `$ sudo yum install libXmu-devel libXi-devel libGL-devel c
| --------------- | ----------- | | --------------- | ----------- |
| BUILD_UTILS | Build the `glewinfo` and `visualinfo` executables. | | BUILD_UTILS | Build the `glewinfo` and `visualinfo` executables. |
| GLEW_REGAL | Build in Regal mode. | | GLEW_REGAL | Build in Regal mode. |
| GLEW_OSMESA | Build in off-screen Mesa mode. |
| BUILD_FRAMEWORK | Build as MacOSX Framework. Setting `CMAKE_INSTALL_PREFIX` to `/Library/Frameworks` is recommended. | | BUILD_FRAMEWORK | Build as MacOSX Framework. Setting `CMAKE_INSTALL_PREFIX` to `/Library/Frameworks` is recommended. |
### Windows ### Windows

View File

@@ -1,32 +0,0 @@
--- GMP/acinclude.m4 2025-05-14 18:50:11.396354745 -0400
+++ GMP/acinclude.m4.2 2025-05-14 18:57:20.757853503 -0400
@@ -609,7 +609,7 @@
#if defined (__GNUC__) && ! defined (__cplusplus)
typedef unsigned long long t1;typedef t1*t2;
-void g(){}
+void g(int,t1 const*,t1,t2,t1 const*,int){}
void h(){}
static __inline__ t1 e(t2 rp,t2 up,int n,t1 v0)
{t1 c,x,r;int i;if(v0){c=1;for(i=1;i<n;i++){x=up[i];r=x+1;rp[i]=r;}}return c;}
--- GMP/configure 2025-05-14 19:33:35.730593315 -0400
+++ GMP/configure 2025-05-14 19:35:37.805619186 -0400
@@ -6526,7 +6526,7 @@
#if defined (__GNUC__) && ! defined (__cplusplus)
typedef unsigned long long t1;typedef t1*t2;
-void g(){}
+void g(int,t1 const*,t1,t2,t1 const*,int){}
void h(){}
static __inline__ t1 e(t2 rp,t2 up,int n,t1 v0)
{t1 c,x,r;int i;if(v0){c=1;for(i=1;i<n;i++){x=up[i];r=x+1;rp[i]=r;}}return c;}
@@ -8145,7 +8145,7 @@
#if defined (__GNUC__) && ! defined (__cplusplus)
typedef unsigned long long t1;typedef t1*t2;
-void g(){}
+void g(int,t1 const*,t1,t2,t1 const*,int){}
void h(){}
static __inline__ t1 e(t2 rp,t2 up,int n,t1 v0)
{t1 c,x,r;int i;if(v0){c=1;for(i=1;i<n;i++){x=up[i];r=x+1;rp[i]=r;}}return c;}

26
deps/GMP/GMP.cmake vendored
View File

@@ -1,22 +1,19 @@
set(_srcdir ${CMAKE_CURRENT_LIST_DIR}/gmp) set(_srcdir ${CMAKE_CURRENT_LIST_DIR}/gmp)
set(_dstdir ${DESTDIR}/usr/local)
if (IN_GIT_REPO)
set(GMP_DIRECTORY_FLAG --directory ${BINARY_DIR_REL}/dep_GMP-prefix/src/dep_GMP)
endif ()
if (MSVC) if (MSVC)
set(_output ${DESTDIR}/include/gmp.h set(_output ${_dstdir}/include/gmp.h
${DESTDIR}/lib/libgmp-10.lib ${_dstdir}/lib/libgmp-10.lib
${DESTDIR}/bin/libgmp-10.dll) ${_dstdir}/bin/libgmp-10.dll)
add_custom_command( add_custom_command(
OUTPUT ${_output} OUTPUT ${_output}
COMMAND ${CMAKE_COMMAND} -E copy ${_srcdir}/include/gmp.h ${DESTDIR}/include/ COMMAND ${CMAKE_COMMAND} -E copy ${_srcdir}/include/gmp.h ${_dstdir}/include/
COMMAND ${CMAKE_COMMAND} -E copy ${_srcdir}/lib/win-${DEPS_ARCH}/libgmp-10.lib ${DESTDIR}/lib/ COMMAND ${CMAKE_COMMAND} -E copy ${_srcdir}/lib/win${DEPS_BITS}/libgmp-10.lib ${_dstdir}/lib/
COMMAND ${CMAKE_COMMAND} -E copy ${_srcdir}/lib/win-${DEPS_ARCH}/libgmp-10.dll ${DESTDIR}/bin/ COMMAND ${CMAKE_COMMAND} -E copy ${_srcdir}/lib/win${DEPS_BITS}/libgmp-10.dll ${_dstdir}/bin/
) )
add_custom_target(dep_GMP SOURCES ${_output}) add_custom_target(dep_GMP SOURCES ${_output})
else () else ()
@@ -63,10 +60,9 @@ else ()
URL https://github.com/SoftFever/OrcaSlicer_deps/releases/download/gmp-6.2.1/gmp-6.2.1.tar.bz2 URL https://github.com/SoftFever/OrcaSlicer_deps/releases/download/gmp-6.2.1/gmp-6.2.1.tar.bz2
URL_HASH SHA256=eae9326beb4158c386e39a356818031bd28f3124cf915f8c5b1dc4c7a36b4d7c URL_HASH SHA256=eae9326beb4158c386e39a356818031bd28f3124cf915f8c5b1dc4c7a36b4d7c
DOWNLOAD_DIR ${DEP_DOWNLOAD_DIR}/GMP DOWNLOAD_DIR ${DEP_DOWNLOAD_DIR}/GMP
PATCH_COMMAND git apply ${GMP_DIRECTORY_FLAG} --verbose ${CMAKE_CURRENT_LIST_DIR}/0001-GMP_GCC15.patch BUILD_IN_SOURCE ON
BUILD_IN_SOURCE ON CONFIGURE_COMMAND env "CFLAGS=${_gmp_ccflags}" "CXXFLAGS=${_gmp_ccflags}" ./configure ${_cross_compile_arg} --enable-shared=no --enable-cxx=yes --enable-static=yes "--prefix=${DESTDIR}/usr/local" ${_gmp_build_tgt}
CONFIGURE_COMMAND env "CFLAGS=${_gmp_ccflags}" "CXXFLAGS=${_gmp_ccflags}" ./configure ${_cross_compile_arg} --enable-shared=no --enable-cxx=yes --enable-static=yes "--prefix=${DESTDIR}" ${_gmp_build_tgt}
BUILD_COMMAND make -j BUILD_COMMAND make -j
INSTALL_COMMAND make install INSTALL_COMMAND make install
) )
endif () endif ()

23
deps/MPFR/MPFR.cmake vendored
View File

@@ -1,17 +1,18 @@
set(_srcdir ${CMAKE_CURRENT_LIST_DIR}/mpfr) set(_srcdir ${CMAKE_CURRENT_LIST_DIR}/mpfr)
set(_dstdir ${DESTDIR}/usr/local)
if (MSVC) if (MSVC)
set(_output ${DESTDIR}/include/mpfr.h set(_output ${_dstdir}/include/mpfr.h
${DESTDIR}/include/mpf2mpfr.h ${_dstdir}/include/mpf2mpfr.h
${DESTDIR}/lib/libmpfr-4.lib ${_dstdir}/lib/libmpfr-4.lib
${DESTDIR}/bin/libmpfr-4.dll) ${_dstdir}/bin/libmpfr-4.dll)
add_custom_command( add_custom_command(
OUTPUT ${_output} OUTPUT ${_output}
COMMAND ${CMAKE_COMMAND} -E copy ${_srcdir}/include/mpfr.h ${DESTDIR}/include/ COMMAND ${CMAKE_COMMAND} -E copy ${_srcdir}/include/mpfr.h ${_dstdir}/include/
COMMAND ${CMAKE_COMMAND} -E copy ${_srcdir}/include/mpf2mpfr.h ${DESTDIR}/include/ COMMAND ${CMAKE_COMMAND} -E copy ${_srcdir}/include/mpf2mpfr.h ${_dstdir}/include/
COMMAND ${CMAKE_COMMAND} -E copy ${_srcdir}/lib/win-${DEPS_ARCH}/libmpfr-4.lib ${DESTDIR}/lib/ COMMAND ${CMAKE_COMMAND} -E copy ${_srcdir}/lib/win${DEPS_BITS}/libmpfr-4.lib ${_dstdir}/lib/
COMMAND ${CMAKE_COMMAND} -E copy ${_srcdir}/lib/win-${DEPS_ARCH}/libmpfr-4.dll ${DESTDIR}/bin/ COMMAND ${CMAKE_COMMAND} -E copy ${_srcdir}/lib/win${DEPS_BITS}/libmpfr-4.dll ${_dstdir}/bin/
) )
add_custom_target(dep_MPFR SOURCES ${_output}) add_custom_target(dep_MPFR SOURCES ${_output})
@@ -25,12 +26,12 @@ else ()
endif () endif ()
ExternalProject_Add(dep_MPFR ExternalProject_Add(dep_MPFR
URL https://www.mpfr.org/mpfr-4.2.2/mpfr-4.2.2.tar.bz2 URL https://www.mpfr.org/mpfr-current/mpfr-4.2.1.tar.bz2
URL_HASH SHA256=9ad62c7dc910303cd384ff8f1f4767a655124980bb6d8650fe62c815a231bb7b URL_HASH SHA256=b9df93635b20e4089c29623b19420c4ac848a1b29df1cfd59f26cab0d2666aa0
DOWNLOAD_DIR ${DEP_DOWNLOAD_DIR}/MPFR DOWNLOAD_DIR ${DEP_DOWNLOAD_DIR}/MPFR
BUILD_IN_SOURCE ON BUILD_IN_SOURCE ON
CONFIGURE_COMMAND autoreconf -f -i && CONFIGURE_COMMAND autoreconf -f -i &&
env "CFLAGS=${_gmp_ccflags}" "CXXFLAGS=${_gmp_ccflags}" ./configure ${_cross_compile_arg} --prefix=${DESTDIR} --enable-shared=no --enable-static=yes --with-gmp=${DESTDIR} ${_gmp_build_tgt} env "CFLAGS=${_gmp_ccflags}" "CXXFLAGS=${_gmp_ccflags}" ./configure ${_cross_compile_arg} --prefix=${DESTDIR}/usr/local --enable-shared=no --enable-static=yes --with-gmp=${DESTDIR}/usr/local ${_gmp_build_tgt}
BUILD_COMMAND make -j BUILD_COMMAND make -j
INSTALL_COMMAND make install INSTALL_COMMAND make install
DEPENDS dep_GMP DEPENDS dep_GMP

View File

@@ -195,27 +195,3 @@ index 5ae9899f..0a17372b 100644
if (!myFTLib->IsValid()) if (!myFTLib->IsValid())
{ {
From 7236e83dcc1e7284e66dc61e612154617ef715d6 Mon Sep 17 00:00:00 2001
From: dpasukhi <dpasukhi@opencascade.com>
Date: Tue, 27 Aug 2024 11:33:29 +0100
Subject: [PATCH] 0033808: Coding - FreeType Use unsigned point and contour
indexing in `FT_Outline`
Changes to auto instead of specific type
---
src/StdPrs/StdPrs_BRepFont.cxx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/StdPrs/StdPrs_BRepFont.cxx b/src/StdPrs/StdPrs_BRepFont.cxx
index ab2d9b3c9f..cd701879b1 100644
--- a/src/StdPrs/StdPrs_BRepFont.cxx
+++ b/src/StdPrs/StdPrs_BRepFont.cxx
@@ -457,7 +457,7 @@ Standard_Boolean StdPrs_BRepFont::renderGlyph (const Standard_Utf32Char theChar,
for (short aContour = 0, aStartIndex = 0; aContour < anOutline->n_contours; ++aContour)
{
const FT_Vector* aPntList = &anOutline->points[aStartIndex];
- const char* aTags = &anOutline->tags[aStartIndex];
+ const auto* aTags = &anOutline->tags[aStartIndex];
const short anEndIndex = anOutline->contours[aContour];
const short aPntsNb = (anEndIndex - aStartIndex) + 1;
aStartIndex = anEndIndex + 1;

13
deps/OCCT/OCCT.cmake vendored
View File

@@ -4,17 +4,17 @@ else()
set(library_build_type "Static") set(library_build_type "Static")
endif() endif()
if (IN_GIT_REPO)
set(OCCT_DIRECTORY_FLAG --directory ${BINARY_DIR_REL}/dep_OCCT-prefix/src/dep_OCCT) # get relative path of CMAKE_BINARY_DIR against root source directory
endif () file(RELATIVE_PATH BINARY_DIR_REL ${CMAKE_SOURCE_DIR}/.. ${CMAKE_BINARY_DIR})
orcaslicer_add_cmake_project(OCCT orcaslicer_add_cmake_project(OCCT
URL https://github.com/Open-Cascade-SAS/OCCT/archive/refs/tags/V7_6_0.zip URL https://github.com/Open-Cascade-SAS/OCCT/archive/refs/tags/V7_6_0.zip
URL_HASH SHA256=28334f0e98f1b1629799783e9b4d21e05349d89e695809d7e6dfa45ea43e1dbc URL_HASH SHA256=28334f0e98f1b1629799783e9b4d21e05349d89e695809d7e6dfa45ea43e1dbc
#PATCH_COMMAND ${PATCH_CMD} ${CMAKE_CURRENT_LIST_DIR}/0001-OCCT-fix.patch #PATCH_COMMAND ${PATCH_CMD} ${CMAKE_CURRENT_LIST_DIR}/0001-OCCT-fix.patch
PATCH_COMMAND git apply ${OCCT_DIRECTORY_FLAG} --verbose --ignore-space-change --whitespace=fix ${CMAKE_CURRENT_LIST_DIR}/0001-OCCT-fix.patch PATCH_COMMAND git apply --directory ${BINARY_DIR_REL}/dep_OCCT-prefix/src/dep_OCCT --verbose --ignore-space-change --whitespace=fix ${CMAKE_CURRENT_LIST_DIR}/0001-OCCT-fix.patch
#DEPENDS dep_Boost #DEPENDS dep_Boost
DEPENDS ${FREETYPE_PKG} #DEPENDS dep_FREETYPE
CMAKE_ARGS CMAKE_ARGS
-DBUILD_LIBRARY_TYPE=${library_build_type} -DBUILD_LIBRARY_TYPE=${library_build_type}
-DUSE_TK=OFF -DUSE_TK=OFF
@@ -22,7 +22,6 @@ orcaslicer_add_cmake_project(OCCT
#-DUSE_FREETYPE=OFF #-DUSE_FREETYPE=OFF
-DUSE_FFMPEG=OFF -DUSE_FFMPEG=OFF
-DUSE_VTK=OFF -DUSE_VTK=OFF
-DBUILD_DOC_Overview=OFF
-DBUILD_MODULE_ApplicationFramework=OFF -DBUILD_MODULE_ApplicationFramework=OFF
#-DBUILD_MODULE_DataExchange=OFF #-DBUILD_MODULE_DataExchange=OFF
-DBUILD_MODULE_Draw=OFF -DBUILD_MODULE_Draw=OFF
@@ -32,4 +31,4 @@ orcaslicer_add_cmake_project(OCCT
-DBUILD_MODULE_Visualization=OFF -DBUILD_MODULE_Visualization=OFF
) )
# add_dependencies(dep_OCCT ${FREETYPE_PKG}) add_dependencies(dep_OCCT dep_FREETYPE)

View File

@@ -1,52 +0,0 @@
From 6fb3f6333150a777e835fc7c48e49750591bf7fe Mon Sep 17 00:00:00 2001
From: Benjamin Buch <bebuch@users.noreply.github.com>
Date: Thu, 23 May 2024 16:05:19 +0200
Subject: [PATCH] Support VS 2022 17.1x.y
With 17.10.0 the MSVC toolset was set to 19.40.x which breaks the compatibility test in the OpenCV's CMake Config files.
---
cmake/templates/OpenCVConfig.root-WIN32.cmake.in | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cmake/templates/OpenCVConfig.root-WIN32.cmake.in b/cmake/templates/OpenCVConfig.root-WIN32.cmake.in
index b0f254ebe8..62e36272f3 100644
--- a/cmake/templates/OpenCVConfig.root-WIN32.cmake.in
+++ b/cmake/templates/OpenCVConfig.root-WIN32.cmake.in
@@ -137,7 +137,7 @@ elseif(MSVC)
set(OpenCV_RUNTIME vc14) # selecting previous compatible runtime version
endif()
endif()
- elseif(MSVC_VERSION MATCHES "^193[0-9]$")
+ elseif(MSVC_VERSION MATCHES "^19[34][0-9]$")
set(OpenCV_RUNTIME vc17)
check_one_config(has_VS2022)
if(NOT has_VS2022)
--
2.45.2.windows.1
From f85818ba6f9031c450475a7453dee0acce31a881 Mon Sep 17 00:00:00 2001
From: Benjamin Buch <bebuch@users.noreply.github.com>
Date: Fri, 24 May 2024 11:10:09 +0200
Subject: [PATCH] Support VS 2022 17.1x.y in OpenCVDetectCXXCompiler.cmake
With 17.10.0 the MSVC toolset was set to 19.40.x which breaks the compatibility test in the OpenCV's CMake Config files.
---
cmake/OpenCVDetectCXXCompiler.cmake | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cmake/OpenCVDetectCXXCompiler.cmake b/cmake/OpenCVDetectCXXCompiler.cmake
index 1743aca11f..448afd46ea 100644
--- a/cmake/OpenCVDetectCXXCompiler.cmake
+++ b/cmake/OpenCVDetectCXXCompiler.cmake
@@ -176,7 +176,7 @@ elseif(MSVC)
set(OpenCV_RUNTIME vc15)
elseif(MSVC_VERSION MATCHES "^192[0-9]$")
set(OpenCV_RUNTIME vc16)
- elseif(MSVC_VERSION MATCHES "^193[0-9]$")
+ elseif(MSVC_VERSION MATCHES "^19[34][0-9]$")
set(OpenCV_RUNTIME vc17)
else()
message(WARNING "OpenCV does not recognize MSVC_VERSION \"${MSVC_VERSION}\". Cannot set OpenCV_RUNTIME")
--
2.45.2.windows.1

View File

@@ -1,54 +0,0 @@
From 893b8113f04d408cc6177c6de19c9889a48faa24 Mon Sep 17 00:00:00 2001
From: Zixu Wang <zixu_wang@apple.com>
Date: Thu, 18 Jan 2024 11:12:00 -0800
Subject: [PATCH] Fix unused platform check and configuration for macOS
In a similar manner as zlib (https://github.com/madler/zlib/pull/895),
libpng contains a header configuration that's no longer valid and
hasn't been exercised for the macOS target.
- The target OS conditional macros are misused. Specifically
`TARGET_OS_MAC` covers all Apple targets, including iOS, and it
should not be checked with `#if defined` as they would always be
defined (to either 1 or 0) on Apple platforms.
- `#include <fp.h>` no longer works for the macOS target and results
in a compilation failure. macOS ships all required functions in
`math.h`, and clients should use `math.h` instead.
This problem has not been noticed until a recent extension in clang
(https://github.com/llvm/llvm-project/pull/74676) exposed the issue
and broke libpng builds on Apple platforms. The failure can be
reproduced now by adding `#include <TargetConditionals.h>` before the
block.
Signed-off-by: Cosmin Truta <ctruta@gmail.com>
---
AUTHORS | 2 ++
pngpriv.h | 14 ++------------
2 files changed, 4 insertions(+), 12 deletions(-)
diff --git a/3rdparty/libpng/pngpriv.h b/3rdparty/libpng/pngpriv.h
index 6c7280cf53..190eb85cbf 100644
--- a/3rdparty/libpng/pngpriv.h
+++ b/3rdparty/libpng/pngpriv.h
@@ -556,18 +556,8 @@
*/
# include <float.h>
-# if (defined(__MWERKS__) && defined(macintosh)) || defined(applec) || \
- defined(THINK_C) || defined(__SC__) || defined(TARGET_OS_MAC)
- /* We need to check that <math.h> hasn't already been included earlier
- * as it seems it doesn't agree with <fp.h>, yet we should really use
- * <fp.h> if possible.
- */
-# if !defined(__MATH_H__) && !defined(__MATH_H) && !defined(__cmath__)
-# include <fp.h>
-# endif
-# else
-# include <math.h>
-# endif
+# include <math.h>
+
# if defined(_AMIGA) && defined(__SASC) && defined(_M68881)
/* Amiga SAS/C: We must include builtin FPU functions when compiling using
* MATH=68881

View File

@@ -1,77 +0,0 @@
if (MSVC)
set(_use_IPP "-DWITH_IPP=ON")
else ()
set(_use_IPP "-DWITH_IPP=OFF")
endif ()
if (IN_GIT_REPO)
set(OpenCV_DIRECTORY_FLAG --directory ${BINARY_DIR_REL}/dep_OpenCV-prefix/src/dep_OpenCV)
endif ()
orcaslicer_add_cmake_project(OpenCV
URL https://github.com/opencv/opencv/archive/refs/tags/4.6.0.tar.gz
URL_HASH SHA256=1ec1cba65f9f20fe5a41fda1586e01c70ea0c9a6d7b67c9e13edf0cfe2239277
PATCH_COMMAND git apply ${OpenCV_DIRECTORY_FLAG} --verbose --ignore-space-change --whitespace=fix ${CMAKE_CURRENT_LIST_DIR}/0001-vs2022.patch ${CMAKE_CURRENT_LIST_DIR}/0002-clang19-macos.patch
CMAKE_ARGS
-DBUILD_SHARED_LIBS=0
-DBUILD_PERE_TESTS=OFF
-DBUILD_TESTS=OFF
-DBUILD_opencv_python_tests=OFF
-DBUILD_EXAMPLES=OFF
-DBUILD_JASPER=OFF
-DBUILD_JAVA=OFF
-DBUILD_JPEG=ON
-DBUILD_APPS_LIST=version
-DBUILD_opencv_apps=OFF
-DBUILD_opencv_java=OFF
-DBUILD_OPENEXR=OFF
-DBUILD_PNG=ON
-DBUILD_TBB=OFF
-DBUILD_WEBP=OFF
-DBUILD_ZLIB=OFF
-DWITH_1394=OFF
-DWITH_CUDA=OFF
-DWITH_EIGEN=OFF
${_use_IPP}
-DWITH_ITT=OFF
-DWITH_FFMPEG=OFF
-DWITH_GPHOTO2=OFF
-DWITH_GSTREAMER=OFF
-DOPENCV_GAPI_GSTREAMER=OFF
-DWITH_GTK_2_X=OFF
-DWITH_JASPER=OFF
-DWITH_LAPACK=OFF
-DWITH_MATLAB=OFF
-DWITH_MFX=OFF
-DWITH_DIRECTX=OFF
-DWITH_DIRECTML=OFF
-DWITH_OPENCL=OFF
-DWITH_OPENCL_D3D11_NV=OFF
-DWITH_OPENCLAMDBLAS=OFF
-DWITH_OPENCLAMDFFT=OFF
-DWITH_OPENEXR=OFF
-DWITH_OPENJPEG=OFF
-DWITH_QUIRC=OFF
-DWITH_VTK=OFF
-DWITH_WEBP=OFF
-DENABLE_PRECOMPILED_HEADERS=OFF
-DINSTALL_TESTS=OFF
-DINSTALL_C_EXAMPLES=OFF
-DINSTALL_PYTHON_EXAMPLES=OFF
-DOPENCV_GENERATE_SETUPVARS=OFF
-DOPENCV_INSTALL_FFMPEG_DOWNLOAD_SCRIPT=OFF
-DBUILD_opencv_python2=OFF
-DBUILD_opencv_python3=OFF
-DWITH_OPENVINO=OFF
-DWITH_INF_ENGINE=OFF
-DWITH_NGRAPH=OFF
-DBUILD_WITH_STATIC_CRT=OFF#set /MDd /MD
-DBUILD_LIST=core,imgcodecs,imgproc,world
-DBUILD_opencv_highgui=OFF
-DWITH_ADE=OFF
-DBUILD_opencv_world=ON
-DWITH_PROTOBUF=OFF
-DWITH_WIN32UI=OFF
-DHAVE_WIN32UI=FALSE
)

View File

@@ -15,11 +15,11 @@ if (APPLE AND IS_CROSS_COMPILE)
EXCLUDE_FROM_ALL ON EXCLUDE_FROM_ALL ON
URL https://github.com/AcademySoftwareFoundation/openexr/archive/refs/tags/v2.5.5.zip URL https://github.com/AcademySoftwareFoundation/openexr/archive/refs/tags/v2.5.5.zip
URL_HASH SHA256=0307a3d7e1fa1e77e9d84d7e9a8694583fbbbfd50bdc6884e2c96b8ef6b902de URL_HASH SHA256=0307a3d7e1fa1e77e9d84d7e9a8694583fbbbfd50bdc6884e2c96b8ef6b902de
INSTALL_DIR ${DESTDIR} INSTALL_DIR ${DESTDIR}/usr/local
DOWNLOAD_DIR ${DEP_DOWNLOAD_DIR}/OpenEXR DOWNLOAD_DIR ${DEP_DOWNLOAD_DIR}/OpenEXR
${_openxr_list_sep} ${_openxr_list_sep}
CMAKE_ARGS CMAKE_ARGS
-DCMAKE_INSTALL_PREFIX:STRING=${DESTDIR} -DCMAKE_INSTALL_PREFIX:STRING=${DESTDIR}/usr/local
-DBUILD_SHARED_LIBS:BOOL=OFF -DBUILD_SHARED_LIBS:BOOL=OFF
-DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_POSITION_INDEPENDENT_CODE=ON
-DBUILD_TESTING=OFF -DBUILD_TESTING=OFF
@@ -54,4 +54,4 @@ endif()
if (MSVC) if (MSVC)
add_debug_dep(dep_OpenEXR) add_debug_dep(dep_OpenEXR)
endif () endif ()

View File

@@ -46,8 +46,8 @@ ExternalProject_Add(dep_OpenSSL
# URL_HASH SHA256=8c776993154652d0bb393f506d850b811517c8bd8d24b1008aef57fbe55d3f31 # URL_HASH SHA256=8c776993154652d0bb393f506d850b811517c8bd8d24b1008aef57fbe55d3f31
DOWNLOAD_DIR ${DEP_DOWNLOAD_DIR}/OpenSSL DOWNLOAD_DIR ${DEP_DOWNLOAD_DIR}/OpenSSL
CONFIGURE_COMMAND ${_conf_cmd} ${_cross_arch} CONFIGURE_COMMAND ${_conf_cmd} ${_cross_arch}
"--openssldir=${DESTDIR}" "--openssldir=${DESTDIR}/usr/local"
"--prefix=${DESTDIR}" "--prefix=${DESTDIR}/usr/local"
${_cross_comp_prefix_line} ${_cross_comp_prefix_line}
no-shared no-shared
no-asm no-asm
@@ -61,6 +61,6 @@ ExternalProject_Add(dep_OpenSSL
ExternalProject_Add_Step(dep_OpenSSL install_cmake_files ExternalProject_Add_Step(dep_OpenSSL install_cmake_files
DEPENDEES install DEPENDEES install
COMMAND ${CMAKE_COMMAND} -E copy_directory openssl "${DESTDIR}${CMAKE_INSTALL_LIBDIR}/cmake/openssl" COMMAND ${CMAKE_COMMAND} -E copy_directory openssl "${DESTDIR}/usr/local/${CMAKE_INSTALL_LIBDIR}/cmake/openssl"
WORKING_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}" WORKING_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}"
) )

View File

@@ -1,29 +0,0 @@
--- a/openvdb/openvdb/tree/NodeManager.h 2023-11-01 20:31:11 UTC
+++ b/openvdb/openvdb/tree/NodeManager.h
@@ -327,7 +327,7 @@ class NodeList (private)
void operator()(const NodeRange& range) const
{
for (typename NodeRange::Iterator it = range.begin(); it; ++it) {
- OpT::template eval(mNodeOp, it);
+ OpT::eval(mNodeOp, it);
}
}
const NodeOp mNodeOp;
@@ -347,7 +347,7 @@ class NodeList (private)
void operator()(const NodeRange& range) const
{
for (typename NodeRange::Iterator it = range.begin(); it; ++it) {
- OpT::template eval(mNodeOp, it);
+ OpT::eval(mNodeOp, it);
}
}
const NodeOp& mNodeOp;
@@ -372,7 +372,7 @@ class NodeList (private)
void operator()(const NodeRange& range)
{
for (typename NodeRange::Iterator it = range.begin(); it; ++it) {
- OpT::template eval(*mNodeOp, it);
+ OpT::eval(*mNodeOp, it);
}
}
void join(const NodeReducer& other)

View File

@@ -6,15 +6,10 @@ else()
set(_build_static ON) set(_build_static ON)
endif() endif()
if (IN_GIT_REPO)
set(OPENVDB_DIRECTORY_FLAG --directory ${BINARY_DIR_REL}/dep_OpenVDB-prefix/src/dep_OpenVDB)
endif ()
orcaslicer_add_cmake_project(OpenVDB orcaslicer_add_cmake_project(OpenVDB
# support vs2022, update to 8.2 # support vs2022, update to 8.2
URL https://github.com/tamasmeszaros/openvdb/archive/a68fd58d0e2b85f01adeb8b13d7555183ab10aa5.zip URL https://github.com/tamasmeszaros/openvdb/archive/a68fd58d0e2b85f01adeb8b13d7555183ab10aa5.zip
URL_HASH SHA256=f353e7b99bd0cbfc27ac9082de51acf32a8bc0b3e21ff9661ecca6f205ec1d81 URL_HASH SHA256=f353e7b99bd0cbfc27ac9082de51acf32a8bc0b3e21ff9661ecca6f205ec1d81
PATCH_COMMAND git apply ${OPENVDB_DIRECTORY_FLAG} --verbose --ignore-space-change --whitespace=fix ${CMAKE_CURRENT_LIST_DIR}/0001-clang19.patch
DEPENDS dep_TBB dep_Blosc dep_OpenEXR dep_Boost DEPENDS dep_TBB dep_Blosc dep_OpenEXR dep_Boost
CMAKE_ARGS CMAKE_ARGS
-DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_POSITION_INDEPENDENT_CODE=ON

View File

@@ -1,29 +0,0 @@
--- a/pngpriv.h 2025-04-20 19:36:04.000000000
+++ b/pngpriv.h 2025-04-20 19:35:55.000000000
@@ -511,24 +511,14 @@
* DBL_DIG Maximum number of decimal digits (can be set to any constant)
* DBL_MIN Smallest normalized fp number (can be set to an arbitrary value)
* DBL_MAX Maximum floating point number (can be set to an arbitrary value)
*/
# include <float.h>
-# if (defined(__MWERKS__) && defined(macintosh)) || defined(applec) || \
- defined(THINK_C) || defined(__SC__) || defined(TARGET_OS_MAC)
- /* We need to check that <math.h> hasn't already been included earlier
- * as it seems it doesn't agree with <fp.h>, yet we should really use
- * <fp.h> if possible.
- */
-# if !defined(__MATH_H__) && !defined(__MATH_H) && !defined(__cmath__)
-# include <fp.h>
-# endif
-# else
-# include <math.h>
-# endif
+# include <math.h>
+
# if defined(_AMIGA) && defined(__SASC) && defined(_M68881)
/* Amiga SAS/C: We must include builtin FPU functions when compiling using
* MATH=68881
*/
# include <m68881.h>
# endif

4
deps/PNG/PNG.cmake vendored
View File

@@ -12,7 +12,7 @@ if(APPLE AND IS_CROSS_COMPILE)
GIT_TAG v1.6.35 GIT_TAG v1.6.35
DEPENDS ${ZLIB_PKG} DEPENDS ${ZLIB_PKG}
PATCH_COMMAND ${GIT_EXECUTABLE} checkout -f -- . && git clean -df && PATCH_COMMAND ${GIT_EXECUTABLE} checkout -f -- . && git clean -df &&
${GIT_EXECUTABLE} apply --whitespace=fix ${CMAKE_CURRENT_LIST_DIR}/macos-arm64.patch ${CMAKE_CURRENT_LIST_DIR}/0002-clang19-macos.patch ${GIT_EXECUTABLE} apply --whitespace=fix ${CMAKE_CURRENT_LIST_DIR}/macos-arm64.patch
CMAKE_ARGS CMAKE_ARGS
-DPNG_SHARED=OFF -DPNG_SHARED=OFF
-DPNG_STATIC=ON -DPNG_STATIC=ON
@@ -24,7 +24,7 @@ if(APPLE AND IS_CROSS_COMPILE)
else () else ()
set(_patch_step "") set(_patch_step "")
if (APPLE) if (APPLE)
set(_patch_step PATCH_COMMAND ${PATCH_CMD} ${CMAKE_CURRENT_LIST_DIR}/PNG.patch ${CMAKE_CURRENT_LIST_DIR}/0002-clang19-macos.patch) set(_patch_step PATCH_COMMAND ${PATCH_CMD} ${CMAKE_CURRENT_LIST_DIR}/PNG.patch)
endif () endif ()
orcaslicer_add_cmake_project(PNG orcaslicer_add_cmake_project(PNG
# GIT_REPOSITORY https://github.com/glennrp/libpng.git # GIT_REPOSITORY https://github.com/glennrp/libpng.git

79
deps/TBB/GNU.cmake vendored
View File

@@ -1,79 +0,0 @@
# Copyright (c) 2020-2021 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
if (MINGW)
set(TBB_LINK_DEF_FILE_FLAG "")
set(TBB_DEF_FILE_PREFIX "")
elseif (APPLE)
set(TBB_LINK_DEF_FILE_FLAG -Wl,-exported_symbols_list,)
set(TBB_DEF_FILE_PREFIX mac${TBB_ARCH})
# For correct ucontext.h structures layout
set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} -D_XOPEN_SOURCE)
else()
set(TBB_LINK_DEF_FILE_FLAG -Wl,--version-script=)
set(TBB_DEF_FILE_PREFIX lin${TBB_ARCH})
endif()
# Add -Wno-error=stringop-overflow to fix GCC 12+ build as suggested on https://github.com/oneapi-src/oneTBB/issues/843#issuecomment-1152646035
set(TBB_WARNING_LEVEL -Wall -Wextra $<$<BOOL:${TBB_STRICT}>:-Werror> -Wfatal-errors -Wno-error=stringop-overflow)
set(TBB_TEST_WARNING_FLAGS -Wshadow -Wcast-qual -Woverloaded-virtual -Wnon-virtual-dtor)
# Depfile options (e.g. -MD) are inserted automatically in some cases.
# Don't add -MMD to avoid conflicts in such cases.
if (NOT CMAKE_GENERATOR MATCHES "Ninja" AND NOT CMAKE_CXX_DEPENDS_USE_COMPILER)
set(TBB_MMD_FLAG -MMD)
endif()
# Enable Intel(R) Transactional Synchronization Extensions (-mrtm) and WAITPKG instructions support (-mwaitpkg) on relevant processors
if (CMAKE_SYSTEM_PROCESSOR MATCHES "(x86|AMD64)")
set(TBB_COMMON_COMPILE_FLAGS ${TBB_COMMON_COMPILE_FLAGS} -mrtm $<$<AND:$<NOT:$<CXX_COMPILER_ID:Intel>>,$<NOT:$<VERSION_LESS:${CMAKE_CXX_COMPILER_VERSION},11.0>>>:-mwaitpkg>)
endif()
if (NOT MINGW)
set(TBB_COMMON_LINK_LIBS dl)
endif()
# Ignore -Werror set through add_compile_options() or added to CMAKE_CXX_FLAGS if TBB_STRICT is disabled.
if (NOT TBB_STRICT AND COMMAND tbb_remove_compile_flag)
tbb_remove_compile_flag(-Werror)
endif()
if (NOT ${CMAKE_CXX_COMPILER_ID} STREQUAL Intel)
# gcc 6.0 and later have -flifetime-dse option that controls elimination of stores done outside the object lifetime
set(TBB_DSE_FLAG $<$<NOT:$<VERSION_LESS:${CMAKE_CXX_COMPILER_VERSION},6.0>>:-flifetime-dse=1>)
endif()
# Workaround for heavy tests and too many symbols in debug (rellocation truncated to fit: R_MIPS_CALL16)
if ("${CMAKE_SYSTEM_PROCESSOR}" MATCHES "mips")
set(TBB_TEST_COMPILE_FLAGS ${TBB_TEST_COMPILE_FLAGS} -DTBB_TEST_LOW_WORKLOAD $<$<CONFIG:DEBUG>:-mxgot>)
endif()
if (MINGW)
list(APPEND TBB_COMMON_COMPILE_FLAGS -U__STRICT_ANSI__)
endif()
# For some reason GCC does not instrument code with Thread Sanitizer when lto is enabled and C linker is used.
if (NOT TBB_SANITIZE MATCHES "thread")
set(TBB_IPO_COMPILE_FLAGS $<$<NOT:$<CONFIG:Debug>>:-flto>)
set(TBB_IPO_LINK_FLAGS $<$<NOT:$<CONFIG:Debug>>:-flto>)
endif()
# Disable lto flag
set(TBB_IPO_COMPILE_FLAGS "")
set(TBB_IPO_LINK_FLAGS "")
# TBB malloc settings
set(TBBMALLOC_LIB_COMPILE_FLAGS -fno-rtti -fno-exceptions)
set(TBB_OPENMP_FLAG -fopenmp)

8
deps/TBB/TBB.cmake vendored
View File

@@ -1,14 +1,8 @@
if (FLATPAK)
set(_patch_command ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_LIST_DIR}/GNU.cmake ./cmake/compilers/GNU.cmake)
else()
set(_patch_command "")
endif()
orcaslicer_add_cmake_project( orcaslicer_add_cmake_project(
TBB TBB
URL "https://github.com/oneapi-src/oneTBB/archive/refs/tags/v2021.5.0.zip" URL "https://github.com/oneapi-src/oneTBB/archive/refs/tags/v2021.5.0.zip"
URL_HASH SHA256=83ea786c964a384dd72534f9854b419716f412f9d43c0be88d41874763e7bb47 URL_HASH SHA256=83ea786c964a384dd72534f9854b419716f412f9d43c0be88d41874763e7bb47
PATCH_COMMAND ${_patch_command} #PATCH_COMMAND ${PATCH_CMD} ${CMAKE_CURRENT_LIST_DIR}/0001-TBB-GCC13.patch
CMAKE_ARGS CMAKE_ARGS
-DTBB_BUILD_SHARED=OFF -DTBB_BUILD_SHARED=OFF
-DTBB_BUILD_TESTS=OFF -DTBB_BUILD_TESTS=OFF

32
deps/TIFF/TIFF.cmake vendored Normal file
View File

@@ -0,0 +1,32 @@
find_package(OpenGL QUIET REQUIRED)
if (APPLE)
message(STATUS "Compiling TIFF for macos ${CMAKE_SYSTEM_VERSION}.")
orcaslicer_add_cmake_project(TIFF
URL https://gitlab.com/libtiff/libtiff/-/archive/v4.3.0/libtiff-v4.3.0.zip
URL_HASH SHA256=4fca1b582c88319f3ad6ecd5b46320eadaf5eb4ef6f6c32d44caaae4a03d0726
DEPENDS ${ZLIB_PKG} ${PNG_PKG} dep_JPEG
CMAKE_ARGS
-Dlzma:BOOL=OFF
-Dwebp:BOOL=OFF
-Djbig:BOOL=OFF
-Dzstd:BOOL=OFF
-Dpixarlog:BOOL=OFF
)
else()
orcaslicer_add_cmake_project(TIFF
URL https://gitlab.com/libtiff/libtiff/-/archive/v4.1.0/libtiff-v4.1.0.zip
URL_HASH SHA256=c56edfacef0a60c0de3e6489194fcb2f24c03dbb550a8a7de5938642d045bd32
DEPENDS ${ZLIB_PKG} ${PNG_PKG} dep_JPEG
CMAKE_ARGS
-Dlzma:BOOL=OFF
-Dwebp:BOOL=OFF
-Djbig:BOOL=OFF
-Dzstd:BOOL=OFF
-Dpixarlog:BOOL=OFF
)
endif()

File diff suppressed because it is too large Load Diff

View File

@@ -5,27 +5,11 @@
#ifndef __core_webview2_environment_options_h__ #ifndef __core_webview2_environment_options_h__
#define __core_webview2_environment_options_h__ #define __core_webview2_environment_options_h__
// Adding the definition of this macro to enable unsafe buffer usage
#ifndef UNSAFE_BUFFERS
#if defined(__clang__)
// clang-format off
#define UNSAFE_BUFFERS(...) \
_Pragma("clang unsafe_buffer_usage begin") \
__VA_ARGS__ \
_Pragma("clang unsafe_buffer_usage end")
// clang-format on
#else
#define UNSAFE_BUFFERS(...) __VA_ARGS__
#endif
#endif
#include <objbase.h> #include <objbase.h>
#include <wrl/implements.h> #include <wrl/implements.h>
#include "WebView2.h" #include "webview2.h"
#define CORE_WEBVIEW_TARGET_PRODUCT_VERSION L"138.0.3351.48" #define CORE_WEBVIEW_TARGET_PRODUCT_VERSION L"107.0.1418.22"
#define COREWEBVIEW2ENVIRONMENTOPTIONS_STRING_PROPERTY(p) \ #define COREWEBVIEW2ENVIRONMENTOPTIONS_STRING_PROPERTY(p) \
public: \ public: \
@@ -47,180 +31,21 @@
protected: \ protected: \
AutoCoMemString m_##p; AutoCoMemString m_##p;
#define COREWEBVIEW2ENVIRONMENTOPTIONS_BOOL_PROPERTY(p, defPVal) \ #define COREWEBVIEW2ENVIRONMENTOPTIONS_BOOL_PROPERTY(p) \
public: \ public: \
HRESULT STDMETHODCALLTYPE get_##p(BOOL* value) override { \ HRESULT STDMETHODCALLTYPE get_##p(BOOL* value) override { \
if (!value) \ if (!value) \
return E_POINTER; \ return E_POINTER; \
*value = m_##p; \ *value = m_##p; \
return S_OK; \ return S_OK; \
} \ } \
HRESULT STDMETHODCALLTYPE put_##p(BOOL value) override { \ HRESULT STDMETHODCALLTYPE put_##p(BOOL value) override { \
m_##p = value; \ m_##p = value; \
return S_OK; \ return S_OK; \
} \ } \
\ \
protected: \ protected: \
BOOL m_##p = defPVal ? TRUE : FALSE; BOOL m_##p = FALSE;
#define DEFINE_AUTO_COMEM_STRING() \
protected: \
class AutoCoMemString { \
public: \
AutoCoMemString() {} \
~AutoCoMemString() { Release(); } \
void Release() { \
if (m_string) { \
deallocate_fn(m_string); \
m_string = nullptr; \
} \
} \
\
LPCWSTR Set(LPCWSTR str) { \
Release(); \
if (str) { \
m_string = MakeCoMemString(str); \
} \
return m_string; \
} \
LPCWSTR Get() { return m_string; } \
LPWSTR Copy() { \
if (m_string) \
return MakeCoMemString(m_string); \
return nullptr; \
} \
\
protected: \
LPWSTR MakeCoMemString(LPCWSTR source) { \
const size_t length = wcslen(source); \
const size_t bytes = (length + 1) * sizeof(*source); \
\
if (bytes <= length) { \
return nullptr; \
} \
\
wchar_t* result = reinterpret_cast<wchar_t*>(allocate_fn(bytes)); \
\
if (result) \
memcpy(result, source, bytes); \
return result; \
} \
LPWSTR m_string = nullptr; \
};
template <typename allocate_fn_t,
allocate_fn_t allocate_fn,
typename deallocate_fn_t,
deallocate_fn_t deallocate_fn>
class CoreWebView2CustomSchemeRegistrationBase
: public Microsoft::WRL::RuntimeClass<
Microsoft::WRL::RuntimeClassFlags<Microsoft::WRL::ClassicCom>,
ICoreWebView2CustomSchemeRegistration> {
public:
CoreWebView2CustomSchemeRegistrationBase(LPCWSTR schemeName) {
m_schemeName.Set(schemeName);
}
CoreWebView2CustomSchemeRegistrationBase(
CoreWebView2CustomSchemeRegistrationBase&&) = default;
~CoreWebView2CustomSchemeRegistrationBase() { ReleaseAllowedOrigins(); }
HRESULT STDMETHODCALLTYPE get_SchemeName(LPWSTR* schemeName) override {
if (!schemeName)
return E_POINTER;
*schemeName = m_schemeName.Copy();
if ((*schemeName == nullptr) && (m_schemeName.Get() != nullptr))
return HRESULT_FROM_WIN32(GetLastError());
return S_OK;
}
HRESULT STDMETHODCALLTYPE
GetAllowedOrigins(UINT32* allowedOriginsCount,
LPWSTR** allowedOrigins) override {
if (!allowedOrigins || !allowedOriginsCount) {
return E_POINTER;
}
*allowedOriginsCount = 0;
if (m_allowedOriginsCount == 0) {
*allowedOrigins = nullptr;
return S_OK;
} else {
*allowedOrigins = reinterpret_cast<LPWSTR*>(
allocate_fn(m_allowedOriginsCount * sizeof(LPWSTR)));
if (!(*allowedOrigins)) {
return HRESULT_FROM_WIN32(GetLastError());
}
ZeroMemory(*allowedOrigins, m_allowedOriginsCount * sizeof(LPWSTR));
for (UINT32 i = 0; i < m_allowedOriginsCount; i++) {
UNSAFE_BUFFERS((*allowedOrigins)[i] = m_allowedOrigins[i].Copy();
if (!(*allowedOrigins)[i]) {
HRESULT hr = HRESULT_FROM_WIN32(GetLastError());
for (UINT32 j = 0; j < i; j++) {
deallocate_fn((*allowedOrigins)[j]);
}
deallocate_fn(*allowedOrigins);
return hr;
})
}
*allowedOriginsCount = m_allowedOriginsCount;
return S_OK;
}
}
HRESULT STDMETHODCALLTYPE
SetAllowedOrigins(UINT32 allowedOriginsCount,
LPCWSTR* allowedOrigins) override {
ReleaseAllowedOrigins();
if (allowedOriginsCount == 0) {
return S_OK;
} else {
m_allowedOrigins = new AutoCoMemString[allowedOriginsCount];
if (!m_allowedOrigins) {
return HRESULT_FROM_WIN32(GetLastError());
}
for (UINT32 i = 0; i < allowedOriginsCount; i++) {
UNSAFE_BUFFERS(m_allowedOrigins[i].Set(allowedOrigins[i]);
if (!m_allowedOrigins[i].Get()) {
HRESULT hr = HRESULT_FROM_WIN32(GetLastError());
for (UINT32 j = 0; j < i; j++) {
m_allowedOrigins[j].Release();
}
m_allowedOriginsCount = 0;
delete[] (m_allowedOrigins);
return hr;
})
}
m_allowedOriginsCount = allowedOriginsCount;
return S_OK;
}
}
protected:
DEFINE_AUTO_COMEM_STRING()
void ReleaseAllowedOrigins() {
if (m_allowedOrigins) {
delete[] (m_allowedOrigins);
m_allowedOrigins = nullptr;
}
}
AutoCoMemString m_schemeName;
COREWEBVIEW2ENVIRONMENTOPTIONS_BOOL_PROPERTY(TreatAsSecure, false)
COREWEBVIEW2ENVIRONMENTOPTIONS_BOOL_PROPERTY(HasAuthorityComponent, false)
// WebView2EnvironmentOptions.h this is a publicly exposed header to clients
// and it used by them to integrate the webview2 enviorment as published at
// https://learn.microsoft.com/en-us/microsoft-edge/webview2/reference/win32/icorewebview2environmentoptions?view=webview2-1.0.3179.45
// This file is not included in msedge.dll/lib/exe and is limited to WebView2
// SDK which does not use partition alloc. So need to use raw_ptr_exclusion
// here.
#if defined(__has_attribute)
__attribute__((annotate("raw_ptr_exclusion")))
#endif
AutoCoMemString* m_allowedOrigins = nullptr;
unsigned int m_allowedOriginsCount = 0;
};
// This is a base COM class that implements ICoreWebView2EnvironmentOptions. // This is a base COM class that implements ICoreWebView2EnvironmentOptions.
template <typename allocate_fn_t, template <typename allocate_fn_t,
@@ -231,183 +56,70 @@ class CoreWebView2EnvironmentOptionsBase
: public Microsoft::WRL::Implements< : public Microsoft::WRL::Implements<
Microsoft::WRL::RuntimeClassFlags<Microsoft::WRL::ClassicCom>, Microsoft::WRL::RuntimeClassFlags<Microsoft::WRL::ClassicCom>,
ICoreWebView2EnvironmentOptions, ICoreWebView2EnvironmentOptions,
ICoreWebView2EnvironmentOptions2, ICoreWebView2EnvironmentOptions2> {
ICoreWebView2EnvironmentOptions3,
ICoreWebView2EnvironmentOptions4,
ICoreWebView2EnvironmentOptions5,
ICoreWebView2EnvironmentOptions6,
ICoreWebView2EnvironmentOptions7,
ICoreWebView2EnvironmentOptions8> {
public: public:
static const COREWEBVIEW2_RELEASE_CHANNELS kInternalChannel =
static_cast<COREWEBVIEW2_RELEASE_CHANNELS>(1 << 4);
static const COREWEBVIEW2_RELEASE_CHANNELS kAllChannels =
COREWEBVIEW2_RELEASE_CHANNELS_STABLE |
COREWEBVIEW2_RELEASE_CHANNELS_BETA | COREWEBVIEW2_RELEASE_CHANNELS_DEV |
COREWEBVIEW2_RELEASE_CHANNELS_CANARY | kInternalChannel;
CoreWebView2EnvironmentOptionsBase() { CoreWebView2EnvironmentOptionsBase() {
// Initialize the target compatible browser version value to the version // Initialize the target compatible browser version value to the version of
// of the browser binaries corresponding to this version of the SDK. // the browser binaries corresponding to this version of the SDK.
m_TargetCompatibleBrowserVersion.Set(CORE_WEBVIEW_TARGET_PRODUCT_VERSION); m_TargetCompatibleBrowserVersion.Set(CORE_WEBVIEW_TARGET_PRODUCT_VERSION);
} }
// ICoreWebView2EnvironmentOptions7
HRESULT STDMETHODCALLTYPE
get_ReleaseChannels(COREWEBVIEW2_RELEASE_CHANNELS* channels) override {
if (!channels) {
return E_POINTER;
}
*channels = m_releaseChannels;
return S_OK;
}
HRESULT STDMETHODCALLTYPE
put_ReleaseChannels(COREWEBVIEW2_RELEASE_CHANNELS channels) override {
m_releaseChannels = channels;
return S_OK;
}
HRESULT STDMETHODCALLTYPE
get_ChannelSearchKind(COREWEBVIEW2_CHANNEL_SEARCH_KIND* value) override {
if (!value) {
return E_POINTER;
}
*value = m_channelSearchKind;
return S_OK;
}
HRESULT STDMETHODCALLTYPE
put_ChannelSearchKind(COREWEBVIEW2_CHANNEL_SEARCH_KIND value) override {
m_channelSearchKind = value;
return S_OK;
}
// ICoreWebView2EnvironmentOptions8
HRESULT STDMETHODCALLTYPE
get_ScrollBarStyle(COREWEBVIEW2_SCROLLBAR_STYLE* style) override {
if (!style) {
return E_POINTER;
}
*style = m_scrollbarStyle;
return S_OK;
}
HRESULT STDMETHODCALLTYPE
put_ScrollBarStyle(COREWEBVIEW2_SCROLLBAR_STYLE style) override {
m_scrollbarStyle = style;
return S_OK;
}
protected: protected:
~CoreWebView2EnvironmentOptionsBase() { ReleaseCustomSchemeRegistrations(); } ~CoreWebView2EnvironmentOptionsBase() {}
void ReleaseCustomSchemeRegistrations() { class AutoCoMemString {
if (m_customSchemeRegistrations) { public:
for (UINT32 i = 0; i < m_customSchemeRegistrationsCount; i++) { AutoCoMemString() {}
// SAFETY: Since we can't convert the raw buffer to safe type we do a ~AutoCoMemString() { Release(); }
// bound check and use the macro to mitigate the error. void Release() {
UNSAFE_BUFFERS(m_customSchemeRegistrations[i])->Release(); if (m_string) {
deallocate_fn(m_string);
m_string = nullptr;
} }
deallocate_fn(m_customSchemeRegistrations);
m_customSchemeRegistrations = nullptr;
m_customSchemeRegistrationsCount = 0;
} }
}
private: LPCWSTR Set(LPCWSTR str) {
// TODO(task.ms/56073082): Use raw_ptr. Release();
#if defined(__has_attribute) if (str) {
__attribute__((annotate("raw_ptr_exclusion"))) m_string = MakeCoMemString(str);
#endif }
ICoreWebView2CustomSchemeRegistration** m_customSchemeRegistrations = nullptr; return m_string;
unsigned int m_customSchemeRegistrationsCount = 0; }
LPCWSTR Get() { return m_string; }
LPWSTR Copy() {
if (m_string)
return MakeCoMemString(m_string);
return nullptr;
}
COREWEBVIEW2_RELEASE_CHANNELS m_releaseChannels = kAllChannels; protected:
COREWEBVIEW2_CHANNEL_SEARCH_KIND m_channelSearchKind = LPWSTR MakeCoMemString(LPCWSTR source) {
COREWEBVIEW2_CHANNEL_SEARCH_KIND_MOST_STABLE; const size_t length = wcslen(source);
const size_t bytes = (length + 1) * sizeof(*source);
// Ensure we didn't overflow during our size calculation.
if (bytes <= length) {
return nullptr;
}
// ICoreWebView2EnvironmentOptions8 wchar_t* result = reinterpret_cast<wchar_t*>(allocate_fn(bytes));
COREWEBVIEW2_SCROLLBAR_STYLE m_scrollbarStyle = if (result)
COREWEBVIEW2_SCROLLBAR_STYLE_DEFAULT; memcpy(result, source, bytes);
DEFINE_AUTO_COMEM_STRING() return result;
}
LPWSTR m_string = nullptr;
};
public:
// ICoreWebView2EnvironmentOptions // ICoreWebView2EnvironmentOptions
COREWEBVIEW2ENVIRONMENTOPTIONS_STRING_PROPERTY(AdditionalBrowserArguments) COREWEBVIEW2ENVIRONMENTOPTIONS_STRING_PROPERTY(AdditionalBrowserArguments)
COREWEBVIEW2ENVIRONMENTOPTIONS_STRING_PROPERTY(Language) COREWEBVIEW2ENVIRONMENTOPTIONS_STRING_PROPERTY(Language)
COREWEBVIEW2ENVIRONMENTOPTIONS_STRING_PROPERTY(TargetCompatibleBrowserVersion) COREWEBVIEW2ENVIRONMENTOPTIONS_STRING_PROPERTY(TargetCompatibleBrowserVersion)
COREWEBVIEW2ENVIRONMENTOPTIONS_BOOL_PROPERTY( COREWEBVIEW2ENVIRONMENTOPTIONS_BOOL_PROPERTY(
AllowSingleSignOnUsingOSPrimaryAccount, AllowSingleSignOnUsingOSPrimaryAccount)
false)
// ICoreWebView2EnvironmentOptions2 // ICoreWebView2EnvironmentOptions2
COREWEBVIEW2ENVIRONMENTOPTIONS_BOOL_PROPERTY(ExclusiveUserDataFolderAccess, COREWEBVIEW2ENVIRONMENTOPTIONS_BOOL_PROPERTY(ExclusiveUserDataFolderAccess)
false)
// ICoreWebView2EnvironmentOptions3
COREWEBVIEW2ENVIRONMENTOPTIONS_BOOL_PROPERTY(IsCustomCrashReportingEnabled,
false)
// ICoreWebView2EnvironmentOptions4
public:
HRESULT STDMETHODCALLTYPE GetCustomSchemeRegistrations(
UINT32* count,
ICoreWebView2CustomSchemeRegistration*** schemeRegistrations) override {
if (!count || !schemeRegistrations) {
return E_POINTER;
}
*count = 0;
if (m_customSchemeRegistrationsCount == 0) {
*schemeRegistrations = nullptr;
return S_OK;
} else {
*schemeRegistrations =
reinterpret_cast<ICoreWebView2CustomSchemeRegistration**>(
allocate_fn(sizeof(ICoreWebView2CustomSchemeRegistration*) *
m_customSchemeRegistrationsCount));
if (!*schemeRegistrations) {
return HRESULT_FROM_WIN32(GetLastError());
}
for (UINT32 i = 0; i < m_customSchemeRegistrationsCount; i++) {
// SAFETY: Since we can't convert the raw buffer to safe type we do a
// bound check and use the macro to mitigate the error.
UNSAFE_BUFFERS((*schemeRegistrations)[i] =
m_customSchemeRegistrations[i];
(*schemeRegistrations)[i]->AddRef();)
}
*count = m_customSchemeRegistrationsCount;
return S_OK;
}
}
HRESULT STDMETHODCALLTYPE SetCustomSchemeRegistrations(
UINT32 count,
ICoreWebView2CustomSchemeRegistration** schemeRegistrations) override {
ReleaseCustomSchemeRegistrations();
m_customSchemeRegistrations =
reinterpret_cast<ICoreWebView2CustomSchemeRegistration**>(allocate_fn(
sizeof(ICoreWebView2CustomSchemeRegistration*) * count));
if (!m_customSchemeRegistrations) {
return GetLastError();
}
for (UINT32 i = 0; i < count; i++) {
// SAFETY: Since we can't convert the raw buffer to safe type we do a
// bound check and use the macro to mitigate the error.
UNSAFE_BUFFERS(m_customSchemeRegistrations[i] = schemeRegistrations[i];
m_customSchemeRegistrations[i]->AddRef());
}
m_customSchemeRegistrationsCount = count;
return S_OK;
}
// ICoreWebView2EnvironmentOptions5
COREWEBVIEW2ENVIRONMENTOPTIONS_BOOL_PROPERTY(EnableTrackingPrevention, true)
// ICoreWebView2EnvironmentOptions6
COREWEBVIEW2ENVIRONMENTOPTIONS_BOOL_PROPERTY(AreBrowserExtensionsEnabled,
false)
}; };
template <typename allocate_fn_t, template <typename allocate_fn_t,
@@ -428,12 +140,6 @@ class CoreWebView2EnvironmentOptionsBaseClass
~CoreWebView2EnvironmentOptionsBaseClass() override {} ~CoreWebView2EnvironmentOptionsBaseClass() override {}
}; };
typedef CoreWebView2CustomSchemeRegistrationBase<decltype(&::CoTaskMemAlloc),
::CoTaskMemAlloc,
decltype(&::CoTaskMemFree),
::CoTaskMemFree>
CoreWebView2CustomSchemeRegistration;
typedef CoreWebView2EnvironmentOptionsBaseClass<decltype(&::CoTaskMemAlloc), typedef CoreWebView2EnvironmentOptionsBaseClass<decltype(&::CoTaskMemAlloc),
::CoTaskMemAlloc, ::CoTaskMemAlloc,
decltype(&::CoTaskMemFree), decltype(&::CoTaskMemFree),

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -15,8 +15,8 @@ elseif (MSVC_VERSION LESS 1930)
# 1920-1929 = VS 16.0 (v142 toolset) # 1920-1929 = VS 16.0 (v142 toolset)
set(DEP_VS_VER "16") set(DEP_VS_VER "16")
set(DEP_BOOST_TOOLSET "msvc-14.2") set(DEP_BOOST_TOOLSET "msvc-14.2")
elseif (MSVC_VERSION LESS 1950) elseif (MSVC_VERSION LESS 1940)
# 1930-1949 = VS 17.0 (v143 toolset) # 1930-1939 = VS 17.0 (v143 toolset)
set(DEP_VS_VER "17") set(DEP_VS_VER "17")
set(DEP_BOOST_TOOLSET "msvc-14.3") set(DEP_BOOST_TOOLSET "msvc-14.3")
else () else ()
@@ -27,13 +27,16 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL Clang)
set(DEP_BOOST_TOOLSET "clang-win") set(DEP_BOOST_TOOLSET "clang-win")
endif () endif ()
set(DEP_MSVC_GEN "Visual Studio ${DEP_VS_VER}") if (${DEPS_BITS} EQUAL 32)
if ("${DEPS_ARCH}" STREQUAL "x86") set(DEP_MSVC_GEN "Visual Studio ${DEP_VS_VER}")
set(DEP_PLATFORM "Win32") set(DEP_PLATFORM "Win32")
elseif ("${DEPS_ARCH}" STREQUAL "x64")
set(DEP_PLATFORM "x64")
else () else ()
message(FATAL_ERROR "Unsupported OS architecture") if (DEP_VS_VER LESS 16)
set(DEP_MSVC_GEN "Visual Studio ${DEP_VS_VER} Win64")
else ()
set(DEP_MSVC_GEN "Visual Studio ${DEP_VS_VER}")
endif ()
set(DEP_PLATFORM "x64")
endif () endif ()
if (${DEP_DEBUG}) if (${DEP_DEBUG})
@@ -54,14 +57,12 @@ if (${DEP_DEBUG})
endif () endif ()
endmacro() endmacro()
if ("${DEPS_ARCH}" STREQUAL "x86") if (${DEPS_BITS} EQUAL 32)
set(DEP_WXWIDGETS_TARGET "") set(DEP_WXWIDGETS_TARGET "")
set(DEP_WXWIDGETS_LIBDIR "vc_lib") set(DEP_WXWIDGETS_LIBDIR "vc_lib")
elseif ("${DEPS_ARCH}" STREQUAL "x64") else ()
set(DEP_WXWIDGETS_TARGET "TARGET_CPU=X64") set(DEP_WXWIDGETS_TARGET "TARGET_CPU=X64")
set(DEP_WXWIDGETS_LIBDIR "vc_x64_lib") set(DEP_WXWIDGETS_LIBDIR "vc_x64_lib")
else ()
message(FATAL_ERROR "Unsupported OS architecture")
endif () endif ()
find_package(Git REQUIRED) find_package(Git REQUIRED)

View File

@@ -1,4 +0,0 @@
orcaslicer_add_cmake_project(libnoise
URL https://github.com/SoftFever/Orca-deps-libnoise/archive/refs/tags/1.0.zip
URL_HASH SHA256=96ffd6cc47898dd8147aab53d7d1b1911b507d9dbaecd5613ca2649468afd8b6
)

View File

@@ -0,0 +1,683 @@
From f4fef135f0a58ca2916c45cd539923ab096935b6 Mon Sep 17 00:00:00 2001
From: Ocraftyone <Ocraftyone@users.noreply.github.com>
Date: Thu, 30 Nov 2023 03:25:54 -0500
Subject: [PATCH] patch v3.2.1 for OrcaSlicer
---
build/cmake/lib/webview/CMakeLists.txt | 4 +-
include/wx/fontutil.h | 15 +++++++-
include/wx/gdicmn.h | 3 ++
include/wx/generic/grid.h | 4 +-
include/wx/msw/font.h | 2 +-
include/wx/msw/tooltip.h | 4 +-
include/wx/osx/app.h | 2 +-
src/common/combocmn.cpp | 11 +++++-
src/common/datavcmn.cpp | 6 ++-
src/common/dcbufcmn.cpp | 6 +++
src/common/gdicmn.cpp | 14 +++++++
src/common/image.cpp | 6 +--
src/generic/grid.cpp | 50 ++++++++++++++++++++-----
src/msw/bmpcbox.cpp | 9 ++++-
src/msw/font.cpp | 14 +++----
src/msw/menuitem.cpp | 2 +
src/msw/window.cpp | 52 +++++++++++++++++---------
src/osx/cocoa/dataview.mm | 26 +++++++++++--
src/osx/cocoa/settings.mm | 6 +--
src/osx/cocoa/window.mm | 4 ++
20 files changed, 184 insertions(+), 56 deletions(-)
diff --git a/build/cmake/lib/webview/CMakeLists.txt b/build/cmake/lib/webview/CMakeLists.txt
index 085381d785..62146abc04 100644
--- a/build/cmake/lib/webview/CMakeLists.txt
+++ b/build/cmake/lib/webview/CMakeLists.txt
@@ -46,9 +46,9 @@ if(APPLE)
elseif(WXMSW)
if(wxUSE_WEBVIEW_EDGE)
# Update the following variables if updating WebView2 SDK
- set(WEBVIEW2_VERSION "1.0.705.50")
+ set(WEBVIEW2_VERSION "1.0.1418.22")
set(WEBVIEW2_URL "https://www.nuget.org/api/v2/package/Microsoft.Web.WebView2/${WEBVIEW2_VERSION}")
- set(WEBVIEW2_SHA256 "6a34bb553e18cfac7297b4031f3eac2558e439f8d16a45945c22945ac404105d")
+ set(WEBVIEW2_SHA256 "51d2ef56196e2a9d768a6843385bcb9c6baf9ed34b2603ddb074fb4995543a99")
set(WEBVIEW2_DEFAULT_PACKAGE_DIR "${CMAKE_BINARY_DIR}/packages/Microsoft.Web.WebView2.${WEBVIEW2_VERSION}")
diff --git a/include/wx/fontutil.h b/include/wx/fontutil.h
index 30529db8ce..e6a12366d5 100644
--- a/include/wx/fontutil.h
+++ b/include/wx/fontutil.h
@@ -294,7 +294,11 @@ public:
wxFontEncoding GetEncoding() const;
void SetPointSize(int pointsize);
- void SetFractionalPointSize(double pointsize);
+ void SetFractionalPointSize(double pointsize
+#if defined(__WXMSW__)
+ , const wxWindow *window = nullptr
+#endif
+ );
void SetPixelSize(const wxSize& pixelSize);
void SetStyle(wxFontStyle style);
void SetNumericWeight(int weight);
@@ -307,12 +311,19 @@ public:
// Helper used in many ports: use the normal font size if the input is
// negative, as we handle -1 as meaning this for compatibility.
- void SetSizeOrDefault(double size)
+ void SetSizeOrDefault(double size
+#if defined(__WXMSW__)
+ , const wxWindow *window = nullptr
+#endif
+ )
{
SetFractionalPointSize
(
size < 0 ? wxNORMAL_FONT->GetFractionalPointSize()
: size
+#if defined(__WXMSW__)
+ ,window
+#endif
);
}
diff --git a/include/wx/gdicmn.h b/include/wx/gdicmn.h
index 2f5f8ee99f..39e9317d40 100644
--- a/include/wx/gdicmn.h
+++ b/include/wx/gdicmn.h
@@ -38,6 +38,7 @@ class WXDLLIMPEXP_FWD_CORE wxRegion;
class WXDLLIMPEXP_FWD_BASE wxString;
class WXDLLIMPEXP_FWD_CORE wxIconBundle;
class WXDLLIMPEXP_FWD_CORE wxPoint;
+class WXDLLIMPEXP_FWD_CORE wxWindow;
// ---------------------------------------------------------------------------
// constants
@@ -1106,7 +1107,9 @@ extern int WXDLLIMPEXP_CORE wxDisplayDepth();
// get the display size
extern void WXDLLIMPEXP_CORE wxDisplaySize(int *width, int *height);
+extern void WXDLLIMPEXP_CORE wxDisplaySize(const wxWindow *window, int *width, int *height);
extern wxSize WXDLLIMPEXP_CORE wxGetDisplaySize();
+extern wxSize WXDLLIMPEXP_CORE wxGetDisplaySize(const wxWindow *window);
extern void WXDLLIMPEXP_CORE wxDisplaySizeMM(int *width, int *height);
extern wxSize WXDLLIMPEXP_CORE wxGetDisplaySizeMM();
extern wxSize WXDLLIMPEXP_CORE wxGetDisplayPPI();
diff --git a/include/wx/generic/grid.h b/include/wx/generic/grid.h
index 1bd58bbf04..903cb81319 100644
--- a/include/wx/generic/grid.h
+++ b/include/wx/generic/grid.h
@@ -3029,9 +3029,11 @@ private:
// Update the width/height of the column/row being drag-resized.
// Should be only called when m_dragRowOrCol != -1, i.e. dragging is
// actually in progress.
+ //BBS: add cursor mode for DoGridDragResize's paremeters
void DoGridDragResize(const wxPoint& position,
const wxGridOperations& oper,
- wxGridWindow* gridWindow);
+ wxGridWindow* gridWindow,
+ CursorMode mode);
// process different clicks on grid cells
void DoGridCellLeftDown(wxMouseEvent& event,
diff --git a/include/wx/msw/font.h b/include/wx/msw/font.h
index 0f9768b44e..094d774918 100644
--- a/include/wx/msw/font.h
+++ b/include/wx/msw/font.h
@@ -23,7 +23,7 @@ public:
// ctors and such
wxFont() { }
- wxFont(const wxFontInfo& info);
+ wxFont(const wxFontInfo& info, const wxWindow *window = nullptr);
wxFont(int size,
wxFontFamily family,
diff --git a/include/wx/msw/tooltip.h b/include/wx/msw/tooltip.h
index 4c3be08cec..96fb378d01 100644
--- a/include/wx/msw/tooltip.h
+++ b/include/wx/msw/tooltip.h
@@ -91,10 +91,10 @@ private:
// the one and only one tooltip control we use - never access it directly
// but use GetToolTipCtrl() which will create it when needed
static WXHWND ms_hwndTT;
-
+public:
// create the tooltip ctrl if it doesn't exist yet and return its HWND
static WXHWND GetToolTipCtrl();
-
+private:
// to be used in wxModule for deleting tooltip ctrl window when exiting mainloop
static void DeleteToolTipCtrl();
diff --git a/include/wx/osx/app.h b/include/wx/osx/app.h
index 317a0ca96f..58014ec1d4 100644
--- a/include/wx/osx/app.h
+++ b/include/wx/osx/app.h
@@ -161,7 +161,7 @@ private:
public:
bool OSXInitWasCalled() { return m_inited; }
- void OSXStoreOpenFiles(const wxArrayString &files ) { m_openFiles = files ; }
+ virtual void OSXStoreOpenFiles(const wxArrayString &files ) { m_openFiles = files ; }
void OSXStorePrintFiles(const wxArrayString &files ) { m_printFiles = files ; }
void OSXStoreOpenURL(const wxString &url ) { m_getURL = url ; }
#endif
diff --git a/src/common/combocmn.cpp b/src/common/combocmn.cpp
index 80408c6677..aa07caebdc 100644
--- a/src/common/combocmn.cpp
+++ b/src/common/combocmn.cpp
@@ -2061,6 +2061,9 @@ void wxComboCtrlBase::ShowPopup()
SetFocus();
+ //int displayIdx = wxDisplay::GetFromWindow(this);
+ //wxRect displayRect = wxDisplay(displayIdx != wxNOT_FOUND ? displayIdx : 0u).GetGeometry();
+
// Space above and below
int screenHeight;
wxPoint scrPos;
@@ -2183,9 +2186,13 @@ void wxComboCtrlBase::ShowPopup()
int showFlags = CanDeferShow;
- if ( spaceBelow < szp.y )
+ int anchorSideVertical = m_anchorSide & (wxUP | wxDOWN);
+ if (// Pop up as asked for by the library user.
+ (anchorSideVertical & wxUP) ||
+ // Automatic: Pop up if it does not fit down.
+ (anchorSideVertical == 0 && spaceBelow < szp.y ))
{
- popupY = scrPos.y - szp.y;
+ popupY = scrPos.y - szp.y + displayRect.GetTop();
showFlags |= ShowAbove;
}
diff --git a/src/common/datavcmn.cpp b/src/common/datavcmn.cpp
index 0a1e43ad51..6c492aedab 100644
--- a/src/common/datavcmn.cpp
+++ b/src/common/datavcmn.cpp
@@ -1334,7 +1334,11 @@ wxDataViewItem wxDataViewCtrlBase::GetSelection() const
wxDataViewItemArray selections;
GetSelections(selections);
- return selections[0];
+ // BBS
+ if (!selections.empty())
+ return selections[0];
+ else
+ return wxDataViewItem(0);
}
namespace
diff --git a/src/common/dcbufcmn.cpp b/src/common/dcbufcmn.cpp
index 9b1c1f3159..ef5865ed4b 100644
--- a/src/common/dcbufcmn.cpp
+++ b/src/common/dcbufcmn.cpp
@@ -83,9 +83,15 @@ private:
const double scale = dc ? dc->GetContentScaleFactor() : 1.0;
wxBitmap* const buffer = new wxBitmap;
+#if __WXMSW__
+ // we must always return a valid bitmap but creating a bitmap of
+ // size 0 would fail, so create a 1*1 bitmap in this case
+ buffer->Create(wxMax(w, 1), wxMax(h, 1), 24);
+#else
// we must always return a valid bitmap but creating a bitmap of
// size 0 would fail, so create a 1*1 bitmap in this case
buffer->CreateWithDIPSize(wxMax(w, 1), wxMax(h, 1), scale);
+#endif
return buffer;
}
diff --git a/src/common/gdicmn.cpp b/src/common/gdicmn.cpp
index db8a01f961..162c1ce2dc 100644
--- a/src/common/gdicmn.cpp
+++ b/src/common/gdicmn.cpp
@@ -863,11 +863,25 @@ void wxDisplaySize(int *width, int *height)
*height = size.y;
}
+void wxDisplaySize(const wxWindow *window, int *width, int *height)
+{
+ const wxSize size = wxGetDisplaySize(window);
+ if ( width )
+ *width = size.x;
+ if ( height )
+ *height = size.y;
+}
+
wxSize wxGetDisplaySize()
{
return wxDisplay().GetGeometry().GetSize();
}
+wxSize wxGetDisplaySize(const wxWindow *window)
+{
+ return window ? wxDisplay(window).GetGeometry().GetSize() : wxDisplay().GetGeometry().GetSize();
+}
+
void wxClientDisplayRect(int *x, int *y, int *width, int *height)
{
const wxRect rect = wxGetClientDisplayRect();
diff --git a/src/common/image.cpp b/src/common/image.cpp
index 19fe34ec91..a449b60930 100644
--- a/src/common/image.cpp
+++ b/src/common/image.cpp
@@ -390,11 +390,11 @@ wxImage wxImage::ShrinkBy( int xFactor , int yFactor ) const
unsigned char red = pixel[0] ;
unsigned char green = pixel[1] ;
unsigned char blue = pixel[2] ;
- unsigned char alpha = 255 ;
- if ( source_alpha )
- alpha = *(source_alpha + y_offset + x * xFactor + x1) ;
if ( !hasMask || red != maskRed || green != maskGreen || blue != maskBlue )
{
+ unsigned char alpha = 255 ;
+ if ( source_alpha )
+ alpha = *(source_alpha + y_offset + x * xFactor + x1) ;
if ( alpha > 0 )
{
avgRed += red ;
diff --git a/src/generic/grid.cpp b/src/generic/grid.cpp
index ed3d988994..d71cda122d 100644
--- a/src/generic/grid.cpp
+++ b/src/generic/grid.cpp
@@ -4068,7 +4068,8 @@ void wxGrid::ProcessRowColLabelMouseEvent( const wxGridOperations &oper, wxMouse
{
if ( m_cursorMode == oper.GetCursorModeResize() )
{
- DoGridDragResize(event.GetPosition(), oper, gridWindow);
+ //BBS: add cursor mode for DoGridDragResize's paremeters
+ DoGridDragResize(event.GetPosition(), oper, gridWindow, m_cursorMode);
}
else if ( m_cursorMode == oper.GetCursorModeSelect() && line >=0 )
{
@@ -4691,12 +4692,14 @@ bool wxGrid::DoGridDragEvent(wxMouseEvent& event,
case WXGRID_CURSOR_RESIZE_ROW:
if ( m_dragRowOrCol != -1 )
- DoGridDragResize(event.GetPosition(), wxGridRowOperations(), gridWindow);
+ //BBS: add cursor mode for DoGridDragResize's paremeters
+ DoGridDragResize(event.GetPosition(), wxGridRowOperations(), gridWindow, WXGRID_CURSOR_RESIZE_ROW);
break;
case WXGRID_CURSOR_RESIZE_COL:
if ( m_dragRowOrCol != -1 )
- DoGridDragResize(event.GetPosition(), wxGridColumnOperations(), gridWindow);
+ //BBS: add cursor mode for DoGridDragResize's paremeters
+ DoGridDragResize(event.GetPosition(), wxGridColumnOperations(), gridWindow, WXGRID_CURSOR_RESIZE_COL);
break;
default:
@@ -4791,6 +4794,8 @@ wxGrid::DoGridCellLeftDown(wxMouseEvent& event,
case wxGridSelectCells:
case wxGridSelectRowsOrColumns:
// nothing to do in these cases
+ //BBS: select this cell when first click
+ m_selection->SelectBlock(coords.GetRow(), coords.GetCol(), coords.GetRow(), coords.GetCol(), event);
break;
case wxGridSelectRows:
@@ -5049,9 +5054,11 @@ void wxGrid::ProcessGridCellMouseEvent(wxMouseEvent& event, wxGridWindow *eventG
}
}
+//BBS: add cursor mode for DoGridDragResize's paremeters
void wxGrid::DoGridDragResize(const wxPoint& position,
const wxGridOperations& oper,
- wxGridWindow* gridWindow)
+ wxGridWindow* gridWindow,
+ CursorMode mode)
{
wxCHECK_RET( m_dragRowOrCol != -1,
"shouldn't be called when not drag resizing" );
@@ -5064,10 +5071,28 @@ void wxGrid::DoGridDragResize(const wxPoint& position,
// orthogonal direction.
const int linePos = oper.Dual().Select(logicalPos);
- const int lineStart = oper.GetLineStartPos(this, m_dragRowOrCol);
- oper.SetLineSize(this, m_dragRowOrCol,
+ //BBS: add logic for resize multiplexed cols
+ if (mode == WXGRID_CURSOR_RESIZE_COL) {
+ int col_to_resize = m_dragRowOrCol;
+ int num_rows, num_cols;
+ this->GetCellSize(0, m_dragRowOrCol, &num_rows, &num_cols);
+ if (num_cols < 1)
+ col_to_resize = m_dragRowOrCol - 1;
+
+ const int lineEnd = oper.GetLineEndPos(this, m_dragRowOrCol);
+ const int lineSize = oper.GetLineSize(this, col_to_resize);
+ int size = linePos - lineEnd + lineSize;
+ oper.SetLineSize(this, col_to_resize,
+ wxMax(size,
+ oper.GetMinimalLineSize(this, col_to_resize)));
+ }
+ else {
+ const int lineStart = oper.GetLineStartPos(this, m_dragRowOrCol);
+
+ oper.SetLineSize(this, m_dragRowOrCol,
wxMax(linePos - lineStart,
oper.GetMinimalLineSize(this, m_dragRowOrCol)));
+ }
// TODO: generate RESIZING event, see #10754, if the size has changed.
}
@@ -5090,7 +5115,8 @@ wxPoint wxGrid::GetPositionForResizeEvent(int width) const
void wxGrid::DoEndDragResizeRow(const wxMouseEvent& event, wxGridWindow* gridWindow)
{
- DoGridDragResize(event.GetPosition(), wxGridRowOperations(), gridWindow);
+ //BBS: add cursor mode for DoGridDragResize's paremeters
+ DoGridDragResize(event.GetPosition(), wxGridRowOperations(), gridWindow, WXGRID_CURSOR_RESIZE_ROW);
SendGridSizeEvent(wxEVT_GRID_ROW_SIZE, m_dragRowOrCol, event);
@@ -5099,7 +5125,8 @@ void wxGrid::DoEndDragResizeRow(const wxMouseEvent& event, wxGridWindow* gridWin
void wxGrid::DoEndDragResizeCol(const wxMouseEvent& event, wxGridWindow* gridWindow)
{
- DoGridDragResize(event.GetPosition(), wxGridColumnOperations(), gridWindow);
+ //BBS: add cursor mode for DoGridDragResize's paremeters
+ DoGridDragResize(event.GetPosition(), wxGridColumnOperations(), gridWindow, WXGRID_CURSOR_RESIZE_COL);
SendGridSizeEvent(wxEVT_GRID_COL_SIZE, m_dragRowOrCol, event);
@@ -5113,9 +5140,10 @@ void wxGrid::DoHeaderStartDragResizeCol(int col)
void wxGrid::DoHeaderDragResizeCol(int width)
{
+ //BBS: add cursor mode for DoGridDragResize's paremeters
DoGridDragResize(GetPositionForResizeEvent(width),
wxGridColumnOperations(),
- m_gridWin);
+ m_gridWin, WXGRID_CURSOR_RESIZE_COL);
}
void wxGrid::DoHeaderEndDragResizeCol(int width)
@@ -6013,6 +6041,10 @@ void wxGrid::OnKeyDown( wxKeyEvent& event )
DisableCellEditControl();
MoveCursorDown( event.ShiftDown() );
+ //BBS: select this cell when first click
+ m_selection->SelectBlock(m_currentCellCoords.GetRow(), m_currentCellCoords.GetCol(),
+ m_currentCellCoords.GetRow(), m_currentCellCoords.GetCol(),
+ event);
}
break;
diff --git a/src/msw/bmpcbox.cpp b/src/msw/bmpcbox.cpp
index 011bd4f534..17e7f18740 100644
--- a/src/msw/bmpcbox.cpp
+++ b/src/msw/bmpcbox.cpp
@@ -156,13 +156,20 @@ void wxBitmapComboBox::RecreateControl()
wxComboBox::DoClear();
- HWND hwnd = GetHwnd();
+ WNDPROC wndproc_edit = nullptr;
+ WinStruct<COMBOBOXINFO> combobox_info;
+ HWND hwnd = GetHwnd();
+if (::GetComboBoxInfo(hwnd, &combobox_info))
+ wndproc_edit = (WNDPROC)wxGetWindowProc(combobox_info.hwndItem);
DissociateHandle();
::DestroyWindow(hwnd);
if ( !MSWCreateControl(wxT("COMBOBOX"), wxEmptyString, pos, size) )
return;
+if (::GetComboBoxInfo(GetHwnd(), &combobox_info))
+ wxSetWindowProc(combobox_info.hwndItem, wndproc_edit);
+
// initialize the controls contents
for ( i = 0; i < numItems; i++ )
{
diff --git a/src/msw/font.cpp b/src/msw/font.cpp
index 434876939c..91d4603018 100644
--- a/src/msw/font.cpp
+++ b/src/msw/font.cpp
@@ -54,7 +54,7 @@ static const int PITCH_MASK = FIXED_PITCH | VARIABLE_PITCH;
class WXDLLEXPORT wxFontRefData: public wxGDIRefData
{
public:
- wxFontRefData(const wxFontInfo& info = wxFontInfo());
+ wxFontRefData(const wxFontInfo& info = wxFontInfo(), const wxWindow* window = nullptr);
wxFontRefData(const wxNativeFontInfo& info, WXHFONT hFont = 0)
{
@@ -324,7 +324,7 @@ protected:
// wxFontRefData
// ----------------------------------------------------------------------------
-wxFontRefData::wxFontRefData(const wxFontInfo& info)
+wxFontRefData::wxFontRefData(const wxFontInfo& info, const wxWindow *window)
{
m_hFont = NULL;
@@ -335,7 +335,7 @@ wxFontRefData::wxFontRefData(const wxFontInfo& info)
}
else
{
- m_nativeFontInfo.SetSizeOrDefault(info.GetFractionalPointSize());
+ m_nativeFontInfo.SetSizeOrDefault(info.GetFractionalPointSize(), window);
}
SetStyle(info.GetStyle());
@@ -518,12 +518,12 @@ wxFontEncoding wxNativeFontInfo::GetEncoding() const
return wxGetFontEncFromCharSet(lf.lfCharSet);
}
-void wxNativeFontInfo::SetFractionalPointSize(double pointSizeNew)
+void wxNativeFontInfo::SetFractionalPointSize(double pointSizeNew, const wxWindow *window)
{
// We don't have the correct DPI to use here, so use that of the
// primary screen and rely on WXAdjustToPPI() changing it later if
// necessary.
- const int ppi = ::GetDeviceCaps(ScreenHDC(), LOGPIXELSY);
+ const int ppi = window ? window->GetDPI().GetY() : ::GetDeviceCaps(ScreenHDC(), LOGPIXELSY);
lf.lfHeight = GetLogFontHeightAtPPI(pointSizeNew, ppi);
pointSize = pointSizeNew;
@@ -812,9 +812,9 @@ wxFont::wxFont(const wxString& fontdesc)
(void)Create(info);
}
-wxFont::wxFont(const wxFontInfo& info)
+wxFont::wxFont(const wxFontInfo& info, const wxWindow *window)
{
- m_refData = new wxFontRefData(info);
+ m_refData = new wxFontRefData(info, window);
}
bool wxFont::Create(const wxNativeFontInfo& info, WXHFONT hFont)
diff --git a/src/msw/menuitem.cpp b/src/msw/menuitem.cpp
index 0bd017a36a..3b98bf1678 100644
--- a/src/msw/menuitem.cpp
+++ b/src/msw/menuitem.cpp
@@ -368,6 +368,8 @@ void MenuDrawData::Init(wxWindow const* window)
// native menu uses small top margin for separator
if ( SeparatorMargin.cyTopHeight >= 2 )
SeparatorMargin.cyTopHeight -= 2;
+
+ SeparatorSize.cy = 0;
}
else
#endif // wxUSE_UXTHEME
diff --git a/src/msw/window.cpp b/src/msw/window.cpp
index c529a4fa3b..7e547c64df 100644
--- a/src/msw/window.cpp
+++ b/src/msw/window.cpp
@@ -4809,33 +4809,49 @@ static wxSize GetWindowDPI(HWND hwnd)
}
/*extern*/
-int wxGetSystemMetrics(int nIndex, const wxWindow* window)
+int wxGetSystemMetrics(int nIndex, const wxWindow* win)
{
#if wxUSE_DYNLIB_CLASS
- if ( !window )
- window = wxApp::GetMainTopWindow();
+ const wxWindow* window = (!win && wxTheApp) ? wxTheApp->GetTopWindow() : win;
- if ( window )
+ if (window)
{
- typedef int (WINAPI * GetSystemMetricsForDpi_t)(int nIndex, UINT dpi);
- static GetSystemMetricsForDpi_t s_pfnGetSystemMetricsForDpi = NULL;
- static bool s_initDone = false;
-
- if ( !s_initDone )
- {
- wxLoadedDLL dllUser32("user32.dll");
- wxDL_INIT_FUNC(s_pfn, GetSystemMetricsForDpi, dllUser32);
- s_initDone = true;
+#if 1
+ if (window->GetHWND() && (nIndex == SM_CXSCREEN || nIndex == SM_CYSCREEN)) {
+ HDC hdc = GetDC(window->GetHWND());
+#if 0
+ double dim = GetDeviceCaps(hdc, nIndex == SM_CXSCREEN ? HORZRES : VERTRES);
+ ReleaseDC(window->GetHWND(), hdc);
+ wxSize dpi = window->GetDPI();
+ dim *= 96.0 / (nIndex == SM_CXSCREEN ? dpi.x : dpi.y);
+ return int(dim + 0.5);
+#else
+ return int(GetDeviceCaps(hdc, nIndex == SM_CXSCREEN ? HORZRES : VERTRES));
+#endif
}
-
- if ( s_pfnGetSystemMetricsForDpi )
+ else
+#endif
{
- const int dpi = window->GetDPI().y;
- return s_pfnGetSystemMetricsForDpi(nIndex, (UINT)dpi);
+ typedef int (WINAPI * GetSystemMetricsForDpi_t)(int nIndex, UINT dpi);
+ static GetSystemMetricsForDpi_t s_pfnGetSystemMetricsForDpi = NULL;
+ static bool s_initDone = false;
+
+ if ( !s_initDone )
+ {
+ wxLoadedDLL dllUser32("user32.dll");
+ wxDL_INIT_FUNC(s_pfn, GetSystemMetricsForDpi, dllUser32);
+ s_initDone = true;
+ }
+
+ if ( s_pfnGetSystemMetricsForDpi )
+ {
+ const int dpi = window->GetDPI().y;
+ return s_pfnGetSystemMetricsForDpi(nIndex, (UINT)dpi);
+ }
}
}
#else
- wxUnusedVar(window);
+ wxUnusedVar(win);
#endif // wxUSE_DYNLIB_CLASS
return ::GetSystemMetrics(nIndex);
diff --git a/src/osx/cocoa/dataview.mm b/src/osx/cocoa/dataview.mm
index f188e61089..7b867002d1 100644
--- a/src/osx/cocoa/dataview.mm
+++ b/src/osx/cocoa/dataview.mm
@@ -1604,6 +1604,15 @@ outlineView:(NSOutlineView*)outlineView
}
}
+//FIXME Vojtech: This is a workaround to get at least the "mouse move" events at the wxDataViewControl,
+// so we can show the tooltips. The "mouse move" events are being send only if the wxDataViewControl
+// has focus, which is a limitation of wxWidgets. We may grab focus on "mouse entry" though.
+- (void)mouseMoved:(NSEvent *)event
+{
+if (! implementation->DoHandleMouseEvent(event))
+ [super mouseMoved:event];
+}
+
//
// contextual menus
//
@@ -2006,7 +2015,8 @@ void wxCocoaDataViewControl::keyEvent(WX_NSEvent event, WXWidget slf, void *_cmd
if ( !dvc->GetEventHandler()->ProcessEvent(eventDV) )
wxWidgetCocoaImpl::keyEvent(event, slf, _cmd);
}
- else
+ //FIXME Vojtech's hack to get the accelerators assigned to the wxDataViewControl working.
+ else if (! DoHandleKeyEvent(event))
{
wxWidgetCocoaImpl::keyEvent(event, slf, _cmd); // all other keys
}
@@ -2540,12 +2550,22 @@ void wxCocoaDataViewControl::DoSetIndent(int indent)
void wxCocoaDataViewControl::HitTest(const wxPoint& point, wxDataViewItem& item, wxDataViewColumn*& columnPtr) const
{
- NSPoint const nativePoint = wxToNSPoint((NSScrollView*) GetWXWidget(),point);
+ NSTableHeaderView *headerView = [m_OutlineView headerView];
+ if (headerView && point.y < headerView.visibleRect.size.height) {
+ // The point is inside the header area.
+ columnPtr = NULL;
+ item = wxDataViewItem();
+ return;
+ }
+ // Convert from the window coordinates to the virtual scrolled view coordinates.
+ NSScrollView *scrollView = [m_OutlineView enclosingScrollView];
+ const NSRect &visibleRect = scrollView.contentView.visibleRect;
+ NSPoint const nativePoint = wxToNSPoint((NSScrollView*) GetWXWidget(),
+ wxPoint(point.x + visibleRect.origin.x, point.y + visibleRect.origin.y));
int indexColumn;
int indexRow;
-
indexColumn = [m_OutlineView columnAtPoint:nativePoint];
indexRow = [m_OutlineView rowAtPoint: nativePoint];
if ((indexColumn >= 0) && (indexRow >= 0))
diff --git a/src/osx/cocoa/settings.mm b/src/osx/cocoa/settings.mm
index c819deeb0c..dc3c3b0b53 100644
--- a/src/osx/cocoa/settings.mm
+++ b/src/osx/cocoa/settings.mm
@@ -222,7 +222,7 @@ wxFont wxSystemSettingsNative::GetFont(wxSystemFont index)
// ----------------------------------------------------------------------------
// Get a system metric, e.g. scrollbar size
-int wxSystemSettingsNative::GetMetric(wxSystemMetric index, const wxWindow* WXUNUSED(win))
+int wxSystemSettingsNative::GetMetric(wxSystemMetric index, const wxWindow* win)
{
int value;
@@ -257,11 +257,11 @@ int wxSystemSettingsNative::GetMetric(wxSystemMetric index, const wxWindow* WXUN
// TODO case wxSYS_WINDOWMIN_Y:
case wxSYS_SCREEN_X:
- wxDisplaySize(&value, NULL);
+ wxDisplaySize(win, &value, NULL);
return value;
case wxSYS_SCREEN_Y:
- wxDisplaySize(NULL, &value);
+ wxDisplaySize(win, NULL, &value);
return value;
// TODO case wxSYS_FRAMESIZE_X:
diff --git a/src/osx/cocoa/window.mm b/src/osx/cocoa/window.mm
index 635ea286d4..42ae67e27a 100644
--- a/src/osx/cocoa/window.mm
+++ b/src/osx/cocoa/window.mm
@@ -191,6 +191,9 @@ NSRect wxOSXGetFrameForControl( wxWindowMac* window , const wxPoint& pos , const
- (BOOL)isEnabled;
- (void)setEnabled:(BOOL)flag;
+- (BOOL)clipsToBounds;
+- (void)setClipsToBounds:(BOOL)clipsToBounds;
+
- (void)setImage:(NSImage *)image;
- (void)setControlSize:(NSControlSize)size;
@@ -2559,6 +2562,7 @@ wxWidgetImpl( peer, flags )
if ( m_osxView )
CFRetain(m_osxView);
[m_osxView release];
+ m_osxView.clipsToBounds = YES;
}
--
2.42.0.windows.2

View File

@@ -0,0 +1,743 @@
From 5e82980ed1762338794d06b3f9f22fa10e050622 Mon Sep 17 00:00:00 2001
From: SoftFever <softfeverever@gmail.com>
Date: Sat, 23 Dec 2023 20:08:41 +0800
Subject: [PATCH] wx 3.1.5 patch for Orca
---
build/cmake/init.cmake | 4 ++
build/cmake/lib/webview/CMakeLists.txt | 4 +-
include/wx/fontutil.h | 15 +++++++-
include/wx/gdicmn.h | 3 ++
include/wx/generic/grid.h | 4 +-
include/wx/msw/font.h | 2 +-
include/wx/msw/tooltip.h | 4 +-
include/wx/osx/app.h | 2 +-
src/common/combocmn.cpp | 13 +++++--
src/common/datavcmn.cpp | 6 ++-
src/common/dcbufcmn.cpp | 8 +++-
src/common/gdicmn.cpp | 14 +++++++
src/common/image.cpp | 6 +--
src/common/intl.cpp | 7 ++++
src/generic/grid.cpp | 53 +++++++++++++++++++++-----
src/msw/bmpcbox.cpp | 9 ++++-
src/msw/font.cpp | 14 +++----
src/msw/menuitem.cpp | 2 +
src/msw/window.cpp | 52 ++++++++++++++++---------
src/osx/cocoa/dataview.mm | 26 +++++++++++--
src/osx/cocoa/settings.mm | 6 +--
src/osx/cocoa/window.mm | 4 ++
22 files changed, 199 insertions(+), 59 deletions(-)
diff --git a/build/cmake/init.cmake b/build/cmake/init.cmake
index 0bc4f934b9..479431a69c 100644
--- a/build/cmake/init.cmake
+++ b/build/cmake/init.cmake
@@ -413,7 +413,11 @@ if(wxUSE_GUI)
else()
find_package(OpenGL)
if(WXGTK3 AND OpenGL_EGL_FOUND AND wxUSE_GLCANVAS_EGL)
+ if(UNIX AND NOT APPLE)
+ set(OPENGL_LIBRARIES OpenGL EGL)
+ else()
set(OPENGL_LIBRARIES OpenGL::OpenGL OpenGL::EGL)
+ endif()
find_package(WAYLANDEGL)
if(WAYLANDEGL_FOUND AND wxHAVE_GDK_WAYLAND)
list(APPEND OPENGL_LIBRARIES ${WAYLANDEGL_LIBRARIES})
diff --git a/build/cmake/lib/webview/CMakeLists.txt b/build/cmake/lib/webview/CMakeLists.txt
index cc3298ff33..aa103ae474 100644
--- a/build/cmake/lib/webview/CMakeLists.txt
+++ b/build/cmake/lib/webview/CMakeLists.txt
@@ -56,9 +56,9 @@ if(APPLE)
elseif(WXMSW)
if(wxUSE_WEBVIEW_EDGE)
# Update the following variables if updating WebView2 SDK
- set(WEBVIEW2_VERSION "1.0.705.50")
+ set(WEBVIEW2_VERSION "1.0.1418.22")
set(WEBVIEW2_URL "https://www.nuget.org/api/v2/package/Microsoft.Web.WebView2/${WEBVIEW2_VERSION}")
- set(WEBVIEW2_SHA256 "6a34bb553e18cfac7297b4031f3eac2558e439f8d16a45945c22945ac404105d")
+ set(WEBVIEW2_SHA256 "51d2ef56196e2a9d768a6843385bcb9c6baf9ed34b2603ddb074fb4995543a99")
set(WEBVIEW2_DEFAULT_PACKAGE_DIR "${CMAKE_BINARY_DIR}/packages/Microsoft.Web.WebView2.${WEBVIEW2_VERSION}")
diff --git a/include/wx/fontutil.h b/include/wx/fontutil.h
index 09ad8c8ef3..c228e167d7 100644
--- a/include/wx/fontutil.h
+++ b/include/wx/fontutil.h
@@ -294,7 +294,11 @@ public:
wxFontEncoding GetEncoding() const;
void SetPointSize(int pointsize);
- void SetFractionalPointSize(double pointsize);
+ void SetFractionalPointSize(double pointsize
+#if defined(__WXMSW__)
+ , const wxWindow *window = nullptr
+#endif
+ );
void SetPixelSize(const wxSize& pixelSize);
void SetStyle(wxFontStyle style);
void SetNumericWeight(int weight);
@@ -307,12 +311,19 @@ public:
// Helper used in many ports: use the normal font size if the input is
// negative, as we handle -1 as meaning this for compatibility.
- void SetSizeOrDefault(double size)
+ void SetSizeOrDefault(double size
+#if defined(__WXMSW__)
+ , const wxWindow *window = nullptr
+#endif
+ )
{
SetFractionalPointSize
(
size < 0 ? wxNORMAL_FONT->GetFractionalPointSize()
: size
+#if defined(__WXMSW__)
+ ,window
+#endif
);
}
diff --git a/include/wx/gdicmn.h b/include/wx/gdicmn.h
index e29a77627c..dc48cf9451 100644
--- a/include/wx/gdicmn.h
+++ b/include/wx/gdicmn.h
@@ -38,6 +38,7 @@ class WXDLLIMPEXP_FWD_CORE wxRegion;
class WXDLLIMPEXP_FWD_BASE wxString;
class WXDLLIMPEXP_FWD_CORE wxIconBundle;
class WXDLLIMPEXP_FWD_CORE wxPoint;
+class WXDLLIMPEXP_FWD_CORE wxWindow;
// ---------------------------------------------------------------------------
// constants
@@ -1092,7 +1093,9 @@ extern int WXDLLIMPEXP_CORE wxDisplayDepth();
// get the display size
extern void WXDLLIMPEXP_CORE wxDisplaySize(int *width, int *height);
+extern void WXDLLIMPEXP_CORE wxDisplaySize(const wxWindow *window, int *width, int *height);
extern wxSize WXDLLIMPEXP_CORE wxGetDisplaySize();
+extern wxSize WXDLLIMPEXP_CORE wxGetDisplaySize(const wxWindow *window);
extern void WXDLLIMPEXP_CORE wxDisplaySizeMM(int *width, int *height);
extern wxSize WXDLLIMPEXP_CORE wxGetDisplaySizeMM();
extern wxSize WXDLLIMPEXP_CORE wxGetDisplayPPI();
diff --git a/include/wx/generic/grid.h b/include/wx/generic/grid.h
index d7a3890764..e4dee51d5a 100644
--- a/include/wx/generic/grid.h
+++ b/include/wx/generic/grid.h
@@ -2951,9 +2951,11 @@ private:
wxGridWindow* gridWindow);
// Update the width/height of the column/row being drag-resized.
+ //BBS: add cursor mode for DoGridDragResize's paremeters
void DoGridDragResize(const wxPoint& position,
const wxGridOperations& oper,
- wxGridWindow* gridWindow);
+ wxGridWindow* gridWindow,
+ CursorMode mode);
// process different clicks on grid cells
void DoGridCellLeftDown(wxMouseEvent& event,
diff --git a/include/wx/msw/font.h b/include/wx/msw/font.h
index 0f9768b44e..094d774918 100644
--- a/include/wx/msw/font.h
+++ b/include/wx/msw/font.h
@@ -23,7 +23,7 @@ public:
// ctors and such
wxFont() { }
- wxFont(const wxFontInfo& info);
+ wxFont(const wxFontInfo& info, const wxWindow *window = nullptr);
wxFont(int size,
wxFontFamily family,
diff --git a/include/wx/msw/tooltip.h b/include/wx/msw/tooltip.h
index 4c3be08cec..96fb378d01 100644
--- a/include/wx/msw/tooltip.h
+++ b/include/wx/msw/tooltip.h
@@ -91,10 +91,10 @@ private:
// the one and only one tooltip control we use - never access it directly
// but use GetToolTipCtrl() which will create it when needed
static WXHWND ms_hwndTT;
-
+public:
// create the tooltip ctrl if it doesn't exist yet and return its HWND
static WXHWND GetToolTipCtrl();
-
+private:
// to be used in wxModule for deleting tooltip ctrl window when exiting mainloop
static void DeleteToolTipCtrl();
diff --git a/include/wx/osx/app.h b/include/wx/osx/app.h
index 317a0ca96f..58014ec1d4 100644
--- a/include/wx/osx/app.h
+++ b/include/wx/osx/app.h
@@ -161,7 +161,7 @@ private:
public:
bool OSXInitWasCalled() { return m_inited; }
- void OSXStoreOpenFiles(const wxArrayString &files ) { m_openFiles = files ; }
+ virtual void OSXStoreOpenFiles(const wxArrayString &files ) { m_openFiles = files ; }
void OSXStorePrintFiles(const wxArrayString &files ) { m_printFiles = files ; }
void OSXStoreOpenURL(const wxString &url ) { m_getURL = url ; }
#endif
diff --git a/src/common/combocmn.cpp b/src/common/combocmn.cpp
index b61aac35bf..7cfc97d2f8 100644
--- a/src/common/combocmn.cpp
+++ b/src/common/combocmn.cpp
@@ -2141,7 +2141,7 @@ void wxComboCtrlBase::CreatePopup()
#if !USES_GENERICTLW
m_winPopup = new wxComboPopupWindowBase2( this, wxNO_BORDER );
#else
- int tlwFlags = wxNO_BORDER;
+ int tlwFlags = wxNO_BORDER | wxSTAY_ON_TOP;
#ifdef wxCC_GENERIC_TLW_IS_FRAME
tlwFlags |= wxFRAME_NO_TASKBAR;
#endif
@@ -2285,6 +2285,9 @@ void wxComboCtrlBase::ShowPopup()
SetFocus();
+ //int displayIdx = wxDisplay::GetFromWindow(this);
+ //wxRect displayRect = wxDisplay(displayIdx != wxNOT_FOUND ? displayIdx : 0u).GetGeometry();
+
// Space above and below
int screenHeight;
wxPoint scrPos;
@@ -2407,9 +2410,13 @@ void wxComboCtrlBase::ShowPopup()
int showFlags = CanDeferShow;
- if ( spaceBelow < szp.y )
+ int anchorSideVertical = m_anchorSide & (wxUP | wxDOWN);
+ if (// Pop up as asked for by the library user.
+ (anchorSideVertical & wxUP) ||
+ // Automatic: Pop up if it does not fit down.
+ (anchorSideVertical == 0 && spaceBelow < szp.y ))
{
- popupY = scrPos.y - szp.y;
+ popupY = scrPos.y - szp.y + displayRect.GetTop();
showFlags |= ShowAbove;
}
diff --git a/src/common/datavcmn.cpp b/src/common/datavcmn.cpp
index 1f5fd4d66b..14ea2f8ef1 100644
--- a/src/common/datavcmn.cpp
+++ b/src/common/datavcmn.cpp
@@ -1322,7 +1322,11 @@ wxDataViewItem wxDataViewCtrlBase::GetSelection() const
wxDataViewItemArray selections;
GetSelections(selections);
- return selections[0];
+ // BBS
+ if (!selections.empty())
+ return selections[0];
+ else
+ return wxDataViewItem(0);
}
namespace
diff --git a/src/common/dcbufcmn.cpp b/src/common/dcbufcmn.cpp
index 74958fce10..59844f4526 100644
--- a/src/common/dcbufcmn.cpp
+++ b/src/common/dcbufcmn.cpp
@@ -82,9 +82,15 @@ private:
const double scale = dc ? dc->GetContentScaleFactor() : 1.0;
wxBitmap* const buffer = new wxBitmap;
+#if __WXMSW__
// we must always return a valid bitmap but creating a bitmap of
// size 0 would fail, so create a 1*1 bitmap in this case
- buffer->CreateScaled(wxMax(w, 1), wxMax(h, 1), -1, scale);
+ buffer->Create(wxMax(w, 1), wxMax(h, 1), 24);
+#else
+ // we must always return a valid bitmap but creating a bitmap of
+ // size 0 would fail, so create a 1*1 bitmap in this case
+ buffer->CreateScaled(wxMax(w, 1), wxMax(h, 1), -1, scale);
+#endif
return buffer;
}
diff --git a/src/common/gdicmn.cpp b/src/common/gdicmn.cpp
index 20442bbc73..bc2c35bee6 100644
--- a/src/common/gdicmn.cpp
+++ b/src/common/gdicmn.cpp
@@ -863,11 +863,25 @@ void wxDisplaySize(int *width, int *height)
*height = size.y;
}
+void wxDisplaySize(const wxWindow *window, int *width, int *height)
+{
+ const wxSize size = wxGetDisplaySize(window);
+ if ( width )
+ *width = size.x;
+ if ( height )
+ *height = size.y;
+}
+
wxSize wxGetDisplaySize()
{
return wxDisplay().GetGeometry().GetSize();
}
+wxSize wxGetDisplaySize(const wxWindow *window)
+{
+ return window ? wxDisplay(window).GetGeometry().GetSize() : wxDisplay().GetGeometry().GetSize();
+}
+
void wxClientDisplayRect(int *x, int *y, int *width, int *height)
{
const wxRect rect = wxGetClientDisplayRect();
diff --git a/src/common/image.cpp b/src/common/image.cpp
index 78fe5b82a3..46db8722ce 100644
--- a/src/common/image.cpp
+++ b/src/common/image.cpp
@@ -383,11 +383,11 @@ wxImage wxImage::ShrinkBy( int xFactor , int yFactor ) const
unsigned char red = pixel[0] ;
unsigned char green = pixel[1] ;
unsigned char blue = pixel[2] ;
- unsigned char alpha = 255 ;
- if ( source_alpha )
- alpha = *(source_alpha + y_offset + x * xFactor + x1) ;
if ( !hasMask || red != maskRed || green != maskGreen || blue != maskBlue )
{
+ unsigned char alpha = 255 ;
+ if ( source_alpha )
+ alpha = *(source_alpha + y_offset + x * xFactor + x1) ;
if ( alpha > 0 )
{
avgRed += red ;
diff --git a/src/common/intl.cpp b/src/common/intl.cpp
index 0b0d8798f4..294f542b1f 100644
--- a/src/common/intl.cpp
+++ b/src/common/intl.cpp
@@ -1628,6 +1628,12 @@ GetInfoFromLCID(LCID lcid,
{
str = buf;
+//FIXME Vojtech: We forcefully set the locales for a decimal point to "C", but this
+// is not possible for the Win32 locales, therefore there is a discrepancy.
+// It looks like we live with the discrepancy for at least half a year, so we will
+// suppress the assert until we fix Slic3r to properly switch to "C" locales just
+// for file import / export.
+#if 0
// As we get our decimal point separator from Win32 and not the
// CRT there is a possibility of mismatch between them and this
// can easily happen if the user code called setlocale()
@@ -1641,6 +1647,7 @@ GetInfoFromLCID(LCID lcid,
"Decimal separator mismatch -- did you use setlocale()?"
"If so, use wxLocale to change the locale instead."
);
+#endif
}
break;
diff --git a/src/generic/grid.cpp b/src/generic/grid.cpp
index 41fd4524cf..f4a15cb839 100644
--- a/src/generic/grid.cpp
+++ b/src/generic/grid.cpp
@@ -3824,7 +3824,8 @@ void wxGrid::ProcessRowLabelMouseEvent( wxMouseEvent& event, wxGridRowLabelWindo
{
case WXGRID_CURSOR_RESIZE_ROW:
{
- DoGridDragResize(event.GetPosition(), wxGridRowOperations(), gridWindow);
+ //BBS: add cursor mode for DoGridDragResize's paremeters
+ DoGridDragResize(event.GetPosition(), wxGridRowOperations(), gridWindow, WXGRID_CURSOR_RESIZE_ROW);
}
break;
@@ -4166,7 +4167,8 @@ void wxGrid::ProcessColLabelMouseEvent( wxMouseEvent& event, wxGridColLabelWindo
switch ( m_cursorMode )
{
case WXGRID_CURSOR_RESIZE_COL:
- DoGridDragResize(event.GetPosition(), wxGridColumnOperations(), gridWindow);
+ //BBS: add cursor mode for DoGridDragResize's paremeters
+ DoGridDragResize(event.GetPosition(), wxGridColumnOperations(), gridWindow, WXGRID_CURSOR_RESIZE_COL);
break;
case WXGRID_CURSOR_SELECT_COL:
@@ -4708,11 +4710,13 @@ bool wxGrid::DoGridDragEvent(wxMouseEvent& event,
return DoGridCellDrag(event, coords, isFirstDrag);
case WXGRID_CURSOR_RESIZE_ROW:
- DoGridDragResize(event.GetPosition(), wxGridRowOperations(), gridWindow);
+ //BBS: add cursor mode for DoGridDragResize's paremeters
+ DoGridDragResize(event.GetPosition(), wxGridRowOperations(), gridWindow, WXGRID_CURSOR_RESIZE_ROW);
break;
case WXGRID_CURSOR_RESIZE_COL:
- DoGridDragResize(event.GetPosition(), wxGridColumnOperations(), gridWindow);
+ //BBS: add cursor mode for DoGridDragResize's paremeters
+ DoGridDragResize(event.GetPosition(), wxGridColumnOperations(), gridWindow, WXGRID_CURSOR_RESIZE_COL);
break;
default:
@@ -4803,6 +4807,8 @@ wxGrid::DoGridCellLeftDown(wxMouseEvent& event,
case wxGridSelectCells:
case wxGridSelectRowsOrColumns:
// nothing to do in these cases
+ //BBS: select this cell when first click
+ m_selection->SelectBlock(coords.GetRow(), coords.GetCol(), coords.GetRow(), coords.GetCol(), event);
break;
case wxGridSelectRows:
@@ -5044,9 +5050,11 @@ void wxGrid::ProcessGridCellMouseEvent(wxMouseEvent& event, wxGridWindow *eventG
}
}
+//BBS: add cursor mode for DoGridDragResize's paremeters
void wxGrid::DoGridDragResize(const wxPoint& position,
const wxGridOperations& oper,
- wxGridWindow* gridWindow)
+ wxGridWindow* gridWindow,
+ CursorMode mode)
{
// Get the logical position from the physical one we're passed.
const wxPoint
@@ -5056,10 +5064,28 @@ void wxGrid::DoGridDragResize(const wxPoint& position,
// orthogonal direction.
const int linePos = oper.Dual().Select(logicalPos);
- const int lineStart = oper.GetLineStartPos(this, m_dragRowOrCol);
- oper.SetLineSize(this, m_dragRowOrCol,
+ //BBS: add logic for resize multiplexed cols
+ if (mode == WXGRID_CURSOR_RESIZE_COL) {
+ int col_to_resize = m_dragRowOrCol;
+ int num_rows, num_cols;
+ this->GetCellSize(0, m_dragRowOrCol, &num_rows, &num_cols);
+ if (num_cols < 1)
+ col_to_resize = m_dragRowOrCol - 1;
+
+ const int lineEnd = oper.GetLineEndPos(this, m_dragRowOrCol);
+ const int lineSize = oper.GetLineSize(this, col_to_resize);
+ int size = linePos - lineEnd + lineSize;
+ oper.SetLineSize(this, col_to_resize,
+ wxMax(size,
+ oper.GetMinimalLineSize(this, col_to_resize)));
+ }
+ else {
+ const int lineStart = oper.GetLineStartPos(this, m_dragRowOrCol);
+
+ oper.SetLineSize(this, m_dragRowOrCol,
wxMax(linePos - lineStart,
oper.GetMinimalLineSize(this, m_dragRowOrCol)));
+ }
// TODO: generate RESIZING event, see #10754, if the size has changed.
}
@@ -5082,7 +5108,8 @@ wxPoint wxGrid::GetPositionForResizeEvent(int width) const
void wxGrid::DoEndDragResizeRow(const wxMouseEvent& event, wxGridWindow* gridWindow)
{
- DoGridDragResize(event.GetPosition(), wxGridRowOperations(), gridWindow);
+ //BBS: add cursor mode for DoGridDragResize's paremeters
+ DoGridDragResize(event.GetPosition(), wxGridRowOperations(), gridWindow, WXGRID_CURSOR_RESIZE_ROW);
SendGridSizeEvent(wxEVT_GRID_ROW_SIZE, m_dragRowOrCol, -1, event);
@@ -5091,7 +5118,8 @@ void wxGrid::DoEndDragResizeRow(const wxMouseEvent& event, wxGridWindow* gridWin
void wxGrid::DoEndDragResizeCol(const wxMouseEvent& event, wxGridWindow* gridWindow)
{
- DoGridDragResize(event.GetPosition(), wxGridColumnOperations(), gridWindow);
+ //BBS: add cursor mode for DoGridDragResize's paremeters
+ DoGridDragResize(event.GetPosition(), wxGridColumnOperations(), gridWindow, WXGRID_CURSOR_RESIZE_COL);
SendGridSizeEvent(wxEVT_GRID_COL_SIZE, -1, m_dragRowOrCol, event);
@@ -5105,9 +5133,10 @@ void wxGrid::DoHeaderStartDragResizeCol(int col)
void wxGrid::DoHeaderDragResizeCol(int width)
{
+ //BBS: add cursor mode for DoGridDragResize's paremeters
DoGridDragResize(GetPositionForResizeEvent(width),
wxGridColumnOperations(),
- m_gridWin);
+ m_gridWin, WXGRID_CURSOR_RESIZE_COL);
}
void wxGrid::DoHeaderEndDragResizeCol(int width)
@@ -5891,6 +5920,10 @@ void wxGrid::OnKeyDown( wxKeyEvent& event )
DisableCellEditControl();
MoveCursorDown( event.ShiftDown() );
+ //BBS: select this cell when first click
+ m_selection->SelectBlock(m_currentCellCoords.GetRow(), m_currentCellCoords.GetCol(),
+ m_currentCellCoords.GetRow(), m_currentCellCoords.GetCol(),
+ event);
}
break;
diff --git a/src/msw/bmpcbox.cpp b/src/msw/bmpcbox.cpp
index 0a2d167ad7..0aeba45ea9 100644
--- a/src/msw/bmpcbox.cpp
+++ b/src/msw/bmpcbox.cpp
@@ -156,13 +156,20 @@ void wxBitmapComboBox::RecreateControl()
wxComboBox::DoClear();
- HWND hwnd = GetHwnd();
+ WNDPROC wndproc_edit = nullptr;
+ WinStruct<COMBOBOXINFO> combobox_info;
+ HWND hwnd = GetHwnd();
+if (::GetComboBoxInfo(hwnd, &combobox_info))
+ wndproc_edit = (WNDPROC)wxGetWindowProc(combobox_info.hwndItem);
DissociateHandle();
::DestroyWindow(hwnd);
if ( !MSWCreateControl(wxT("COMBOBOX"), wxEmptyString, pos, size) )
return;
+if (::GetComboBoxInfo(GetHwnd(), &combobox_info))
+ wxSetWindowProc(combobox_info.hwndItem, wndproc_edit);
+
// initialize the controls contents
for ( i = 0; i < numItems; i++ )
{
diff --git a/src/msw/font.cpp b/src/msw/font.cpp
index 0bd240d79f..d38b1b00f5 100644
--- a/src/msw/font.cpp
+++ b/src/msw/font.cpp
@@ -54,7 +54,7 @@ static const int PITCH_MASK = FIXED_PITCH | VARIABLE_PITCH;
class WXDLLEXPORT wxFontRefData: public wxGDIRefData
{
public:
- wxFontRefData(const wxFontInfo& info = wxFontInfo());
+ wxFontRefData(const wxFontInfo& info = wxFontInfo(), const wxWindow* window = nullptr);
wxFontRefData(const wxNativeFontInfo& info, WXHFONT hFont = 0)
{
@@ -324,7 +324,7 @@ protected:
// wxFontRefData
// ----------------------------------------------------------------------------
-wxFontRefData::wxFontRefData(const wxFontInfo& info)
+wxFontRefData::wxFontRefData(const wxFontInfo& info, const wxWindow *window)
{
m_hFont = NULL;
@@ -335,7 +335,7 @@ wxFontRefData::wxFontRefData(const wxFontInfo& info)
}
else
{
- m_nativeFontInfo.SetSizeOrDefault(info.GetFractionalPointSize());
+ m_nativeFontInfo.SetSizeOrDefault(info.GetFractionalPointSize(), window);
}
SetStyle(info.GetStyle());
@@ -518,12 +518,12 @@ wxFontEncoding wxNativeFontInfo::GetEncoding() const
return wxGetFontEncFromCharSet(lf.lfCharSet);
}
-void wxNativeFontInfo::SetFractionalPointSize(double pointSizeNew)
+void wxNativeFontInfo::SetFractionalPointSize(double pointSizeNew, const wxWindow *window)
{
// We don't have the correct DPI to use here, so use that of the
// primary screen and rely on WXAdjustToPPI() changing it later if
// necessary.
- const int ppi = ::GetDeviceCaps(ScreenHDC(), LOGPIXELSY);
+ const int ppi = window ? window->GetDPI().GetY() : ::GetDeviceCaps(ScreenHDC(), LOGPIXELSY);
lf.lfHeight = GetLogFontHeightAtPPI(pointSizeNew, ppi);
pointSize = pointSizeNew;
@@ -812,9 +812,9 @@ wxFont::wxFont(const wxString& fontdesc)
(void)Create(info);
}
-wxFont::wxFont(const wxFontInfo& info)
+wxFont::wxFont(const wxFontInfo& info, const wxWindow *window)
{
- m_refData = new wxFontRefData(info);
+ m_refData = new wxFontRefData(info, window);
}
bool wxFont::Create(const wxNativeFontInfo& info, WXHFONT hFont)
diff --git a/src/msw/menuitem.cpp b/src/msw/menuitem.cpp
index 9bb397d472..30af7154a7 100644
--- a/src/msw/menuitem.cpp
+++ b/src/msw/menuitem.cpp
@@ -368,6 +368,8 @@ void MenuDrawData::Init(wxWindow const* window)
// native menu uses small top margin for separator
if ( SeparatorMargin.cyTopHeight >= 2 )
SeparatorMargin.cyTopHeight -= 2;
+
+ SeparatorSize.cy = 0;
}
else
#endif // wxUSE_UXTHEME
diff --git a/src/msw/window.cpp b/src/msw/window.cpp
index eadc2f5700..f64fea4446 100644
--- a/src/msw/window.cpp
+++ b/src/msw/window.cpp
@@ -4773,33 +4773,49 @@ static wxSize GetWindowDPI(HWND hwnd)
}
/*extern*/
-int wxGetSystemMetrics(int nIndex, const wxWindow* window)
+int wxGetSystemMetrics(int nIndex, const wxWindow* win)
{
#if wxUSE_DYNLIB_CLASS
- if ( !window )
- window = wxApp::GetMainTopWindow();
+ const wxWindow* window = (!win && wxTheApp) ? wxTheApp->GetTopWindow() : win;
- if ( window )
+ if (window)
{
- typedef int (WINAPI * GetSystemMetricsForDpi_t)(int nIndex, UINT dpi);
- static GetSystemMetricsForDpi_t s_pfnGetSystemMetricsForDpi = NULL;
- static bool s_initDone = false;
-
- if ( !s_initDone )
- {
- wxLoadedDLL dllUser32("user32.dll");
- wxDL_INIT_FUNC(s_pfn, GetSystemMetricsForDpi, dllUser32);
- s_initDone = true;
+#if 1
+ if (window->GetHWND() && (nIndex == SM_CXSCREEN || nIndex == SM_CYSCREEN)) {
+ HDC hdc = GetDC(window->GetHWND());
+#if 0
+ double dim = GetDeviceCaps(hdc, nIndex == SM_CXSCREEN ? HORZRES : VERTRES);
+ ReleaseDC(window->GetHWND(), hdc);
+ wxSize dpi = window->GetDPI();
+ dim *= 96.0 / (nIndex == SM_CXSCREEN ? dpi.x : dpi.y);
+ return int(dim + 0.5);
+#else
+ return int(GetDeviceCaps(hdc, nIndex == SM_CXSCREEN ? HORZRES : VERTRES));
+#endif
}
-
- if ( s_pfnGetSystemMetricsForDpi )
+ else
+#endif
{
- const int dpi = window->GetDPI().y;
- return s_pfnGetSystemMetricsForDpi(nIndex, (UINT)dpi);
+ typedef int (WINAPI * GetSystemMetricsForDpi_t)(int nIndex, UINT dpi);
+ static GetSystemMetricsForDpi_t s_pfnGetSystemMetricsForDpi = NULL;
+ static bool s_initDone = false;
+
+ if ( !s_initDone )
+ {
+ wxLoadedDLL dllUser32("user32.dll");
+ wxDL_INIT_FUNC(s_pfn, GetSystemMetricsForDpi, dllUser32);
+ s_initDone = true;
+ }
+
+ if ( s_pfnGetSystemMetricsForDpi )
+ {
+ const int dpi = window->GetDPI().y;
+ return s_pfnGetSystemMetricsForDpi(nIndex, (UINT)dpi);
+ }
}
}
#else
- wxUnusedVar(window);
+ wxUnusedVar(win);
#endif // wxUSE_DYNLIB_CLASS
return ::GetSystemMetrics(nIndex);
diff --git a/src/osx/cocoa/dataview.mm b/src/osx/cocoa/dataview.mm
index 6ff0cc3088..4943f3ea38 100644
--- a/src/osx/cocoa/dataview.mm
+++ b/src/osx/cocoa/dataview.mm
@@ -1734,12 +1734,22 @@ outlineView:(NSOutlineView*)outlineView
if ( !dvc->GetEventHandler()->ProcessEvent(eventDV) )
[super keyDown:event];
}
- else
+ //FIXME Vojtech's hack to get the accelerators assigned to the wxDataViewControl working.
+ else if (! implementation->DoHandleKeyEvent(event))
{
[super keyDown:event]; // all other keys
}
}
+//FIXME Vojtech: This is a workaround to get at least the "mouse move" events at the wxDataViewControl,
+// so we can show the tooltips. The "mouse move" events are being send only if the wxDataViewControl
+// has focus, which is a limitation of wxWidgets. We may grab focus on "mouse entry" though.
+- (void)mouseMoved:(NSEvent *)event
+{
+if (! implementation->DoHandleMouseEvent(event))
+ [super mouseMoved:event];
+}
+
//
// contextual menus
//
@@ -2672,12 +2682,22 @@ void wxCocoaDataViewControl::DoSetIndent(int indent)
void wxCocoaDataViewControl::HitTest(const wxPoint& point, wxDataViewItem& item, wxDataViewColumn*& columnPtr) const
{
- NSPoint const nativePoint = wxToNSPoint((NSScrollView*) GetWXWidget(),point);
+ NSTableHeaderView *headerView = [m_OutlineView headerView];
+ if (headerView && point.y < headerView.visibleRect.size.height) {
+ // The point is inside the header area.
+ columnPtr = NULL;
+ item = wxDataViewItem();
+ return;
+ }
+ // Convert from the window coordinates to the virtual scrolled view coordinates.
+ NSScrollView *scrollView = [m_OutlineView enclosingScrollView];
+ const NSRect &visibleRect = scrollView.contentView.visibleRect;
+ NSPoint const nativePoint = wxToNSPoint((NSScrollView*) GetWXWidget(),
+ wxPoint(point.x + visibleRect.origin.x, point.y + visibleRect.origin.y));
int indexColumn;
int indexRow;
-
indexColumn = [m_OutlineView columnAtPoint:nativePoint];
indexRow = [m_OutlineView rowAtPoint: nativePoint];
if ((indexColumn >= 0) && (indexRow >= 0))
diff --git a/src/osx/cocoa/settings.mm b/src/osx/cocoa/settings.mm
index de5f52860c..a9581174a4 100644
--- a/src/osx/cocoa/settings.mm
+++ b/src/osx/cocoa/settings.mm
@@ -224,7 +224,7 @@ wxFont wxSystemSettingsNative::GetFont(wxSystemFont index)
// ----------------------------------------------------------------------------
// Get a system metric, e.g. scrollbar size
-int wxSystemSettingsNative::GetMetric(wxSystemMetric index, const wxWindow* WXUNUSED(win))
+int wxSystemSettingsNative::GetMetric(wxSystemMetric index, const wxWindow* win)
{
int value;
@@ -259,11 +259,11 @@ int wxSystemSettingsNative::GetMetric(wxSystemMetric index, const wxWindow* WXUN
// TODO case wxSYS_WINDOWMIN_Y:
case wxSYS_SCREEN_X:
- wxDisplaySize(&value, NULL);
+ wxDisplaySize(win, &value, NULL);
return value;
case wxSYS_SCREEN_Y:
- wxDisplaySize(NULL, &value);
+ wxDisplaySize(win, NULL, &value);
return value;
// TODO case wxSYS_FRAMESIZE_X:
diff --git a/src/osx/cocoa/window.mm b/src/osx/cocoa/window.mm
index b322e582c5..79de567333 100644
--- a/src/osx/cocoa/window.mm
+++ b/src/osx/cocoa/window.mm
@@ -190,6 +190,9 @@ NSRect wxOSXGetFrameForControl( wxWindowMac* window , const wxPoint& pos , const
- (BOOL)isEnabled;
- (void)setEnabled:(BOOL)flag;
+- (BOOL)clipsToBounds;
+- (void)setClipsToBounds:(BOOL)clipsToBounds;
+
- (void)setImage:(NSImage *)image;
- (void)setControlSize:(NSControlSize)size;
@@ -2505,6 +2508,7 @@ wxWidgetImpl( peer, flags )
if ( m_osxView )
CFRetain(m_osxView);
[m_osxView release];
+ m_osxView.clipsToBounds = YES;
}
--
2.41.0.windows.2

View File

@@ -1,13 +1,12 @@
set(_wx_git_tag v3.1.5)
set(_wx_toolkit "") set(_wx_toolkit "")
set(_wx_private_font "-DwxUSE_PRIVATE_FONTS=1") set(_wx_private_font "-DwxUSE_PRIVATE_FONTS=1")
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(_gtk_ver 2) set(_gtk_ver 2)
if (DEP_WX_GTK3) if (DEP_WX_GTK3)
set(_gtk_ver 3) set(_gtk_ver 3)
endif () endif ()
set(_wx_toolkit "-DwxBUILD_TOOLKIT=gtk${_gtk_ver}") set(_wx_toolkit "-DwxBUILD_TOOLKIT=gtk${_gtk_ver}")
endif() endif()
@@ -17,16 +16,22 @@ else ()
set(_wx_edge "-DwxUSE_WEBVIEW_EDGE=OFF") set(_wx_edge "-DwxUSE_WEBVIEW_EDGE=OFF")
endif () endif ()
# Note: The flatpak build builds wxwidgets separately due to CI size constraints. if (MSVC)
# ANY CHANGES MADE IN HERE MUST ALSO BE REFLECTED IN `flatpak/io.github.SoftFever.OrcaSlicer.yml`. set(_patch_cmd if not exist WXWIDGETS_PATCHED ( "${GIT_EXECUTABLE}" apply --verbose --ignore-space-change --whitespace=fix ${CMAKE_CURRENT_LIST_DIR}/0001-wx-3.1.5-patch-for-Orca.patch && type nul > WXWIDGETS_PATCHED ) )
# ** THIS INCLUDES BUILD ARGS. ** else ()
# ...if you can find a way around this size limitation, be my guest. set(_patch_cmd test -f WXWIDGETS_PATCHED || ${PATCH_CMD} ${CMAKE_CURRENT_LIST_DIR}/0001-wx-3.1.5-patch-for-Orca.patch && touch WXWIDGETS_PATCHED)
endif ()
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
set(_patch_cmd ${PATCH_CMD} ${CMAKE_CURRENT_LIST_DIR}/0001-wx-3.1.5-patch-for-Orca.patch)
endif ()
orcaslicer_add_cmake_project( orcaslicer_add_cmake_project(
wxWidgets wxWidgets
GIT_REPOSITORY "https://github.com/SoftFever/Orca-deps-wxWidgets" GIT_REPOSITORY "https://github.com/wxWidgets/wxWidgets"
GIT_SHALLOW ON GIT_TAG ${_wx_git_tag}
DEPENDS ${PNG_PKG} ${ZLIB_PKG} ${EXPAT_PKG} ${JPEG_PKG} PATCH_COMMAND ${_patch_cmd}
DEPENDS ${PNG_PKG} ${ZLIB_PKG} ${EXPAT_PKG} dep_TIFF dep_JPEG
CMAKE_ARGS CMAKE_ARGS
-DwxBUILD_PRECOMP=ON -DwxBUILD_PRECOMP=ON
${_wx_toolkit} ${_wx_toolkit}
@@ -39,7 +44,6 @@ orcaslicer_add_cmake_project(
-DwxUSE_UNICODE=ON -DwxUSE_UNICODE=ON
${_wx_private_font} ${_wx_private_font}
-DwxUSE_OPENGL=ON -DwxUSE_OPENGL=ON
-DwxUSE_WEBREQUEST=ON
-DwxUSE_WEBVIEW=ON -DwxUSE_WEBVIEW=ON
${_wx_edge} ${_wx_edge}
-DwxUSE_WEBVIEW_IE=OFF -DwxUSE_WEBVIEW_IE=OFF
@@ -52,11 +56,10 @@ orcaslicer_add_cmake_project(
-DwxUSE_LIBPNG=sys -DwxUSE_LIBPNG=sys
-DwxUSE_ZLIB=sys -DwxUSE_ZLIB=sys
-DwxUSE_LIBJPEG=sys -DwxUSE_LIBJPEG=sys
-DwxUSE_LIBTIFF=OFF -DwxUSE_LIBTIFF=sys
-DwxUSE_NANOSVG=OFF
-DwxUSE_EXPAT=sys -DwxUSE_EXPAT=sys
) )
if (MSVC) if (MSVC)
add_debug_dep(dep_wxWidgets) add_debug_dep(dep_wxWidgets)
endif () endif ()

View File

@@ -1,14 +1,10 @@
# Auxiliary Fan
OrcaSlicer use `M106 P2` command to control auxiliary cooling fan. OrcaSlicer use `M106 P2` command to control auxiliary cooling fan.
If you are using Klipper, you can define a `M106` macro to control the both normal part cooling fan and auxiliary fan and exhaust fan. If you are using Klipper, you can define a `M106` macro to control the both normal part cooling fan and auxiliary fan and exhuast fan.
Below is a reference configuration for Klipper. Below is a reference configuration for Klipper.
*Note: Don't forget to change the pin name to the actual pin name you are using in the configuration*
> [!NOTE] ```
> Don't forget to change the pin name to the actual pin name you are using in the configuration
```ini
# instead of using [fan], we define the default part cooling fan with [fan_generic] here # instead of using [fan], we define the default part cooling fan with [fan_generic] here
# this is the default part cooling fan # this is the default part cooling fan
[fan_generic fan0] [fan_generic fan0]
@@ -35,4 +31,5 @@ gcode:
{% set fan = 'fan' + (params.P|int if params.P is defined else 0)|string %} {% set fan = 'fan' + (params.P|int if params.P is defined else 0)|string %}
{% set speed = (params.S|float / 255 if params.S is defined else 1.0) %} {% set speed = (params.S|float / 255 if params.S is defined else 1.0) %}
SET_FAN_SPEED FAN={fan} SPEED={speed} SET_FAN_SPEED FAN={fan} SPEED={speed}
``` ```

137
doc/Calibration.md Normal file
View File

@@ -0,0 +1,137 @@
- [Flow rate](#Flow-rate)
- [Pressure Advance](#Pressure-Advance)
1. [Line method](#Line-method)
2. [Pattern method](#Pattern-method)
3. [Tower method](#Tower-method)
- [Temp tower](#Temp-tower)
- [Retraction test](#Retraction-test)
- [Orca Tolerance Test](#Orca-Tolerance-Test)
- [Advanced calibration](#Advanced-Calibration)
1. [Max Volumetric speed](#Max-Volumetric-speed)
2. [VFA]
**NOTE**: After completing the calibration process, remember to create a new project in order to exit the calibration mode.
# Flow rate
##### *NOTE: For Bambulab X1/X1C users, make sure you do not select the 'Flow calibration' option.*
![uncheck](https://user-images.githubusercontent.com/103989404/221345187-3c317a46-4d85-4221-99b9-adb5c7f48026.jpeg)
----------------------------------------
![flowrate](https://user-images.githubusercontent.com/103989404/210137579-3fd141ad-f2da-4542-a1fd-fc4b4d673908.gif)
Calibrating the flow rate involves a two-step process.
Steps
1. Select the printer, filament, and process you would like to use for the test.
2. Select `Pass 1` in the `Calibration` menu
3. A new project consisting of nine blocks will be created, each with a different flow rate modifier. Slice and print the project.
4. Examine the blocks and determine which one has the smoothest top surface.
![flowrate-pass1_resize](https://user-images.githubusercontent.com/103989404/210138585-98821729-b19e-4452-a08d-697f147d36f0.jpg)
![0-5](https://user-images.githubusercontent.com/103989404/210138714-63daae9c-6778-453a-afa9-9a976d61bfd5.jpg)
5. Update the flow ratio in the filament settings using the following equation: `FlowRatio_old*(100 + modifier)/100`. If your previous flow ratio was `0.98` and you selected the block with a flow rate modifier of `+5`, the new value should be calculated as follows: `0.98x(100+5)/100 = 1.029`. ** Remember** to save the filament profile.
6. Perform the `Pass 2` calibration. This process is similar to `Pass 1`, but a new project with ten blocks will be generated. The flow rate modifiers for this project will range from `-9 to 0`.
7. Repeat steps 4 and 5. In this case, if your previous flow ratio was 1.029 and you selected the block with a flow rate modifier of -6, the new value should be calculated as follows: `1.029x(100-6)/100 = 0.96726`. ** Remember ** to save the filament profile.
![pass2](https://user-images.githubusercontent.com/103989404/210139072-f2fa91a6-4e3b-4d2a-81f2-c50155e1ff6d.jpg)
![-6](https://user-images.githubusercontent.com/103989404/210139131-ee224146-b242-4c1c-ac96-35ef0ca591f1.jpg)
![image](https://user-images.githubusercontent.com/103989404/210139721-919be130-fbba-4e3a-aa58-8a563e8c7792.png)
# Pressure Advance
Orca Slicer includes three approaches for calibrating the pressure advance value. Each method has its own advantages and disadvantages. It is important to note that each method has two versions: one for a direct drive extruder and one for a Bowden extruder. Make sure to select the appropriate version for your test.
##### *NOTE: For Bambulab X1/X1C users, make sure you do not select the 'Flow calibration' option when printings.*
![uncheck](https://user-images.githubusercontent.com/103989404/221345187-3c317a46-4d85-4221-99b9-adb5c7f48026.jpeg)
### Line method
The line method is quick and straightforward to test. However, its accuracy highly depends on your first layer quality. It is suggested to turn on the bed mesh leveling for this test.
Steps:
1. Select the printer, filament, and process you would like to use for the test.
2. Print the project and check the result. You can select the value of the most even line and update your PA value in the filament settings.
3. In this test, a PA value of `0.016` appears to be optimal.
![pa_line](https://user-images.githubusercontent.com/103989404/210139630-8fd189e7-aa6e-4d03-90ab-84ab0e781f81.gif)
<img width="1003" alt="Screenshot 2022-12-31 at 12 11 10 PM" src="https://user-images.githubusercontent.com/103989404/210124449-dd828da8-a7e4-46b8-9fa2-8bed5605d9f6.png">
![line_0 016](https://user-images.githubusercontent.com/103989404/210140046-dc5adf6a-42e8-48cd-950c-5e81558da967.jpg)
![image](https://user-images.githubusercontent.com/103989404/210140079-61a4aba4-ae01-4988-9f8e-2a45a90cdb7d.png)
### Pattern method
The pattern method is adapted from [Andrew Ellis' pattern method generator](https://ellis3dp.com/Pressure_Linear_Advance_Tool/), which was itself derived from the [Marlin pattern method](https://marlinfw.org/tools/lin_advance/k-factor.html) developed by [Sineos](https://github.com/Sineos/k-factorjs).
[Instructions for using and reading the pattern method](https://ellis3dp.com/Print-Tuning-Guide/articles/pressure_linear_advance/pattern_method.html) are provided in [Ellis' Print Tuning Guide](https://ellis3dp.com/Print-Tuning-Guide/), with only a few Orca Slicer differences to note.
First and foremost, when you initiate the test, you'll only see a small rectangular prism on the plate. This object serves a few purposes:
1. The test pattern itself is added in as custom G-Code at each layer, same as you could do by hand actually. The rectangular prism gives us the layers in which to insert that G-Code. This also means that **you'll see the full test pattern when you move to the Preview pane**
2. The prism acts as a handle, enabling you to move the test pattern wherever you'd like on the plate by moving the prism
3. The filament selected for the prism is also used for the test pattern
Next, Ellis' generator provided the ability to adjust specific printer, filament, and print profile settings. You can make these same changes in Orca Slicer by adjusting the settings in the Prepare pane as you would with any other print. When you initiate the calibration test, Ellis' default settings are applied. A few things to note about these settings:
1. Ellis specified line widths as a percent of filament diameter. The Orca pattern method does the same to provide its suggested defaults, making use of Ellis' percentages in combination with your specified nozzle diameter
2. In terms of line width, the pattern only makes use of the `Default` and `First layer` widths
3. In terms of speed, the pattern only uses the `First layer speed -> First layer` and `Other layers speed -> Outer wall` speeds
4. The infill pattern beneath the numbers cannot be changed becuase it's not actually an infill pattern pulled from the settings. All of the pattern G-Code is custom written, so that "infill" is, effectively, hand-drawn and so not processed through the usual channels that would enable Orca to recognize it as infill
### Tower method
The tower method may take a bit more time to complete, but it does not rely on the quality of the first layer.
The PA value for this test will be increased by 0.002 for every 1 mm increase in height. (**NOTE** 0.02 for Bowden)
Steps:
1. Select the printer, filament, and process you would like to use for the test.
2. Examine each corner of the print and mark the height that yields the best overall result.
3. I selected a height of 8 mm for this case, so the pressure advance value should be calculated as `0.002x8 = 0.016`.
![tower](https://user-images.githubusercontent.com/103989404/210140231-e886b98d-280a-4464-9781-c74ed9b7d44e.jpg)
![tower_measure](https://user-images.githubusercontent.com/103989404/210140232-885b549b-e3b8-46b9-a24c-5229c9182408.jpg)
# Temp tower
![image](./images/temp_tower_test.gif)
Temp tower is a straightforward test. The temp tower is a vertical tower with multiple blocks, each printed at a different temperature. Once the print is complete, we can examine each block of the tower and determine the optimal temperature for the filament. The optimal temperature is the one that produces the highest quality print with the least amount of issues, such as stringing, layer adhesion, warping (overhang), and bridging.
![temp_tower](https://user-images.githubusercontent.com/103989404/221344534-40e1a629-450c-4ad5-a051-8e240e261a51.jpeg)
# Retraction test
![image](./images/retraction_test.gif)
This test generates a retraction tower automatically. The retraction tower is a vertical structure with multiple notches, each printed at a different retraction length. After the print is complete, we can examine each section of the tower to determine the optimal retraction length for the filament. The optimal retraction length is the shortest one that produces the cleanest tower.
![image](./images/retraction_test_dlg.png)
In the dialog, you can select the start and end retraction length, as well as the retraction length increment step. The default values are 0mm for the start retraction length, 2mm for the end retraction length, and 0.1mm for the step. These values are suitable for most direct drive extruders. However, for Bowden extruders, you may want to increase the start and end retraction lengths to 1mm and 6mm, respectively, and set the step to 0.2mm.
**Note**: When testing filaments such as PLA or ABS that have minimal oozing, the retraction settings can be highly effective. You may find that the retraction tower appears clean right from the start. In such situations, setting the retraction length to 0.2mm - 0.4mm using Orca Slicer should suffice.
On the other hand, if there is still a lot of stringing at the top of the tower, it is recommended to dry your filament and ensure that your nozzle is properly installed without any leaks.
![image](./images/retraction_test_print.jpg)
# Orca Tolerance Test
This tolerance test is specifically designed to assess the dimensional accuracy of your printer and filament. The model comprises a base and a hexagon tester. The base contains six hexagon hole, each with a different tolerance: 0.0mm, 0.05mm, 0.1mm, 0.2mm, 0.3mm, and 0.4mm. The dimensions of the hexagon tester are illustrated in the image.
![image](./images/tolerance_hole.jpg)
You can assess the tolerance using either an M6 Allen key or the printed hexagon tester.
![image](./images/OrcaToleranceTes_m6.jpg)
![image](./images/OrcaToleranceTest_print.jpg)
# Advanced Calibration
## Max Volumetric speed
This is a test designed to calibrate the maximum volumetric speed of the specific filament. The generic or 3rd party filament types may not have the correct volumetric flow rate set in the filament. This test will help you to find the maximum volumetric speed of the filament.
You will be promted to enter the settings for the test: start volumetric speed, end volumentric speed, and step. It is recommended to use the default values (5mm³/s start, 20mm³/s end, with a step of 0.5), unless you already have an idea of the lower or upper limit for your filament. Select "OK", slice the plate, and send it to the printer.
Once printed, take note of where the layers begin to fail and where the quality begins to suffer. Pay attention to changes from matte to shiny as well.
![image](./images/vmf_measurement_point.jpg)
Using calipers or a ruler, measure the height of the print at that point. Use the following calculation to determine the correct max flow value: `start + (height-measured * step)` . For example in the photo below, and using the default setting values, the print quality began to suffer at 19mm measured, so the calculation would be: `5 + (19 * 0.5)` , or `13mm³/s` using the default values. Enter your number into the "Max volumetric speed" value in the filament settings.
![image](./images/caliper_sample_mvf.jpg)
You can also return to OrcaSlicer in the "Preview" tab, make sure the color scheme "flow" is selected. Scroll down to the layer height that you measured, and click on the toolhead slider. This will indicate the max flow level for your filmanet.
![image](./images/max_volumetric_flow.jpg)
#### *NOTE You may also choose to conservatively reduce the flow by 5-10% to ensure print quality.*
***
*Credits:*
- *The Flowrate test and retraction test is inspired by [SuperSlicer](https://github.com/supermerill/SuperSlicer)*
- *The PA Line method is inspired by [K-factor Calibration Pattern](https://marlinfw.org/tools/lin_advance/k-factor.html)*
- *The PA Tower method is inspired by [Klipper](https://www.klipper3d.org/Pressure_Advance.html)*
- *The temp tower model is remixed from [Smart compact temperature calibration tower](https://www.thingiverse.com/thing:2729076)
- *The max flowrate test was inspired by Stefan(CNC Kitchen), and the model used in the test is a remix of his [Extrusion Test Structure](https://www.printables.com/model/342075-extrusion-test-structure).
- *chapgpt* ;)

View File

@@ -0,0 +1,52 @@
OrcaSlicer use `M141/M191` command to control active chamber heater.
If `Activate temperature control` is checked, OrcaSlicer will insert `M191` command at the beginning of the gcode(before `Machine G-code`).
![image](./images/activate_chamber_heater.jpg)
*Note: If the machine is equipped with an auxiliary fan, OrcaSlicer will automatically activate the fan during the heating period to help circulate air in the chamber.*
There are two chamber temperature variables available that we can use in `Machine G-code` to control the chamber temperature, if you prefer:
To access the chamber temperature set in the first filament, use:
`M191 S{chamber_temperature[0]}`
To use the overall chamber temperature, which is the highest chamber temperature set across all filaments, use:
`M191 S{overall_chamber_temperature}`
--------------------------Klipper--------------------------
If you are using Klipper, you can define these macros to control the active chamber heater.
Bellow is a reference configuration for Klipper.
*Note: Don't forget to change the pin name/values to the actual values you are using in the configuration*
```
[heater_generic chamber_heater]
heater_pin:PB10
max_power:1.0
# Orca note: here the temperature sensor should be the sensor you are using for chamber temperature, not the PTC sensor
sensor_type:NTC 100K MGB18-104F39050L32
sensor_pin:PA1
control = pid
pid_Kp = 63.418
pid_ki = 0.960
pid_kd = 1244.716
min_temp:0
max_temp:70
[gcode_macro M141]
gcode:
SET_HEATER_TEMPERATURE HEATER=chamber_heater TARGET={params.S|default(0)}
[gcode_macro M191]
gcode:
{% set s = params.S|float %}
{% if s == 0 %}
# If target temperature is 0, do nothing
M117 Chamber heating cancelled
{% else %}
SET_HEATER_TEMPERATURE HEATER=chamber_heater TARGET={s}
# Orca: uncomment the following line if you want to use heat bed to assist chamber heating
# M140 S100
TEMPERATURE_WAIT SENSOR="heater_generic chamber_heater" MINIMUM={s-1} MAXIMUM={s+1}
M117 Chamber at target temperature
{% endif %}
```

View File

@@ -1,146 +1,7 @@
# Welcome to the OrcaSlicer WIKI! Welcome to the OrcaSlicer WIKI!
Orca slicer is a powerful open source slicer for FFF (FDM) 3D Printers. This wiki page aims to provide an detailed explanation of the slicer settings, how to get the most out of them as well as how to calibrate and setup your printer. We have divided it roughly into the following pages:
- [Printer Settings](#printer-settings) * [Calibration](wiki/Calibration)
- [Material Settings](#material-settings) * [Print settings](wiki/Print-settings)
- [Prepare](#prepare) * [How to build Orca Slicer](wiki/How-to-build)
- [Process Settings](#process-settings)
- [Quality Settings](#quality-settings)
- [Strength Settings](#strength-settings)
- [Speed Settings](#speed-settings)
- [Support Settings](#support-settings)
- [Multimaterial Settings](#multimaterial-settings)
- [Others Settings](#others-settings)
- [Calibrations](#calibrations)
- [Developer Section](#developer-section)
> [!NOTE]
> The Wiki is **Work In Progress** so bear with us while we get it up and running!
> Please consider contributing to the wiki following the [How to contribute to the wiki](How-to-wiki) guide.
## Printer Settings
![printer-preset](https://github.com/SoftFever/OrcaSlicer/blob/main/doc/images/GUI/printer-preset.png?raw=true)
- [Air filtration/Exhaust fan handling](air-filtration)
- [Auxiliary fan handling](Auxiliary-fan)
- [Chamber temperature control](chamber-temperature)
- [Adaptive Bed Mesh](adaptive-bed-mesh)
- [Using different bed types in Orca](bed-types)
## Material Settings
![filament-preset](https://github.com/SoftFever/OrcaSlicer/blob/main/doc/images/GUI/filament-preset.png?raw=true)
- [Single Extruder Multimaterial](semm)
- [Pellet Printers (pellet flow coefficient)](pellet-flow-coefficient)
## Prepare
First steps to prepare your model/s for printing.
- [STL Transformation](stl-transformation)
## Process Settings
![process-preset](https://github.com/SoftFever/OrcaSlicer/blob/main/doc/images/GUI/process-preset.png?raw=true)
The below sections provide a detailed settings explanation as well as tips and tricks in setting these for optimal print results.
### Quality Settings
![process-quality](https://github.com/SoftFever/OrcaSlicer/blob/main/doc/images/GUI/process/process-quality.png?raw=true)
- ![param_layer_height](https://github.com/SoftFever/OrcaSlicer/blob/main/resources/images/param_layer_height.svg?raw=true) [Layer Height Settings](quality_settings_layer_height)
- ![param_line_width](https://github.com/SoftFever/OrcaSlicer/blob/main/resources/images/param_line_width.svg?raw=true) [Line Width Settings](quality_settings_line_width)
- ![param_seam](https://github.com/SoftFever/OrcaSlicer/blob/main/resources/images/param_seam.svg?raw=true) [Seam Settings](quality_settings_seam)
- ![param_precision](https://github.com/SoftFever/OrcaSlicer/blob/main/resources/images/param_precision.svg?raw=true) [Precision](quality_settings_precision)
- ![param_ironing](https://github.com/SoftFever/OrcaSlicer/blob/main/resources/images/param_ironing.svg?raw=true) [Ironing](quality_settings_ironing)
- ![param_wall_generator](https://github.com/SoftFever/OrcaSlicer/blob/main/resources/images/param_wall_generator.svg?raw=true) [Wall generator](quality_settings_wall_generator)
- ![param_wall_surface](https://github.com/SoftFever/OrcaSlicer/blob/main/resources/images/param_wall_surface.svg?raw=true) [Walls and surfaces](quality_settings_wall_and_surfaces)
- ![param_bridge](https://github.com/SoftFever/OrcaSlicer/blob/main/resources/images/param_bridge.svg?raw=true) [Bridging](quality_settings_bridging)
- ![param_overhang](https://github.com/SoftFever/OrcaSlicer/blob/main/resources/images/param_overhang.svg?raw=true) [Overhangs](quality_settings_overhangs)
### Strength Settings
![process-strength](https://github.com/SoftFever/OrcaSlicer/blob/main/doc/images/GUI/process/process-strength.png?raw=true)
- ![param_wall](https://github.com/SoftFever/OrcaSlicer/blob/main/resources/images/param_wall.svg?raw=true) [Walls](strength_settings_walls)
- ![param_shell](https://github.com/SoftFever/OrcaSlicer/blob/main/resources/images/param_shell.svg?raw=true) [Top and Bottom Shells](strength_settings_top_bottom_shells)
- ![param_infill](https://github.com/SoftFever/OrcaSlicer/blob/main/resources/images/param_infill.svg?raw=true) [Infill](strength_settings_infill)
- ![param_gcode](https://github.com/SoftFever/OrcaSlicer/blob/main/resources/images/param_gcode.svg?raw=true) [Template Metalanguage for infill rotation](strength_settings_infill_rotation_template_metalanguage)
- ![param_advanced](https://github.com/SoftFever/OrcaSlicer/blob/main/resources/images/param_advanced.svg?raw=true) [Advanced](strength_settings_advanced)
### Speed Settings
![process-speed](https://github.com/SoftFever/OrcaSlicer/blob/main/doc/images/GUI/process/process-speed.png?raw=true)
- ![param_speed_first](https://github.com/SoftFever/OrcaSlicer/blob/main/resources/images/param_speed_first.svg?raw=true) [Initial Layer Speed](speed_settings_initial_layer_speed)
- ![param_speed](https://github.com/SoftFever/OrcaSlicer/blob/main/resources/images/param_speed.svg?raw=true) [Other Layers Speed](speed_settings_other_layers_speed)
- ![param_overhang_speed](https://github.com/SoftFever/OrcaSlicer/blob/main/resources/images/param_overhang_speed.svg?raw=true) [Overhang Speed](speed_settings_overhang_speed)
- ![param_travel_speed](https://github.com/SoftFever/OrcaSlicer/blob/main/resources/images/param_travel_speed.svg?raw=true) [Travel Speed](speed_settings_travel)
- ![param_acceleration](https://github.com/SoftFever/OrcaSlicer/blob/main/resources/images/param_acceleration.svg?raw=true) [Acceleration](speed_settings_acceleration)
- ![param_jerk](https://github.com/SoftFever/OrcaSlicer/blob/main/resources/images/param_jerk.svg?raw=true) [Jerk (XY)](speed_settings_jerk_xy)
- ![param_advanced](https://github.com/SoftFever/OrcaSlicer/blob/main/resources/images/param_advanced.svg?raw=true) [Advanced / Extrusion rate smoothing](speed_settings_advanced)
### Support Settings
![process-support](https://github.com/SoftFever/OrcaSlicer/blob/main/doc/images/GUI/process/process-support.png?raw=true)
- ![param_support](https://github.com/SoftFever/OrcaSlicer/blob/main/resources/images/param_support.svg?raw=true) [Support](support_settings_support)
- ![param_raft](https://github.com/SoftFever/OrcaSlicer/blob/main/resources/images/param_raft.svg?raw=true) [Raft](support_settings_raft)
- ![param_support_filament](https://github.com/SoftFever/OrcaSlicer/blob/main/resources/images/param_support_filament.svg?raw=true) [Support Filament](support_settings_filament)
- ![param_ironing](https://github.com/SoftFever/OrcaSlicer/blob/main/resources/images/param_ironing.svg?raw=true) [Support Ironing](support_settings_ironing)
- ![param_advanced](https://github.com/SoftFever/OrcaSlicer/blob/main/resources/images/param_advanced.svg?raw=true) [Advanced](support_settings_advanced)
- ![param_support_tree](https://github.com/SoftFever/OrcaSlicer/blob/main/resources/images/param_support_tree.svg?raw=true) [Tree Supports](support_settings_tree)
### Multimaterial Settings
![process-multimaterial](https://github.com/SoftFever/OrcaSlicer/blob/main/doc/images/GUI/process/process-multimaterial.png?raw=true)
- ![param_tower](https://github.com/SoftFever/OrcaSlicer/blob/main/resources/images/param_tower.svg?raw=true) [Prime Tower](multimaterial_settings_prime_tower)
- ![param_filament_for_features](https://github.com/SoftFever/OrcaSlicer/blob/main/resources/images/param_filament_for_features.svg?raw=true) [Filament for Features](multimaterial_settings_filament_for_features)
- ![param_ooze_prevention](https://github.com/SoftFever/OrcaSlicer/blob/main/resources/images/param_ooze_prevention.svg?raw=true) [Ooze Prevention](multimaterial_settings_ooze_prevention)
- ![param_flush](https://github.com/SoftFever/OrcaSlicer/blob/main/resources/images/param_flush.svg?raw=true) [Flush Options](multimaterial_settings_flush_options)
- ![param_advanced](https://github.com/SoftFever/OrcaSlicer/blob/main/resources/images/param_advanced.svg?raw=true) [Advanced](multimaterial_settings_advanced)
### Others Settings
![process-others](https://github.com/SoftFever/OrcaSlicer/blob/main/doc/images/GUI/process/process-others.png?raw=true)
- ![param_skirt](https://github.com/SoftFever/OrcaSlicer/blob/main/resources/images/param_skirt.svg?raw=true) [Skirt](others_settings_skirt)
- ![param_adhension](https://github.com/SoftFever/OrcaSlicer/blob/main/resources/images/param_adhension.svg?raw=true) [Brim](others_settings_brim)
- ![param_special](https://github.com/SoftFever/OrcaSlicer/blob/main/resources/images/param_special.svg?raw=true) [Special Mode](others_settings_special_mode)
- ![fuzzy_skin](https://github.com/SoftFever/OrcaSlicer/blob/main/resources/images/fuzzy_skin.svg?raw=true) [Fuzzy Skin](others_settings_fuzzy_skin)
- ![param_gcode](https://github.com/SoftFever/OrcaSlicer/blob/main/resources/images/param_gcode.svg?raw=true) [G-Code Output](others_settings_g_code_output)
- ![param_gcode](https://github.com/SoftFever/OrcaSlicer/blob/main/resources/images/param_gcode.svg?raw=true) [Post Processing Scripts](others_settings_post_processing_scripts)
- ![note](https://github.com/SoftFever/OrcaSlicer/blob/main/resources/images/note.svg?raw=true) [Notes](others_settings_notes)
## Calibrations
The [Calibration Guide](Calibration) outlines Orcas key calibration tests and their suggested order of execution.
- [Temperature](temp-calib)
- [Flow Rate](flow-rate-calib)
- [Pressure Advance](pressure-advance-calib)
- [Adaptive Pressure Advance Guide](adaptive-pressure-advance-calib)
- [Retraction](retraction-calib)
- [Tolerance](tolerance-calib)
- Advanced:
- [Volumetric Speed](volumetric-speed-calib)
- [Cornering (Jerk & Junction Deviation)](cornering-calib)
- [Input Shaping](input-shaping-calib)
- [VFA](vfa-calib)
## Developer Section
This is a documentation from someone exploring the code and is by no means complete or even completely accurate. Please edit the parts you might find inaccurate. This is probably going to be helpful nonetheless.
- [How to build Orca Slicer](How-to-build)
- [Localization and translation guide](Localization_guide)
- [How to create profiles](How-to-create-profiles)
- [How to contribute to the wiki](How-to-wiki)
- [Preset, PresetBundle and PresetCollection](Preset-and-bundle)
- [Plater, Sidebar, Tab, ComboBox](plater-sidebar-tab-combobox)
- [Slicing Call Hierarchy](slicing-hierarchy)

Some files were not shown because too many files have changed in this diff Show More