Merge branch 'main' into dev/p2s-pr

This commit is contained in:
Noisyfox
2025-11-13 10:11:10 +08:00
7 changed files with 44 additions and 29 deletions

View File

@@ -1,8 +1,8 @@
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 # Verify that your CMake version is exactly 3.5 series or higher on windows
if ( ((MSVC) OR (WIN32)) AND (${CMAKE_VERSION} VERSION_GREATER_EQUAL "4.0") ) if ( (MSVC OR WIN32) AND (${CMAKE_VERSION} VERSION_LESS "3.5") )
message(FATAL_ERROR "Only cmake versions between 3.13.x and 3.31.x is supported on windows. Detected version: ${CMAKE_VERSION}") message(FATAL_ERROR "CMake current version ${CMAKE_VERSION} is too old. Minimum required is 3.5.")
endif() endif()
if (WIN32) if (WIN32)

View File

@@ -46,6 +46,8 @@ if "%1"=="slicer" (
echo "building deps.." echo "building deps.."
echo on echo on
REM Set minimum CMake policy to avoid <3.5 errors
set CMAKE_POLICY_VERSION_MINIMUM=3.5
cmake ../ -G "Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=%build_type% cmake ../ -G "Visual Studio 17 2022" -A x64 -DCMAKE_BUILD_TYPE=%build_type%
cmake --build . --config %build_type% --target deps -- -m cmake --build . --config %build_type% --target deps -- -m
@echo off @echo off

View File

@@ -22,12 +22,13 @@ Whether you're a contributor or just want a custom build, this guide will help y
- [Common dependencies across distributions](#common-dependencies-across-distributions) - [Common dependencies across distributions](#common-dependencies-across-distributions)
- [Additional dependencies for specific distributions](#additional-dependencies-for-specific-distributions) - [Additional dependencies for specific distributions](#additional-dependencies-for-specific-distributions)
- [Linux Instructions](#linux-instructions) - [Linux Instructions](#linux-instructions)
- [Unit Testing](#unit-testing)
- [Portable User Configuration](#portable-user-configuration) - [Portable User Configuration](#portable-user-configuration)
- [Example folder structure](#example-folder-structure) - [Example folder structure](#example-folder-structure)
## Windows 64-bit ## Windows 64-bit
How to building with Visual Studio 2022 on Windows 64-bit. How to building with Visual Studio on Windows 64-bit.
### Windows Tools Required ### Windows Tools Required
@@ -35,9 +36,9 @@ How to building with Visual Studio 2022 on Windows 64-bit.
```shell ```shell
winget install --id=Microsoft.VisualStudio.2022.Professional -e winget install --id=Microsoft.VisualStudio.2022.Professional -e
``` ```
- [CMake (version 3.31)](https://cmake.org/) — **⚠️ version 3.31.x is mandatory** - [CMake](https://cmake.org/)
```shell ```shell
winget install --id=Kitware.CMake -v "3.31.6" -e winget install --id=Kitware.CMake -e
``` ```
- [Strawberry Perl](https://strawberryperl.com/) - [Strawberry Perl](https://strawberryperl.com/)
```shell ```shell
@@ -58,6 +59,14 @@ How to building with Visual Studio 2022 on Windows 64-bit.
> winget install --id=GitHub.GitHubDesktop -e > winget install --id=GitHub.GitHubDesktop -e
> ``` > ```
> [!IMPORTANT]
> Check your CMake version. Run `cmake --version` in your terminal and verify it returns a **4.x** version.
> If you see an older version (e.g. 3.29), it's likely due to another copy in your system's PATH (e.g. from Strawberry Perl).
> You can run where cmake to check the active paths and rearrange your **System Environment Variables** > PATH, ensuring the correct CMake (e.g. C:\Program Files\CMake\bin) appears before others like C:\Strawberry\c\bin.
![windows_variables_path](https://github.com/SoftFever/OrcaSlicer/blob/main/doc/images/develop/windows_variables_path.png?raw=true)
![windows_variables_order](https://github.com/SoftFever/OrcaSlicer/blob/main/doc/images/develop/windows_variables_order.png?raw=true)
### Windows Instructions ### Windows Instructions
1. Clone the repository: 1. Clone the repository:
@@ -72,16 +81,33 @@ How to building with Visual Studio 2022 on Windows 64-bit.
git lfs pull git lfs pull
``` ```
2. Open the appropriate command prompt: 2. Open the appropriate command prompt:
- For Visual Studio 2019: - Visual Studio 2022:
Open **x64 Native Tools Command Prompt for VS 2019** and run: ```MD
```shell x64 Native Tools Command Prompt for VS 2022
build_release.bat
``` ```
- For Visual Studio 2022: - Visual Studio 2019:
Open **x64 Native Tools Command Prompt for VS 2022** and run: ```MD
```shell x64 Native Tools Command Prompt for VS 2019
build_release_vs2022.bat
``` ```
1. Navigate to correct drive (if needed), e.g.:
```shell
N:
```
2. Change directory to the cloned repository, e.g.:
```shell
cd N:\Repos\OrcaSlicer
```
3. Run the build script:
- Visual Studio 2022:
```shell
build_release_vs2022.bat
```
- Visual Studio 2019:
```shell
build_release.bat
```
![vs2022cmd](https://github.com/SoftFever/OrcaSlicer/blob/main/doc/images/develop/vs2022cmd.png?raw=true)
> [!NOTE] > [!NOTE]
> The build process will take a long time depending on your system but even with high-end hardware it can take up to 40 minutes. > The build process will take a long time depending on your system but even with high-end hardware it can take up to 40 minutes.
@@ -106,11 +132,6 @@ How to building with Visual Studio 2022 on Windows 64-bit.
> Changes to .hpp files take longer, depending on what you change. > Changes to .hpp files take longer, depending on what you change.
> If you switch back and forth between branches, it also takes a long time to rebuild, even if you haven't made any changes. > If you switch back and forth between branches, it also takes a long time to rebuild, even if you haven't made any changes.
> [!IMPORTANT]
> Make sure that CMake version 3.31.x is actually being used. Run `cmake --version` and verify it returns a **3.31.x** version.
> If you see an older version (e.g. 3.29), it's likely due to another copy in your system's PATH (e.g. from Strawberry Perl).
> You can run where cmake to check the active paths and rearrange your **System Environment Variables** > PATH, ensuring the correct CMake (e.g. C:\Program Files\CMake\bin) appears before others like C:\Strawberry\c\bin.
> [!TIP] > [!TIP]
> If the build fails, try deleting the `build/` and `deps/build/` directories to clear any cached build data. Rebuilding after a clean-up is usually sufficient to resolve most issues. > If the build fails, try deleting the `build/` and `deps/build/` directories to clear any cached build data. Rebuilding after a clean-up is usually sufficient to resolve most issues.

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

View File

@@ -34,7 +34,6 @@
#include "DailyTips.hpp" #include "DailyTips.hpp"
#include "FilamentMapDialog.hpp" #include "FilamentMapDialog.hpp"
#include "slic3r/GUI/CameraUtils.hpp"
#include "slic3r/GUI/Gizmos/GLGizmoPainterBase.hpp" #include "slic3r/GUI/Gizmos/GLGizmoPainterBase.hpp"
#include "slic3r/Utils/UndoRedo.hpp" #include "slic3r/Utils/UndoRedo.hpp"
#include "slic3r/Utils/MacDarkMode.hpp" #include "slic3r/Utils/MacDarkMode.hpp"
@@ -4695,7 +4694,6 @@ void GLCanvas3D::on_mouse(wxMouseEvent& evt)
m_camera_movement = true; m_camera_movement = true;
m_mouse.drag.start_position_2D = pos; m_mouse.drag.start_position_2D = pos;
m_mouse.drag.move_start_threshold_position_2D = pos;
} }
} }
else if ((evt.LeftUp() || evt.MiddleUp() || evt.RightUp()) || else if ((evt.LeftUp() || evt.MiddleUp() || evt.RightUp()) ||
@@ -9378,18 +9376,12 @@ Vec3d GLCanvas3D::_mouse_to_3d(const Point& mouse_pos, float* z)
if (m_canvas == nullptr) if (m_canvas == nullptr)
return Vec3d(DBL_MAX, DBL_MAX, DBL_MAX); return Vec3d(DBL_MAX, DBL_MAX, DBL_MAX);
const Camera& camera = wxGetApp().plater()->get_camera();
if (z == nullptr) { if (z == nullptr) {
const SceneRaycaster::HitResult hit = m_scene_raycaster.hit(mouse_pos.cast<double>(), camera, nullptr); const SceneRaycaster::HitResult hit = m_scene_raycaster.hit(mouse_pos.cast<double>(), wxGetApp().plater()->get_camera(), nullptr);
return hit.is_valid() ? hit.position.cast<double>() : _mouse_to_bed_3d(mouse_pos); return hit.is_valid() ? hit.position.cast<double>() : _mouse_to_bed_3d(mouse_pos);
} }
// Orca: Handling of the particular case, if we want to get the position for Z = 0
else if (is_approx(static_cast<double>(*z), 0.)) {
Vec2d position = CameraUtils::get_z0_position(camera, Vec2d(mouse_pos.x(), mouse_pos.y()));
return Vec3d(position.x(), position.y(), *z);
}
else { else {
const Camera& camera = wxGetApp().plater()->get_camera();
const Vec4i32 viewport(camera.get_viewport().data()); const Vec4i32 viewport(camera.get_viewport().data());
Vec3d out; Vec3d out;
igl::unproject(Vec3d(mouse_pos.x(), viewport[3] - mouse_pos.y(), *z), camera.get_view_matrix().matrix(), camera.get_projection_matrix().matrix(), viewport, out); igl::unproject(Vec3d(mouse_pos.x(), viewport[3] - mouse_pos.y(), *z), camera.get_view_matrix().matrix(), camera.get_projection_matrix().matrix(), viewport, out);