Compare commits

..
Author SHA1 Message Date
Hanif Koh 51baa579fe Gate Pull Requests on clang-tidy Missing-Include Checks
A Linux job configures without the precompiled header and runs clang-tidy over the C++ lines a pull request changes. The only check for now is misc-include-cleaner for missing includes; .clang-tidy is where further checks get enabled.

scripts/run_clang_tidy.sh (Linux, macOS) and scripts/run_clang_tidy.ps1 (Windows) run the same check locally: the same configure, the clang-tidy version pinned in scripts/clang_tidy_requirements.txt, and the same comparison against OrcaSlicer's main. They offer to install what is missing, or print the command to do it by hand.
2026-10-05 16:47:59 +08:00
HanifKoh 4895bc03b4 Remove Unused Project Includes and Forward-Declare Where a Type Is Only Referenced (#16099)
* Remove Unused Project Includes and Forward-Declare Where a Type Is Only Referenced

Generated with include-what-you-use and applied conservatively. Only OrcaSlicer's own headers, the ones under src/ and tests/, are removed or forward-declared; standard-library and third-party includes are left alone. An include is removed only when both the Release and the Debug configuration leave it unused, never from inside a conditional block, and never from a file with platform-specific blocks, which only gain includes. Files whose only use of a header sits behind a feature or debug macro (libvgcode's OpenGL ES and marker code, the ARACHNE/TESTS_EXPORT_SVGS debug output) keep their includes.

clonable_ptr.hpp gains #pragma once; it had no include guard and was only safe while Config.hpp was its sole includer.

* Remove Unused Project Includes From Files With Platform-Specific Code

A Linux include-what-you-use run cannot see the code inside _WIN32, __APPLE__ or __linux__ blocks, so its verdict is only taken where nothing the removed header declares, directly or through what it includes, is named inside those blocks. Removals also have to hold in both the Release and Debug configuration and never touch a line inside a conditional block.

* Restore the libslic3r Precompiled Header and Direct Includes Lost in the Platform Pass

The platform-file pass treated pchheader.hpp as an ordinary header and
emptied it, and left GUI_Preview.hpp and 14 other files relying on
headers they no longer reached directly.

* Restore MainFrame.hpp in ParamsDialog.cpp for the Windows-Only Reparent Call

* Include Headers That Files Reached Through Ones the Cleanup Removed

* Drop Includes Duplicated by the Cleanup or by Main's Own Additions

* Leave PreciseSeam.cpp as Main Has It After the Precise Seam Rework
2026-10-05 16:47:17 +08:00
Ian Chua 86153752e6 test: OFL OTA for ARM64 test (TO BE REVERTED AFTER 2.5.0 ALPHA) (#16151)
Merged by /bot merge on behalf of @peachismomo (id 52488812).
Grants: resources/profiles/OrcaFilamentLibrary/filament/Elegoo, resources/profiles/OrcaFilamentLibrary.json, resources/profiles/Elegoo, resources/profiles/Elegoo.json
Head: 00276bf8ee
2026-10-05 08:19:40 +00:00
641 changed files with 2839 additions and 2710 deletions
+7 -3
View File
@@ -1,7 +1,11 @@
# clang-tidy configuration. Only missing includes are reported for now: a file
# should include the header for every symbol it uses, not rely on the
# precompiled header or another header's includes. Run with --fix to add them.
# clang-tidy configuration, enforced by the clang-tidy CI job on the lines a pull
# request changes (scripts/clang_tidy_diff.py). Only missing includes are reported
# for now: a file should include the header for every symbol it uses, not rely on
# the precompiled header or another header's includes. Run with --fix to add them.
# Every check listed here gates pull requests, so enable a new one only once the
# code it flags on touched lines is reasonable to fix in passing.
Checks: '-*,misc-include-cleaner'
WarningsAsErrors: '*'
CheckOptions:
# Missing includes only. Builds without the precompiled header break on these.
misc-include-cleaner.UnusedIncludes: false
+89
View File
@@ -0,0 +1,89 @@
name: clang-tidy
# Runs clang-tidy, with the checks in .clang-tidy, over the C++ lines a pull
# request changes (scripts/clang_tidy_diff.py). The compile database is
# configured without the precompiled header, so code that only builds because
# the PCH supplied an include fails here.
#
# No paths filter: the job is a required check, and a workflow skipped by a
# paths filter leaves a required check pending forever. A PR with no C++
# changes finishes after the first step.
on:
pull_request:
branches:
- main
- release/*
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true
jobs:
clang_tidy:
# Branch protection requires this check by name. Renaming the job disables
# that gate.
name: clang-tidy
runs-on: ${{ vars.SELF_HOSTED && 'orca-lnx-server' || 'ubuntu-24.04' }}
steps:
- name: Checkout
uses: actions/checkout@v7
with:
lfs: 'false'
# The PR merge commit plus its first parent, the base it is diffed against.
fetch-depth: 2
- name: Look for changed C++ files
id: changes
run: |
if git diff --name-only HEAD^1 -- src tests | grep -qE '\.(cpp|cc|cxx|hpp|h|hxx)$'; then
echo "cpp=true" >> "$GITHUB_OUTPUT"
else
echo "No C++ changes under src/ or tests/."
fi
# Parsing needs the dependency headers, not a build of this PR's deps/, so
# a PR that changes deps/ falls back to the newest cache main has.
- name: Restore cached deps
if: steps.changes.outputs.cpp == 'true'
uses: actions/cache/restore@v6
with:
path: ${{ github.workspace }}/deps/build/OrcaSlicer_dep
key: linux-clang-cache-orcaslicer_deps-build-${{ hashFiles('deps/**') }}
restore-keys: linux-clang-cache-orcaslicer_deps-build-
fail-on-cache-miss: true
- name: Apt-Install Dependencies
if: steps.changes.outputs.cpp == 'true' && !vars.SELF_HOSTED
uses: ./.github/actions/apt-install-deps
- name: Install clang-tidy
if: steps.changes.outputs.cpp == 'true'
run: |
python3 -m venv "$RUNNER_TEMP/clang-tidy"
"$RUNNER_TEMP/clang-tidy/bin/pip" install --quiet -r scripts/clang_tidy_requirements.txt
# DEP_BUILD_DIR is named outright: CMake would otherwise derive it from the build
# directory's name and look for the dependencies in deps/build-tidy.
- name: Configure without the precompiled header
if: steps.changes.outputs.cpp == 'true'
run: >
cmake -S . -B build-tidy -G Ninja
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON
-DSLIC3R_PCH=OFF -DORCA_TOOLS=ON -DBUILD_TESTS=ON
-DDEP_BUILD_DIR=${{ github.workspace }}/deps/build
# The one header the build generates rather than the configure.
- name: Generate git_commit_hash.h
if: steps.changes.outputs.cpp == 'true'
run: cmake --build build-tidy --target git_commit_hash_header
- name: Run clang-tidy on the changed lines
if: steps.changes.outputs.cpp == 'true'
run: >
python3 scripts/clang_tidy_diff.py -p build-tidy --base HEAD^1
--clang-tidy "$RUNNER_TEMP/clang-tidy/bin/clang-tidy" -j "$(nproc)"
+1
View File
@@ -36,6 +36,7 @@ ctest --test-dir ./tests/fff_print -C Release
- C++17, selective C++20. PascalCase classes, snake_case functions/variables
- `#pragma once` for headers. Smart pointers and RAII preferred
- Include what you use: include the header for every symbol a file uses, and keep headers compilable on their own. Never rely on the precompiled header or a transitive include. The `clang-tidy` CI job enforces this on changed lines; run the same check locally with `scripts/run_clang_tidy.sh` (`scripts\run_clang_tidy.ps1` on Windows), which sets up everything it needs
- Parallelization via TBB — be mindful of shared state
- Always use `SetSizerAndFit(sizer)` instead of `SetSizer(sizer)` on top level window. Unless `SetSizer` must be called before the full layout is built, call `sizer->SetSizeHints(window)` afterwards in this case.
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "OrcaFilamentLibrary",
"version": "02.04.00.18",
"version": "02.04.00.19",
"force_update": "0",
"description": "Orca Filament Library",
"filament_list": [
@@ -6,7 +6,7 @@
"filament_id": "OFvgE0Zh",
"instantiation": "false",
"fan_cooling_layer_time": [
"85"
"80"
],
"fan_min_speed": [
"50"
+285
View File
@@ -0,0 +1,285 @@
#!/usr/bin/env python3
"""Run clang-tidy on the C++ files changed since a base revision.
Check findings are reported only on added or modified lines, so existing code
is not held to checks it predates. A changed source file that does not compile
(for example one that only built because the precompiled header supplied an
include) fails wherever the error is. Headers are compiled on their own, and
fail only on errors in their changed lines. Deleting an #include also fails
on every use, changed or not, that now lacks the header it provided.
The checks come from .clang-tidy at the repository root. The compile database
must come from a configure with SLIC3R_PCH=OFF, or the precompiled header hides
missing includes.
python3 scripts/clang_tidy_diff.py -p build-tidy --base origin/main
"""
import argparse
import json
import os
import re
import subprocess
import sys
import tempfile
from collections import Counter
from concurrent.futures import ThreadPoolExecutor
from dataclasses import dataclass, field
from pathlib import PurePosixPath
SOURCE_EXTENSIONS = {".cpp", ".cc", ".cxx"}
HEADER_EXTENSIONS = {".hpp", ".h", ".hxx"}
CHECKED_DIRS = ("src/", "tests/")
# Vendored code inside the checked directories.
EXCLUDED_DIRS = ("src/glad/", "tests/catch2/")
# Per file. A deleted include can leave hundreds of follow-on errors.
MAX_REPORTED = 30
HUNK_RE = re.compile(r"^@@ -\d+(?:,\d+)? \+(\d+)(?:,(\d+))? @@")
DIAGNOSTIC_RE = re.compile(r"^(.+?):(\d+):(\d+): (error|warning): (.*)$")
FIX_MESSAGE_RE = re.compile(r"^\s+Message:\s+(['\"])(.*)\1$")
FIX_INCLUDE_RE = re.compile(r"^\s+ReplacementText:\s+['\"]#include ([^\\'\"]*)")
REMOVED_INCLUDE_RE = re.compile(r'^-\s*#\s*include\s*[<"]([^>"]+)[>"]')
@dataclass
class FileChange:
lines: list = field(default_factory=list) # [first, last] ranges of added lines
removed_includes: set = field(default_factory=set) # header names whose #include was deleted
@dataclass
class Diagnostic:
file: str
line: int
col: int
level: str
message: str
include: str = "" # header named by the fix, when the fix adds an #include
@property
def is_compile_error(self):
return self.message.endswith("[clang-diagnostic-error]")
def __str__(self):
return self.message + (f" (add #include {self.include})" if self.include else "")
def parse_diff(diff):
"""Map each file in a `git diff -U0` to the lines it adds and the includes it deletes."""
changes = {}
change = None
for line in diff.splitlines():
if line.startswith("+++ "):
target = line[4:]
change = changes.setdefault(target[2:], FileChange()) if target.startswith("b/") else None
continue
if change is None:
continue
match = HUNK_RE.match(line)
if match:
first = int(match.group(1))
count = int(match.group(2) or 1)
if count > 0:
change.lines.append([first, first + count - 1])
continue
match = REMOVED_INCLUDE_RE.match(line)
if match:
change.removed_includes.add(match.group(1))
return changes
def is_checked(path):
if not path.startswith(CHECKED_DIRS) or path.startswith(EXCLUDED_DIRS):
return False
return PurePosixPath(path).suffix in SOURCE_EXTENSIONS | HEADER_EXTENSIONS
def changed_files(merge_base):
# Against the working tree, so a local run covers uncommitted edits too.
diff = subprocess.run(["git", "diff", "-U0", "--no-color", "--no-ext-diff", "--diff-filter=AMR", merge_base],
check=True, capture_output=True, text=True).stdout
return {path: change for path, change in parse_diff(diff).items() if is_checked(path)}
def compiled_sources(build_dir):
with open(os.path.join(build_dir, "compile_commands.json"), encoding="utf-8") as f:
return {os.path.realpath(os.path.join(entry["directory"], entry["file"])) for entry in json.load(f)}
def run_clang_tidy(clang_tidy, build_dir, path, lines, extra_args):
"""Run clang-tidy on one file, limited to `lines` unless it is None."""
with tempfile.TemporaryDirectory() as tmp:
fixes = os.path.join(tmp, "fixes.yaml")
# The compile database comes from the system clang, which may know warning
# flags a newer clang-tidy has dropped.
cmd = [clang_tidy, "-p", build_dir, "--quiet", "--export-fixes=" + fixes,
"--extra-arg=-Wno-unknown-warning-option", "--extra-arg=-ferror-limit=0", *extra_args, path]
if lines is not None:
cmd.insert(1, "--line-filter=" + json.dumps([{"name": path, "lines": lines}]))
result = subprocess.run(cmd, capture_output=True, text=True)
suggestions = parse_suggested_includes(fixes)
output = result.stdout + result.stderr
return result.returncode, output, parse_diagnostics(output, suggestions)
def parse_suggested_includes(fixes_path):
"""Map each message in an --export-fixes file to the header its fix includes."""
if not os.path.exists(fixes_path):
return {}
suggestions = {}
message = None
with open(fixes_path, encoding="utf-8") as f:
for line in f:
match = FIX_MESSAGE_RE.match(line)
if match:
message = match.group(2).replace("''", "'")
continue
match = FIX_INCLUDE_RE.match(line)
if match and message:
suggestions[message] = match.group(1)
message = None
return suggestions
def parse_diagnostics(output, suggestions):
diagnostics = []
for line in output.splitlines():
match = DIAGNOSTIC_RE.match(line)
if match:
file, row, col, level, message = match.groups()
include = suggestions.get(re.sub(r" \[[^]]*\]$", "", message), "")
diagnostics.append(Diagnostic(file, int(row), int(col), level, message, include))
return diagnostics
def in_ranges(line, ranges):
return any(first <= line <= last for first, last in ranges)
def names_removed_include(include, removed):
"""Whether `include` (<a/b.hpp>) is one of the deleted includes, however it was spelled."""
name = include.strip('<>"')
return bool(name) and any(name == r or name.endswith("/" + r) or r.endswith("/" + name) for r in removed)
def own_errors(diagnostics, path):
real = os.path.realpath(path)
return [d for d in diagnostics if d.is_compile_error and os.path.realpath(d.file) == real]
def error_sites(errors, text):
"""Where each error points, as (source line, column): stable across edits to other lines,
unlike line numbers, and across a removed include, unlike clang's wording."""
lines = text.splitlines()
return Counter((lines[d.line - 1].strip() if d.line <= len(lines) else "", d.col) for d in errors)
def errors_alone_at(revision, clang_tidy, build_dir, path):
"""The error sites a header had when compiled on its own at `revision`."""
shown = subprocess.run(["git", "show", f"{revision}:{path}"], capture_output=True, text=True)
if shown.returncode != 0:
return Counter()
# Beside the original, so its quoted includes resolve the same way.
p = PurePosixPath(path)
copy = str(p.with_name(f".{p.stem}.clang-tidy-base{p.suffix}"))
try:
with open(copy, "w", encoding="utf-8") as f:
f.write(shown.stdout)
_, _, diagnostics = run_clang_tidy(clang_tidy, build_dir, copy, None, [])
finally:
os.remove(copy)
return error_sites(own_errors(diagnostics, copy), shown.stdout)
def check_file(clang_tidy, build_dir, merge_base, path, change, extra_args):
"""Run clang-tidy on one file and return (failed, output, failing diagnostics)."""
# A deleted include can orphan uses on unchanged lines, so such a file is
# checked whole and the findings narrowed here. --fix keeps the line filter
# so it never rewrites unrelated code.
whole = bool(change.removed_includes) and not extra_args
returncode, output, diagnostics = run_clang_tidy(clang_tidy, build_dir, path,
None if whole else change.lines, extra_args)
real = os.path.realpath(path)
def introduced(d):
return os.path.realpath(d.file) == real and (
in_ranges(d.line, change.lines) or names_removed_include(d.include, change.removed_includes))
if PurePosixPath(path).suffix in HEADER_EXTENSIONS:
# Many existing headers only compile after what their includers include
# first, so a header is held to errors it introduces: on its changed
# lines, or anywhere a deleted include leaves it with new errors.
failing = [d for d in diagnostics if introduced(d)]
errors = own_errors(diagnostics, path)
if errors and change.removed_includes:
with open(path, encoding="utf-8") as f:
text = f.read()
before = errors_alone_at(merge_base, clang_tidy, build_dir, path)
failing += [d for d in errors if d not in failing
and (error_sites([d], text) - before)]
return bool(failing), output, failing
if whole:
failing = [d for d in diagnostics if d.is_compile_error or introduced(d)]
return bool(failing), output, failing
return returncode != 0, output, diagnostics
def main():
parser = argparse.ArgumentParser(description=__doc__.split("\n\n")[0])
parser.add_argument("-p", "--build-dir", required=True, help="directory holding compile_commands.json")
parser.add_argument("--base", default="origin/main", help="revision to diff against (default: origin/main)")
parser.add_argument("--clang-tidy", default="clang-tidy", help="clang-tidy executable")
parser.add_argument("-j", "--jobs", type=int, default=os.cpu_count())
parser.add_argument("extra_args", nargs="*", help="passed to clang-tidy after --, e.g. -- --fix")
args = parser.parse_args()
merge_base = subprocess.run(["git", "merge-base", args.base, "HEAD"], check=True,
capture_output=True, text=True).stdout.strip()
files = changed_files(merge_base)
sources = compiled_sources(args.build_dir)
todo = []
for path, change in sorted(files.items()):
is_source = PurePosixPath(path).suffix in SOURCE_EXTENSIONS
if is_source and os.path.realpath(path) not in sources:
print(f"Skipping {path}: not compiled in this configuration")
elif change.lines or change.removed_includes:
todo.append((path, change))
if not todo:
print("No changed C++ lines to check.")
return 0
print(f"Checking {len(todo)} file(s) with {args.clang_tidy}")
annotate = os.environ.get("GITHUB_ACTIONS") == "true"
root = os.getcwd() + os.sep
failed = []
with ThreadPoolExecutor(max_workers=args.jobs) as pool:
jobs = {path: pool.submit(check_file, args.clang_tidy, args.build_dir, merge_base, path, change, args.extra_args)
for path, change in todo}
for path, job in jobs.items():
file_failed, output, diagnostics = job.result()
if not file_failed:
continue
failed.append(path)
print(f"\n==== {path}")
if not diagnostics:
print(output, end="")
for d in diagnostics[:MAX_REPORTED]:
file = d.file.removeprefix(root)
print(f"{file}:{d.line}:{d.col}: {d.level}: {d}")
if annotate:
print(f"::{d.level} file={file},line={d.line},col={d.col}::{d}")
if len(diagnostics) > MAX_REPORTED:
print(f"... and {len(diagnostics) - MAX_REPORTED} more")
if failed:
print(f"\nclang-tidy failed on {len(failed)} file(s). Add the includes it names, or apply its "
"suggestions locally with scripts/run_clang_tidy.sh --fix (scripts\\run_clang_tidy.ps1 -Fix on Windows).")
return 1
print("clang-tidy passed.")
return 0
if __name__ == "__main__":
sys.exit(main())
+1
View File
@@ -0,0 +1 @@
clang-tidy==22.1.8
+225
View File
@@ -0,0 +1,225 @@
<#
.SYNOPSIS
Runs the clang-tidy check that gates pull requests (.github/workflows/clang_tidy.yml) on
your branch. Windows.
.DESCRIPTION
Configures a separate build directory (build-tidy) without the precompiled header, installs
the pinned clang-tidy into a virtual environment inside it, and runs
scripts/clang_tidy_diff.py the way CI does. Uncommitted changes are checked too.
CI runs on Linux. Here clang-tidy also sees Windows-only code and MSVC's standard library,
so it can report findings CI does not; a change that passes here and on Linux passes CI.
.EXAMPLE
powershell -ExecutionPolicy Bypass -File scripts\run_clang_tidy.ps1
.EXAMPLE
powershell -ExecutionPolicy Bypass -File scripts\run_clang_tidy.ps1 -Fix
#>
param(
# Revision to compare against (default: main of the remote that points at
# OrcaSlicer/OrcaSlicer, else origin/main).
[string]$Base = "",
# Do not fetch that remote's main first.
[switch]$NoFetch,
# Build directory for the compile database.
[string]$BuildDir = "build-tidy",
# Dependency build directory (default: the deps\build* tree build_win.bat made).
[string]$DepsDir = "",
# x64 or arm64 (default: this machine's).
[string]$Arch = "",
# Parallel clang-tidy runs (default: all cores).
[int]$Jobs = 0,
# Apply clang-tidy's fixes (adds the missing includes).
[switch]$Fix,
# Install missing tools without asking.
[switch]$Yes
)
$ErrorActionPreference = "Stop"
$Root = Split-Path -Parent $PSScriptRoot
Set-Location $Root
if (-not [System.IO.Path]::IsPathRooted($BuildDir)) { $BuildDir = Join-Path $Root $BuildDir }
# Ask before installing anything. Without a console, or with "no", print the command
# instead so it can be run by hand.
function Ask([string]$Question) {
if ($Yes) { return $true }
if ([Console]::IsInputRedirected) { return $false }
$reply = Read-Host "$Question [y/N]"
return $reply -match '^[Yy]'
}
function Has([string]$Command) {
return [bool](Get-Command $Command -ErrorAction SilentlyContinue)
}
function Request-Install([string]$What, [string]$Command) {
Write-Host "Missing: $What"
if (Ask "Install it now with: $Command ?") {
& cmd /c $Command
if ($LASTEXITCODE -ne 0) { throw "Installing $What failed." }
Write-Host "Installed. Open a new terminal so PATH picks it up, then run this again."
} else {
Write-Host "To install it yourself, run:"
Write-Host " $Command"
}
exit 1
}
if (-not $Arch) {
if ($env:PROCESSOR_ARCHITECTURE -eq "ARM64") { $Arch = "arm64" } else { $Arch = "x64" }
}
# --- System tools -------------------------------------------------------------
if (-not (Has "git")) { Request-Install "Git" "build_win.bat --install-deps" }
# Python: the py launcher, else a python.exe that is not the Microsoft Store stub.
$Python = $null
if (Has "py") {
& py -3 --version *> $null
if ($LASTEXITCODE -eq 0) { $Python = @("py", "-3") }
}
if (-not $Python -and (Has "python")) {
& python --version *> $null
if ($LASTEXITCODE -eq 0) { $Python = @("python") }
}
if (-not $Python) { Request-Install "Python 3" "winget install -e --id Python.Python.3.12" }
$PyExe = $Python[0]
$PyArgs = @($Python | Select-Object -Skip 1)
# Visual Studio provides the compiler, and its CMake component provides CMake and Ninja.
$Vswhere = Join-Path ${env:ProgramFiles(x86)} "Microsoft Visual Studio\Installer\vswhere.exe"
$VsPath = $null
if (Test-Path $Vswhere) {
$VsPath = & $Vswhere -latest -products * -requires Microsoft.VisualStudio.Component.VC.Tools.x86.x64 -property installationPath
}
if (-not $VsPath) { Request-Install "Visual Studio with the C++ tools" "build_win.bat --install-vs buildtools" }
# Load the developer environment, as build_win.bat does.
$HostArch = if ($env:PROCESSOR_ARCHITECTURE -eq "ARM64") { "arm64" } else { "x64" }
$VsDevCmd = Join-Path $VsPath "Common7\Tools\VsDevCmd.bat"
$envLines = & cmd /c "`"$VsDevCmd`" -arch=$Arch -host_arch=$HostArch -no_logo >nul && set"
foreach ($line in $envLines) {
$i = $line.IndexOf("=")
if ($i -gt 0) { Set-Item -Path ("env:" + $line.Substring(0, $i)) -Value $line.Substring($i + 1) }
}
if (-not (Has "cmake")) { Request-Install "CMake" "build_win.bat --install-deps" }
if (-not (Has "ninja")) { Request-Install "Ninja" "winget install -e --id Ninja-build.Ninja" }
# --- clang-tidy ---------------------------------------------------------------
$Requirements = Join-Path $Root "scripts\clang_tidy_requirements.txt"
$Pinned = ((Get-Content $Requirements | Select-String '^clang-tidy==(.+)$').Matches[0].Groups[1].Value).Trim()
$Venv = Join-Path $BuildDir "clang-tidy-venv"
$ClangTidy = $env:CLANG_TIDY
function Test-Pinned([string]$Exe) {
if (-not $Exe -or -not (Test-Path $Exe)) { return $false }
return [bool]((& $Exe --version) -match "version $([regex]::Escape($Pinned))")
}
if (-not $ClangTidy) {
$ClangTidy = Join-Path $Venv "Scripts\clang-tidy.exe"
if (-not (Test-Pinned $ClangTidy)) {
if (Ask "clang-tidy $Pinned (the version CI uses) is not installed. Install it into $Venv?") {
New-Item -ItemType Directory -Force -Path $BuildDir | Out-Null
& $PyExe @PyArgs -m venv $Venv
if ($LASTEXITCODE -ne 0) { throw "Could not create a Python virtual environment." }
& "$Venv\Scripts\python.exe" -m pip install --quiet --upgrade pip
& "$Venv\Scripts\python.exe" -m pip install --quiet -r $Requirements
if ($LASTEXITCODE -ne 0) { throw "Installing clang-tidy $Pinned failed." }
} else {
Write-Host "To install it yourself, run:"
Write-Host " $($Python -join ' ') -m venv $Venv"
Write-Host " $Venv\Scripts\python.exe -m pip install -r scripts\clang_tidy_requirements.txt"
exit 1
}
}
}
if (-not (Test-Pinned $ClangTidy)) {
Write-Warning "$ClangTidy is not clang-tidy $Pinned, so results may differ from CI."
}
# --- Dependencies -------------------------------------------------------------
# build_win.bat names the tree after the compiler and architecture: deps\build for cl,
# deps\build-clang for clang-cl, with -arm64 appended on ARM64.
$Suffix = if ($Arch -eq "arm64") { "-arm64" } else { "" }
$Compiler = "cl"
# A configured build directory remembers where its dependencies are.
$Cache = Join-Path $BuildDir "CMakeCache.txt"
if (-not $DepsDir -and (Test-Path $Cache)) {
$m = Select-String -Path $Cache -Pattern '^DEP_BUILD_DIR:[A-Z]*=(.+)$' | Select-Object -First 1
if ($m) { $DepsDir = $m.Matches[0].Groups[1].Value }
}
if (-not $DepsDir) {
if (Test-Path "deps\build$Suffix\OrcaSlicer_dep") {
$DepsDir = "deps\build$Suffix"
} elseif (Test-Path "deps\build-clang$Suffix\OrcaSlicer_dep") {
$DepsDir = "deps\build-clang$Suffix"
}
}
if ($DepsDir -and ($DepsDir -match 'clang')) { $Compiler = "clang-cl" }
if (-not $DepsDir -or -not (Test-Path (Join-Path $DepsDir "OrcaSlicer_dep"))) {
$BuildDeps = "build_win.bat -d --arch $Arch"
Write-Host "OrcaSlicer's dependencies are not built."
if (Ask "Build them now with $BuildDeps? This takes a while.") {
& cmd /c $BuildDeps
if ($LASTEXITCODE -ne 0) { throw "Building the dependencies failed." }
$DepsDir = "deps\build$Suffix"
} else {
Write-Host "Build them with $BuildDeps, or point to an existing build with -DepsDir."
exit 1
}
}
$DepsDir = (Resolve-Path $DepsDir).Path
if ($Compiler -eq "clang-cl" -and -not (Has "clang-cl")) {
Request-Install "clang-cl (the Visual Studio C++ Clang tools)" "build_win.bat --install-vs buildtools"
}
# --- Compile database ---------------------------------------------------------
# The same configure as CI, with Ninja so CMake writes compile_commands.json. Forward
# slashes keep CMake from reading a backslash as an escape.
$cmakeArgs = @("-S", ".", "-B", $BuildDir, "-G", "Ninja", "-DCMAKE_BUILD_TYPE=Release",
"-DCMAKE_C_COMPILER=$Compiler", "-DCMAKE_CXX_COMPILER=$Compiler",
"-DCMAKE_EXPORT_COMPILE_COMMANDS=ON", "-DSLIC3R_PCH=OFF", "-DORCA_TOOLS=ON", "-DBUILD_TESTS=ON",
"-DDEP_BUILD_DIR=$($DepsDir -replace '\\', '/')")
Write-Host "Configuring $BuildDir with $Compiler"
New-Item -ItemType Directory -Force -Path $BuildDir | Out-Null
$Log = Join-Path $BuildDir "configure.log"
& cmake @cmakeArgs *> $Log
if ($LASTEXITCODE -ne 0) {
Get-Content $Log -Tail 20
throw "Configuring failed; the full log is in $Log."
}
& cmake --build $BuildDir --target git_commit_hash_header *> $null
if ($LASTEXITCODE -ne 0) { throw "Generating git_commit_hash.h failed." }
# --- Base revision ------------------------------------------------------------
if (-not $Base) {
$Remote = "origin"
foreach ($line in (& git remote -v)) {
if ($line -match '^(\S+)\s+\S*github\.com[:/]OrcaSlicer/OrcaSlicer(\.git)?\s+\(fetch\)') {
$Remote = $Matches[1]
break
}
}
if (-not $NoFetch) {
& git fetch --quiet $Remote main
if ($LASTEXITCODE -ne 0) { throw "git fetch $Remote main failed." }
}
$Base = "$Remote/main"
}
Write-Host "Comparing against $Base"
# --- Run ----------------------------------------------------------------------
$diffArgs = @("scripts\clang_tidy_diff.py", "-p", $BuildDir, "--base", $Base, "--clang-tidy", $ClangTidy)
if ($Jobs -gt 0) { $diffArgs += @("-j", "$Jobs") }
if ($Fix) { $diffArgs += @("--", "--fix") }
& $PyExe @PyArgs @diffArgs
exit $LASTEXITCODE
+233
View File
@@ -0,0 +1,233 @@
#!/usr/bin/env bash
# Runs the clang-tidy check that gates pull requests (.github/workflows/clang_tidy.yml)
# on your branch, so its findings match what CI reports. Linux and macOS.
#
# scripts/run_clang_tidy.sh check your changes against OrcaSlicer's main
# scripts/run_clang_tidy.sh --fix also add the missing includes it names
#
# It configures a separate build directory (build-tidy) without the precompiled
# header, installs the pinned clang-tidy into a virtual environment inside it, and
# runs scripts/clang_tidy_diff.py the way CI does. Uncommitted changes are checked too.
set -euo pipefail
usage() {
cat <<'EOF'
Usage: scripts/run_clang_tidy.sh [options]
-b, --base REV revision to compare against (default: main of the remote that
points at OrcaSlicer/OrcaSlicer, else origin/main)
--no-fetch do not fetch that remote's main first
-B, --build-dir DIR build directory for the compile database (default: build-tidy)
-d, --deps-dir DIR dependency build directory (default: deps/build on Linux,
deps/build/<arch> on macOS)
-j, --jobs N parallel clang-tidy runs (default: all cores)
--fix apply clang-tidy's fixes (adds the missing includes)
-y, --yes install missing tools without asking
-h, --help show this help
EOF
}
ROOT=$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)
cd "$ROOT"
BASE=""
FETCH=1
BUILD_DIR=build-tidy
DEPS_DIR=""
JOBS=""
FIX=0
YES=0
while [ $# -gt 0 ]; do
case "$1" in
-b|--base) BASE="$2"; shift 2 ;;
--no-fetch) FETCH=0; shift ;;
-B|--build-dir) BUILD_DIR="$2"; shift 2 ;;
-d|--deps-dir) DEPS_DIR="$2"; shift 2 ;;
-j|--jobs) JOBS="$2"; shift 2 ;;
--fix) FIX=1; shift ;;
-y|--yes) YES=1; shift ;;
-h|--help) usage; exit 0 ;;
*) echo "Unknown option: $1" >&2; usage >&2; exit 2 ;;
esac
done
case "$BUILD_DIR" in
/*) ;;
*) BUILD_DIR="$ROOT/$BUILD_DIR" ;;
esac
OS=$(uname -s)
case "$OS" in
Linux) ;;
Darwin) ;;
*) echo "Unsupported system $OS. On Windows, use scripts/run_clang_tidy.ps1." >&2; exit 1 ;;
esac
# Ask before installing anything. Without a terminal, or with "no", print the
# command instead so it can be run by hand.
ask() {
[ "$YES" = 1 ] && return 0
[ -t 0 ] || return 1
local reply
read -r -p "$1 [y/N] " reply
[[ "$reply" =~ ^[Yy] ]]
}
# --- System tools -------------------------------------------------------------
missing=()
command -v git >/dev/null || missing+=(git)
command -v python3 >/dev/null || missing+=(python3)
command -v cmake >/dev/null || missing+=(cmake)
command -v ninja >/dev/null || missing+=(ninja)
if [ "$OS" = Linux ]; then
# CI builds its compile database with clang; another compiler's flags change what
# clang-tidy sees.
command -v clang >/dev/null && command -v clang++ >/dev/null || missing+=(clang)
fi
if [ ${#missing[@]} -gt 0 ]; then
echo "Missing: ${missing[*]}"
install_cmd=""
if [ "$OS" = Darwin ]; then
pkgs=()
for m in "${missing[@]}"; do
case "$m" in
git|python3|cmake|ninja) pkgs+=("${m/python3/python}") ;;
esac
done
if command -v brew >/dev/null; then
install_cmd="brew install ${pkgs[*]}"
else
echo "Install Homebrew from https://brew.sh, then run: brew install ${pkgs[*]}" >&2
exit 1
fi
elif command -v apt-get >/dev/null; then
pkgs=()
for m in "${missing[@]}"; do
case "$m" in
ninja) pkgs+=(ninja-build) ;;
python3) pkgs+=(python3 python3-venv) ;;
*) pkgs+=("$m") ;;
esac
done
install_cmd="sudo apt-get install -y ${pkgs[*]}"
elif command -v dnf >/dev/null; then
install_cmd="sudo dnf install -y ${missing[*]/ninja/ninja-build}"
elif command -v pacman >/dev/null; then
install_cmd="sudo pacman -S --needed ${missing[*]/python3/python}"
else
echo "Install ${missing[*]} with your package manager and run this again." >&2
exit 1
fi
if ask "Install them now with: $install_cmd ?"; then
$install_cmd
else
echo "To install them yourself, run:" >&2
echo " $install_cmd" >&2
exit 1
fi
fi
# --- clang-tidy ---------------------------------------------------------------
REQUIREMENTS="$ROOT/scripts/clang_tidy_requirements.txt"
PINNED=$(sed -n 's/^clang-tidy==//p' "$REQUIREMENTS")
VENV="$BUILD_DIR/clang-tidy-venv"
if [ -n "${CLANG_TIDY:-}" ]; then
# Set by the caller: use it as is.
:
else
CLANG_TIDY="$VENV/bin/clang-tidy"
if [ ! -x "$CLANG_TIDY" ] || ! "$CLANG_TIDY" --version | grep -q "version $PINNED"; then
if ask "clang-tidy $PINNED (the version CI uses) is not installed. Install it into $VENV?"; then
mkdir -p "$BUILD_DIR"
if ! python3 -m venv "$VENV"; then
echo "Could not create a Python virtual environment." >&2
[ "$OS" = Linux ] && echo "On Debian or Ubuntu, install it with: sudo apt-get install -y python3-venv" >&2
exit 1
fi
"$VENV/bin/pip" install --quiet --upgrade pip
"$VENV/bin/pip" install --quiet -r "$REQUIREMENTS"
else
echo "To install it yourself, run:" >&2
echo " python3 -m venv $VENV && $VENV/bin/pip install -r scripts/clang_tidy_requirements.txt" >&2
exit 1
fi
fi
fi
if ! "$CLANG_TIDY" --version | grep -q "version $PINNED"; then
echo "Warning: $CLANG_TIDY is not clang-tidy $PINNED, so results may differ from CI." >&2
fi
# --- Dependencies -------------------------------------------------------------
# A configured build directory remembers where its dependencies are.
if [ -z "$DEPS_DIR" ] && [ -f "$BUILD_DIR/CMakeCache.txt" ]; then
DEPS_DIR=$(sed -n 's/^DEP_BUILD_DIR:[A-Z]*=//p' "$BUILD_DIR/CMakeCache.txt")
fi
if [ "$OS" = Darwin ]; then
ARCH=$(uname -m)
DEPS_DIR="${DEPS_DIR:-deps/build/$ARCH}"
BUILD_DEPS_CMD="./build_release_macos.sh -d -a $ARCH"
else
DEPS_DIR="${DEPS_DIR:-deps/build}"
BUILD_DEPS_CMD="./build_linux.sh -d"
fi
case "$DEPS_DIR" in
/*) ;;
*) DEPS_DIR="$ROOT/$DEPS_DIR" ;;
esac
if [ ! -d "$DEPS_DIR/OrcaSlicer_dep/usr/local" ]; then
echo "OrcaSlicer's dependencies are not built in $DEPS_DIR."
if ask "Build them now with $BUILD_DEPS_CMD? This takes a while."; then
$BUILD_DEPS_CMD
else
echo "Build them with $BUILD_DEPS_CMD, or point to an existing build with --deps-dir." >&2
exit 1
fi
fi
# --- Compile database ---------------------------------------------------------
# The same configure as CI. DEP_BUILD_DIR is named outright: CMake would otherwise
# derive it from the build directory's name.
cmake_args=(-S . -B "$BUILD_DIR" -G Ninja -DCMAKE_BUILD_TYPE=Release
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DSLIC3R_PCH=OFF -DORCA_TOOLS=ON -DBUILD_TESTS=ON
-DDEP_BUILD_DIR="$DEPS_DIR")
if [ "$OS" = Darwin ]; then
cmake_args+=(-DCMAKE_OSX_ARCHITECTURES="$ARCH" "-DCMAKE_IGNORE_PREFIX_PATH=/opt/local;/usr/local;/opt/homebrew")
else
cmake_args+=(-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++)
fi
echo "Configuring $BUILD_DIR"
mkdir -p "$BUILD_DIR"
if ! cmake "${cmake_args[@]}" >"$BUILD_DIR/configure.log" 2>&1; then
tail -n 20 "$BUILD_DIR/configure.log" >&2
echo "Configuring failed; the full log is in $BUILD_DIR/configure.log." >&2
[ "$OS" = Linux ] && echo "Missing system libraries? Install them with: ./build_linux.sh -u" >&2
exit 1
fi
cmake --build "$BUILD_DIR" --target git_commit_hash_header >/dev/null
# --- Base revision ------------------------------------------------------------
if [ -z "$BASE" ]; then
REMOTE=$(git remote -v | awk '/github\.com[:\/]OrcaSlicer\/OrcaSlicer(\.git)? \(fetch\)/ { print $1; exit }')
REMOTE="${REMOTE:-origin}"
if [ "$FETCH" = 1 ]; then
git fetch --quiet "$REMOTE" main
fi
BASE="$REMOTE/main"
fi
echo "Comparing against $BASE"
# --- Run ----------------------------------------------------------------------
args=(-p "$BUILD_DIR" --base "$BASE" --clang-tidy "$CLANG_TIDY")
[ -n "$JOBS" ] && args+=(-j "$JOBS")
[ "$FIX" = 1 ] && args+=(-- --fix)
exec python3 scripts/clang_tidy_diff.py "${args[@]}"
+132
View File
@@ -0,0 +1,132 @@
#!/usr/bin/env python3
"""Tests for the diff handling in scripts/clang_tidy_diff.py (stdlib unittest, no
external deps).
Run from the repo root: python -m unittest discover -s scripts/tests -v
"""
import os
import sys
import tempfile
import unittest
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
import clang_tidy_diff # noqa: E402
DIFF = """\
diff --git a/src/libslic3r/Color.cpp b/src/libslic3r/Color.cpp
index 1111111..2222222 100644
--- a/src/libslic3r/Color.cpp
+++ b/src/libslic3r/Color.cpp
@@ -3,0 +4 @@
+#include <cassert>
@@ -8 +8,0 @@
-#include "libslic3r/Point.hpp"
@@ -20,2 +21,3 @@ void f()
- old();
- old();
+ a();
+ b();
+ c();
@@ -40 +42,0 @@ void g()
- gone();
diff --git a/src/libslic3r/New.hpp b/src/libslic3r/New.hpp
new file mode 100644
--- /dev/null
+++ b/src/libslic3r/New.hpp
@@ -0,0 +1,2 @@
+#pragma once
+int f();
diff --git a/src/libslic3r/Old.cpp b/src/libslic3r/Renamed.cpp
similarity index 100%
rename from src/libslic3r/Old.cpp
rename to src/libslic3r/Renamed.cpp
"""
class TestParseChangedLines(unittest.TestCase):
def setUp(self):
self.changed = clang_tidy_diff.parse_diff(DIFF)
def test_added_and_replaced_hunks_become_line_ranges(self):
self.assertEqual(self.changed["src/libslic3r/Color.cpp"].lines, [[4, 4], [21, 23]])
def test_deleted_includes_are_collected(self):
self.assertEqual(self.changed["src/libslic3r/Color.cpp"].removed_includes, {"libslic3r/Point.hpp"})
self.assertEqual(self.changed["src/libslic3r/New.hpp"].removed_includes, set())
def test_new_file_covers_every_line(self):
self.assertEqual(self.changed["src/libslic3r/New.hpp"].lines, [[1, 2]])
def test_pure_rename_has_no_changed_lines(self):
self.assertNotIn("src/libslic3r/Renamed.cpp", self.changed)
class TestNamesRemovedInclude(unittest.TestCase):
def test_matches_however_the_include_was_spelled(self):
removed = {"Point.hpp", "cassert"}
self.assertTrue(clang_tidy_diff.names_removed_include("<cassert>", removed))
self.assertTrue(clang_tidy_diff.names_removed_include("<libslic3r/Point.hpp>", removed))
self.assertTrue(clang_tidy_diff.names_removed_include('"Point.hpp"', {"libslic3r/Point.hpp"}))
def test_other_headers_and_no_suggestion_do_not_match(self):
removed = {"libslic3r/Point.hpp"}
self.assertFalse(clang_tidy_diff.names_removed_include("<libslic3r/MultiPoint.hpp>", removed))
self.assertFalse(clang_tidy_diff.names_removed_include("<vector>", removed))
self.assertFalse(clang_tidy_diff.names_removed_include("", removed))
class TestIsChecked(unittest.TestCase):
def test_project_sources_and_headers(self):
for path in ("src/libslic3r/Color.cpp", "src/slic3r/GUI/Tab.hpp", "tests/fff_print/test_flow.cpp",
"src/libslic3r/Format/bbs_3mf.h"):
self.assertTrue(clang_tidy_diff.is_checked(path), path)
def test_vendored_code_other_languages_and_other_dirs(self):
for path in ("src/glad/src/gl.c", "src/glad/include/glad/gl.h", "tests/catch2/src/catch.hpp",
"deps_src/imgui/imgui.cpp", "src/slic3r/Utils/MacUtils.mm", "src/CMakeLists.txt"):
self.assertFalse(clang_tidy_diff.is_checked(path), path)
FIXES = """\
---
MainSourceFile: '/repo/src/libslic3r/Color.cpp'
Diagnostics:
- DiagnosticName: misc-include-cleaner
DiagnosticMessage:
Message: 'no header providing "assert" is directly included'
FilePath: '/repo/src/libslic3r/Color.cpp'
FileOffset: 1974
Replacements:
- FilePath: '/repo/src/libslic3r/Color.cpp'
Offset: 39
Length: 0
ReplacementText: "#include <cassert>\\n"
Level: Error
- DiagnosticName: misc-include-cleaner
DiagnosticMessage:
Message: 'no header providing "Slic3r::comExpert" is directly included'
FilePath: '/repo/src/libslic3r/Color.cpp'
FileOffset: 2148
Replacements: []
Level: Error
...
"""
class TestParseSuggestedIncludes(unittest.TestCase):
def test_maps_each_message_to_the_include_its_fix_inserts(self):
with tempfile.TemporaryDirectory() as tmp:
path = os.path.join(tmp, "fixes.yaml")
with open(path, "w", encoding="utf-8") as f:
f.write(FIXES)
self.assertEqual(clang_tidy_diff.parse_suggested_includes(path),
{'no header providing "assert" is directly included': "<cassert>"})
def test_missing_file_means_no_suggestions(self):
self.assertEqual(clang_tidy_diff.parse_suggested_includes("/nonexistent/fixes.yaml"), {})
if __name__ == "__main__":
unittest.main()
+12
View File
@@ -141,6 +141,18 @@ using namespace nlohmann;
#include "slic3r/GUI/Plater.hpp"
#include "slic3r/GUI/GuiColor.hpp"
#include <GLFW/glfw3.h>
#include "libslic3r/AppConfig.hpp"
#include "libslic3r/BuildVolume.hpp"
#include "libslic3r/ExPolygon.hpp"
#include "libslic3r/Exception.hpp"
#include "libslic3r/GCode/GCodeProcessor.hpp"
#include "libslic3r/GCode/ToolOrdering.hpp"
#include "libslic3r/ObjectID.hpp"
#include "libslic3r/PresetBundle.hpp"
#include "libslic3r/ProjectTask.hpp"
#include "slic3r/GUI/GUI_ObjectList.hpp"
#include "slic3r/GUI/I18N.hpp"
#include "slic3r/GUI/Jobs/SendJob.hpp"
namespace fs = boost::filesystem;
+4 -1
View File
@@ -5,7 +5,6 @@
#include "libslic3r/BoundingBox.hpp"
#include "libslic3r/PrintConfig.hpp"
#include "libslic3r/Format/bbs_3mf.hpp"
#include "libslic3r/GCode/ThumbnailData.hpp"
#include <set>
#include <string>
#include <vector>
@@ -14,6 +13,10 @@
#include "libslic3r/Model.hpp"
#include "libslic3r/Format/AssembleList.hpp"
namespace Slic3r { class Preset; }
namespace Slic3r { struct PlateBBoxData; }
namespace Slic3r { struct ThumbnailData; }
namespace Slic3r {
namespace IO {
@@ -57,6 +57,8 @@
#include <iostream>
#include <set>
#include <string>
#include "libslic3r/AppConfig.hpp"
#include "libslic3r/Format/STEP.hpp"
namespace fs = boost::filesystem;
+1
View File
@@ -26,6 +26,7 @@
#include <stdexcept>
#include <string>
#include <vector>
#include "libslic3r/PrintConfig.hpp"
using namespace Slic3r;
namespace fs = boost::filesystem;
@@ -20,6 +20,7 @@
#include <numeric>
#include <vector>
#include <utility>
#include "libslic3r/BoundingBox.hpp"
namespace Slic3r {
namespace Algorithm {
@@ -28,6 +28,8 @@
#include "libslic3r/Arachne/SkeletalTrapezoidationJoint.hpp"
#include "libslic3r/Arachne/utils/ExtrusionJunction.hpp"
#include "libslic3r/Arachne/utils/ExtrusionLine.hpp"
#include "libslic3r/Arachne/SkeletalTrapezoidationGraph.hpp"
#include "libslic3r/Arachne/utils/PolygonsSegmentIndex.hpp"
#ifndef NDEBUG
#include "libslic3r/EdgeGrid.hpp"
@@ -11,7 +11,6 @@
#include <list>
#include <vector>
#include "utils/HalfEdgeGraph.hpp"
#include "utils/PolygonsSegmentIndex.hpp"
#include "utils/ExtrusionJunction.hpp"
#include "utils/ExtrusionLine.hpp"
-1
View File
@@ -11,7 +11,6 @@
#include <vector>
#include <utility>
#include "BeadingStrategy/BeadingStrategyFactory.hpp"
#include "libslic3r/libslic3r.h"
#include "libslic3r/Point.hpp"
#include "utils/ExtrusionLine.hpp"
@@ -14,7 +14,6 @@
#include "libslic3r/libslic3r.h"
#include "libslic3r/Point.hpp"
#include "libslic3r/Arachne/utils/ExtrusionJunction.hpp"
#include "libslic3r/BoundingBox.hpp"
#include "libslic3r/ExtrusionEntity.hpp"
#include "libslic3r/Line.hpp"
#include "libslic3r/Polygon.hpp"
@@ -19,9 +19,7 @@
#include "ExtrusionJunction.hpp"
#include "../../Polyline.hpp"
#include "../../Polygon.hpp"
#include "../../BoundingBox.hpp"
#include "../../ExtrusionEntity.hpp"
#include "../../Flow.hpp"
#include "libslic3r/libslic3r.h"
#include "libslic3r/Point.hpp"
@@ -15,7 +15,6 @@
#include "SparsePointGrid.hpp"
#include "PolygonsPointIndex.hpp"
#include "../../Polygon.hpp"
#include "libslic3r/Point.hpp"
#include "libslic3r/libslic3r.h"
+1 -1
View File
@@ -29,7 +29,6 @@
#include <libnest2d/utils/rotcalipers.hpp>
#include <numeric>
#include <ClipperUtils.hpp>
#include <boost/geometry/index/rtree.hpp>
#include <utility>
@@ -45,6 +44,7 @@
#include <boost/log/trivial.hpp>
#include <boost/multiprecision/integer.hpp>
#include <boost/rational.hpp>
#include "MultiMaterialSegmentation.hpp"
namespace libnest2d {
#if !defined(_MSC_VER) && defined(__SIZEOF_INT128__) && !defined(__APPLE__)
+5
View File
@@ -32,6 +32,11 @@
#include <boost/log/trivial.hpp>
#include <utility>
#include <vector>
#include "Config.hpp"
#include "ExtrusionEntityCollection.hpp"
#include "MultiMaterialSegmentation.hpp"
#include "SurfaceCollection.hpp"
#include "TriangleMesh.hpp"
#ifndef NDEBUG
// #define BRIM_DEBUG_TO_SVG
+4
View File
@@ -90,6 +90,10 @@
#include <string>
#include <vector>
#include <utility>
#include "libslic3r/Color.hpp"
#include "libslic3r/TriangleMesh.hpp"
class Geom2d_TrimmedCurve;
namespace Slic3r {
+2
View File
@@ -62,6 +62,8 @@
#include <vector>
#include <utility>
class Geom_TrimmedCurve;
namespace Slic3r {
// Single source of truth for the weld tolerance the viewport and the kernel share.
+1
View File
@@ -11,6 +11,7 @@
#include <unordered_map>
#include <vector>
#include <utility>
#include "libslic3r/Point.hpp"
namespace Slic3r {
+4 -1
View File
@@ -6,9 +6,12 @@
// hand-rolled SketchConstraints: full constraint set, real DoF counting, and
// over-constrained (bad-constraint) detection. Solves on a fixed 2D XY workplane.
#include "libslic3r/CAD/SketchEngine.hpp"
#include <vector>
namespace Slic3r { enum class SketchPointRole; }
namespace Slic3r { struct SketchEntity; }
namespace Slic3r { struct SketchEntityConstraintDef; }
namespace Slic3r {
struct SketchSolveResult {
-2
View File
@@ -5,10 +5,8 @@
#include <cstddef>
#include <utility>
#include <math.h>
#include "Geometry.hpp"
#include "Point.hpp"
#include "Line.hpp"
#include "Polygon.hpp"
#include "libslic3r.h"
+2 -1
View File
@@ -2,10 +2,11 @@
#define slic3r_Circle_hpp_
#include "Point.hpp"
#include "Line.hpp"
#include "libslic3r.h"
#include <cmath>
namespace Slic3r { class Line; }
namespace Slic3r {
constexpr double ZERO_TOLERANCE = 0.000005;
+1 -1
View File
@@ -12,7 +12,6 @@
#include "ClipperUtils.hpp"
#include "BoundingBox.hpp"
#include "ExPolygon.hpp"
#include "Geometry.hpp"
#include "Point.hpp"
#include "Polygon.hpp"
#include "Polyline.hpp"
@@ -24,6 +23,7 @@
#include <clipper2/clipper.h>
#include <utility>
#include <vector>
#include "ExtrusionEntity.hpp"
// #define CLIPPER_UTILS_DEBUG
+1
View File
@@ -3,6 +3,7 @@
#include <clipper2/clipper2_z.hpp>
#include <cstddef>
#include "Point.hpp"
namespace Slic3r {
namespace ClipperZUtils {
+1
View File
@@ -13,6 +13,7 @@
#include <libslic3r/ClipperUtils.hpp>
#include <libslic3r/Point.hpp>
#include <libslic3r/ExPolygon.hpp>
#include "Polygon.hpp"
namespace Slic3r {
+3
View File
@@ -14,6 +14,9 @@
#include <math.h>
#include <string>
#include <utility>
#include "Config.hpp"
#include "Polyline.hpp"
#include "PrintConfig.hpp"
namespace Slic3r {
-3
View File
@@ -1,7 +1,4 @@
#include "CustomGCode.hpp"
#include "Config.hpp"
#include "GCode.hpp"
#include "GCodeWriter.hpp"
#include <vector>
#include <utility>
#include <cstddef>
+3 -1
View File
@@ -6,7 +6,9 @@
#include <vector>
#include <admesh/stl.h> // indexed_triangle_set
#include "ExPolygon.hpp"
#include "Emboss.hpp" // IProjection
namespace Slic3r::Emboss { class IProject3d; }
namespace Slic3r::Emboss { class IProjection; }
namespace Slic3r{
+1
View File
@@ -19,6 +19,7 @@
#include <optional>
#include <math.h>
#include <cmath>
#include "BoundingBox.hpp"
namespace Slic3r {
+1 -1
View File
@@ -8,7 +8,6 @@
#include "ElephantFootCompensation.hpp"
#include "Flow.hpp"
#include "Geometry.hpp"
#include "SVG.hpp"
#include "Utils.hpp"
#include <algorithm>
@@ -19,6 +18,7 @@
#include <utility>
#include <math.h>
#include <limits>
#include "ExtrusionEntity.hpp"
// #define CONTOUR_DISTANCE_DEBUG_SVG
@@ -1,7 +1,6 @@
#ifndef slic3r_ElephantFootCompensation_hpp_
#define slic3r_ElephantFootCompensation_hpp_
#include "libslic3r.h"
#include "ExPolygon.hpp"
#include <vector>
-2
View File
@@ -1,6 +1,5 @@
#include "BoundingBox.hpp"
#include "ExPolygon.hpp"
#include "Exception.hpp"
#include "Geometry/MedialAxis.hpp"
#include "Point.hpp"
#include "MultiPoint.hpp"
@@ -8,7 +7,6 @@
#include "Line.hpp"
#include "ClipperUtils.hpp"
#include "Polyline.hpp"
#include "SVG.hpp"
#include "libslic3r.h"
#include <algorithm>
#include <cassert>
+1
View File
@@ -5,6 +5,7 @@
#include <vector>
#include <utility>
#include <algorithm>
#include "Polygon.hpp"
using namespace Slic3r;
// IMPROVE: use one dimensional vector for polygons offset with searching by std::lower_bound
+1
View File
@@ -6,6 +6,7 @@
#include <cassert>
#include <algorithm>
#include <cmath>
#include "Config.hpp"
namespace Slic3r {
-1
View File
@@ -2,7 +2,6 @@
#define slic3r_Extruder_hpp_
#include "libslic3r.h"
#include "Point.hpp"
#include <vector>
namespace Slic3r {
+1 -1
View File
@@ -2,7 +2,6 @@
#include "ExtrusionEntityCollection.hpp"
#include "ExPolygon.hpp"
#include "ClipperUtils.hpp"
#include "Extruder.hpp"
#include "Flow.hpp"
#include <algorithm>
#include <cassert>
@@ -21,6 +20,7 @@
#include <string_view>
#include "Utils.hpp"
#include "libslic3r.h"
#include "ArcFitter.hpp"
#define L(s) (s)
+1
View File
@@ -25,6 +25,7 @@
#include "ExtrusionEntity.hpp"
#include "libslic3r.h"
#include "ExtrusionSimulator.hpp"
#include "Polyline.hpp"
#ifndef M_PI
#define M_PI 3.1415926535897932384626433832795
-1
View File
@@ -2,7 +2,6 @@
#define slic3r_ExtrusionSimulator_hpp_
#include "Point.hpp"
#include "libslic3r.h"
#include "ExtrusionEntity.hpp"
#include "BoundingBox.hpp"
-1
View File
@@ -2,7 +2,6 @@
#include "BoundingBox.hpp"
#include "TriangleMesh.hpp"
#include "SLA/IndexedMesh.hpp"
#include "Model.hpp"
#include <cstdint>
#include <cstddef>
#include <unordered_set>
@@ -5,10 +5,12 @@
#include "libslic3r/libslic3r.h"
#include "libslic3r/Polygon.hpp"
#include "libslic3r/Arachne/utils/ExtrusionJunction.hpp"
#include "libslic3r/Arachne/utils/ExtrusionLine.hpp"
#include "libslic3r/PerimeterGenerator.hpp"
#include <cstddef>
namespace Slic3r { class PerimeterGenerator; }
namespace Slic3r { struct FuzzySkinConfig; }
namespace Slic3r::Arachne { struct ExtrusionLine; }
namespace Slic3r::Feature::FuzzySkin {
void fuzzy_polyline(Points& poly, bool closed, coordf_t slice_z, const FuzzySkinConfig& cfg);
@@ -18,6 +18,10 @@
#include <algorithm>
#include <unordered_set>
#include <vector>
#include "libslic3r/Config.hpp"
#include "libslic3r/Print.hpp"
#include "libslic3r/PrintConfig.hpp"
#include "libslic3r/SurfaceCollection.hpp"
namespace std {
template<> struct hash<Slic3r::GridPoint3>
@@ -6,14 +6,15 @@
#include "libslic3r/libslic3r.h"
#include "libslic3r/Point.hpp"
#include "libslic3r/ExPolygon.hpp"
#include "libslic3r/Print.hpp"
#include "VoxelUtils.hpp"
#include <functional>
#include <cstddef>
#include <utility>
#include <unordered_set>
#include <vector>
#include "libslic3r/MultiMaterialSegmentation.hpp"
namespace Slic3r { class PrintObject; }
namespace Slic3r {
@@ -10,13 +10,13 @@
#include "libslic3r/PrintConfig.hpp"
#include "libslic3r/Polyline.hpp"
#include "libslic3r/Geometry.hpp"
#include "libslic3r/Fill/FillRectilinear.hpp"
#include "libslic3r/Surface.hpp"
#include <functional>
#include <limits>
#include <cassert>
#include <memory>
#include <utility>
#include "libslic3r/BoundingBox.hpp"
namespace Slic3r
{
+7
View File
@@ -41,6 +41,13 @@
#include "libslic3r/Polygon.hpp"
#include "libslic3r/Polyline.hpp"
#include "libslic3r.h"
#include "libslic3r/ExtrusionEntityCollection.hpp"
#include "libslic3r/MultiMaterialSegmentation.hpp"
#include "libslic3r/Slicing.hpp"
#include "libslic3r/SurfaceCollection.hpp"
namespace Slic3r::FillAdaptive { struct Octree; }
namespace Slic3r::FillLightning { class Generator; }
namespace Slic3r {
+1
View File
@@ -16,6 +16,7 @@
#include "libslic3r/Polyline.hpp"
#include <utility>
#include "Fill3DHoneycomb.hpp"
#include "libslic3r/Polygon.hpp"
namespace Slic3r {
+2
View File
@@ -11,6 +11,8 @@
#include "libslic3r/Point.hpp"
#include "libslic3r/Polyline.hpp"
namespace Slic3r { class Point; }
namespace Slic3r {
class Fill3DHoneycomb : public Fill
+3
View File
@@ -49,6 +49,9 @@
#include <boost/geometry/geometries/point.hpp>
#include <boost/geometry/geometries/segment.hpp>
#include <boost/geometry/index/rtree.hpp>
#include "libslic3r/Config.hpp"
#include "libslic3r/Polygon.hpp"
#include "libslic3r/SurfaceCollection.hpp"
namespace Slic3r {
+1
View File
@@ -48,6 +48,7 @@
#include "libslic3r/Line.hpp"
#include "libslic3r/Polygon.hpp"
#include "libslic3r/Utils.hpp"
#include "libslic3r/Flow.hpp"
// #define INFILL_DEBUG_OUTPUT
namespace Slic3r {
+3 -2
View File
@@ -24,10 +24,11 @@
#include "../PrintConfig.hpp"
#include "../Flow.hpp"
#include "../ExtrusionEntity.hpp"
#include "../ExtrusionEntityCollection.hpp"
#include "../ShortestPath.hpp"
#include "libslic3r/Polyline.hpp"
#include "libslic3r/Polygon.hpp"
#include "libslic3r/Point.hpp"
namespace Slic3r { class ExtrusionEntityCollection; }
namespace Slic3r {
+1
View File
@@ -20,6 +20,7 @@
#include <libslic3r/ShortestPath.hpp>
#include <utility>
#include <vector>
#include "libslic3r/ExtrusionEntity.hpp"
namespace Slic3r {
+2 -1
View File
@@ -4,9 +4,10 @@
#include "libslic3r/ExPolygon.hpp"
#include "FillBase.hpp"
#include <utility>
#include "libslic3r/Point.hpp"
#include "libslic3r/Polyline.hpp"
namespace Slic3r { class Point; }
namespace Slic3r {
class FillConcentric : public Fill
@@ -19,6 +19,11 @@
#include <libslic3r/ShortestPath.hpp>
#include <vector>
#include <utility>
#include "libslic3r/BoundingBox.hpp"
#include "libslic3r/Flow.hpp"
#include "libslic3r/PrintConfig.hpp"
namespace Slic3r { class Surface; }
namespace Slic3r {
@@ -4,6 +4,8 @@
#include "libslic3r/ExtrusionEntity.hpp"
#include "FillBase.hpp"
namespace Slic3r { class Surface; }
namespace Slic3r {
class FillConcentricInternal : public Fill
@@ -7,7 +7,6 @@
#include <utility>
#include <vector>
#include "../libslic3r.h"
#include "../Point.hpp"
#include "../Polygon.hpp"
#include "../Polyline.hpp"
+1 -2
View File
@@ -1,6 +1,4 @@
#include "../ClipperUtils.hpp"
#include "../ShortestPath.hpp"
#include "../Surface.hpp"
#include <algorithm>
#include <cmath>
#include <cstddef>
@@ -13,6 +11,7 @@
#include "libslic3r/libslic3r.h"
#include "libslic3r/Polyline.hpp"
#include "FillCrossHatch.hpp"
#include "libslic3r/Polygon.hpp"
namespace Slic3r {
+2 -2
View File
@@ -4,13 +4,13 @@
#include <map>
#include <utility>
#include "../libslic3r.h"
#include "libslic3r/ExPolygon.hpp"
#include "FillBase.hpp"
#include "libslic3r/Point.hpp"
#include "libslic3r/Polyline.hpp"
namespace Slic3r { class Point; }
namespace Slic3r {
class FillCrossHatch : public Fill
+1 -2
View File
@@ -1,7 +1,5 @@
#include "../ClipperUtils.hpp"
#include "../MarchingSquares.hpp"
#include "../ShortestPath.hpp"
#include "../Surface.hpp"
#include <cmath>
#include <algorithm>
#include <cstddef>
@@ -18,6 +16,7 @@
#include "libslic3r/libslic3r.h"
#include "libslic3r/Polyline.hpp"
#include "FillGyroid.hpp"
#include "libslic3r/Polygon.hpp"
// ---------------------------------------------------------------------------
// Marching-squares scalar field for the optimized gyroid branch.
+2 -2
View File
@@ -1,14 +1,14 @@
#ifndef slic3r_FillGyroid_hpp_
#define slic3r_FillGyroid_hpp_
#include "../libslic3r.h"
#include "libslic3r/ExPolygon.hpp"
#include "FillBase.hpp"
#include <utility>
#include "libslic3r/Point.hpp"
#include "libslic3r/Polyline.hpp"
namespace Slic3r { class Point; }
namespace Slic3r {
class FillGyroid : public Fill
+1 -2
View File
@@ -1,6 +1,4 @@
#include "../ClipperUtils.hpp"
#include "../ShortestPath.hpp"
#include "../Surface.hpp"
#include "libslic3r/Fill/FillBase.hpp"
#include "libslic3r/ExPolygon.hpp"
@@ -14,6 +12,7 @@
#include <cstddef>
#include <algorithm>
#include "FillHoneycomb.hpp"
#include "libslic3r/Polygon.hpp"
namespace Slic3r {
-1
View File
@@ -1,6 +1,5 @@
#include "../ClipperUtils.hpp"
#include "../Print.hpp"
#include "../ShortestPath.hpp"
#include "libslic3r/ExPolygon.hpp"
#include "libslic3r/Fill/Lightning/Layer.hpp"
#include "FillBase.hpp"
+2 -1
View File
@@ -6,9 +6,10 @@
#include <memory>
#include <functional>
#include <utility>
#include "libslic3r/Point.hpp"
#include "libslic3r/Polyline.hpp"
namespace Slic3r { class Point; }
namespace Slic3r {
class PrintObject;
+2 -1
View File
@@ -1,7 +1,6 @@
#include "../ClipperUtils.hpp"
#include "../ExPolygon.hpp"
#include "../ShortestPath.hpp"
#include "../Surface.hpp"
#include "libslic3r/Fill/FillBase.hpp"
#include <utility>
#include "libslic3r/Point.hpp"
@@ -15,6 +14,8 @@
#include <cstdlib>
#include "FillLine.hpp"
#include "libslic3r/ExtrusionEntity.hpp"
#include "libslic3r/Polygon.hpp"
namespace Slic3r {
+1 -1
View File
@@ -1,6 +1,5 @@
#include "../ClipperUtils.hpp"
#include "../ShortestPath.hpp"
#include "../Surface.hpp"
#include "libslic3r/BoundingBox.hpp"
#include "libslic3r/Fill/FillBase.hpp"
@@ -18,6 +17,7 @@
#include <cstddef>
#include <type_traits>
#include "FillPlanePath.hpp"
#include "libslic3r/Config.hpp"
namespace Slic3r {
-1
View File
@@ -24,7 +24,6 @@
#include "../Geometry.hpp"
#include "../Surface.hpp"
#include "../ShortestPath.hpp"
#include "../VariableWidth.hpp"
#include "libslic3r/BoundingBox.hpp"
#include "libslic3r/Fill/FillBase.hpp"
+2 -1
View File
@@ -12,10 +12,11 @@
#include <cstddef>
#include <vector>
#include <utility>
#include "libslic3r/Flow.hpp"
#include "libslic3r/Point.hpp"
#include "libslic3r/Polygon.hpp"
namespace Slic3r { class Flow; }
namespace Slic3r {
class PrintRegionConfig;
+3 -2
View File
@@ -1,7 +1,5 @@
#include "../ClipperUtils.hpp"
#include "../ExPolygon.hpp"
#include "../Surface.hpp"
#include "../VariableWidth.hpp"
#include "Arachne/WallToolPaths.hpp"
#include "libslic3r/Polygon.hpp"
#include "libslic3r/Point.hpp"
@@ -22,6 +20,9 @@
#include <math.h>
#include <utility>
#include <vector>
#include "libslic3r/Arachne/utils/ExtrusionJunction.hpp"
#include "libslic3r/ExtrusionEntity.hpp"
#include "libslic3r/Line.hpp"
namespace Slic3r {
+2 -1
View File
@@ -4,9 +4,10 @@
#include "libslic3r/ExPolygon.hpp"
#include "FillBase.hpp"
#include <utility>
#include "libslic3r/Point.hpp"
#include "libslic3r/Polyline.hpp"
namespace Slic3r { class Point; }
namespace Slic3r {
class FillSpiralInset : public Fill
-1
View File
@@ -3,7 +3,6 @@
#include <utility>
#include "libslic3r/libslic3r.h"
#include "FillBase.hpp"
#include "libslic3r/ExPolygon.hpp"
#include "libslic3r/Polyline.hpp"
+1
View File
@@ -16,6 +16,7 @@
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include "libslic3r/Polygon.hpp"
namespace marchsq {
using namespace Slic3r;
-1
View File
@@ -3,7 +3,6 @@
#include <utility>
#include "libslic3r/libslic3r.h"
#include "FillBase.hpp"
#include "libslic3r/ExPolygon.hpp"
#include "libslic3r/Polyline.hpp"
@@ -30,6 +30,9 @@
#include <cmath>
#include <utility>
#include <cassert>
#include "libslic3r/Config.hpp"
#include "libslic3r/MultiMaterialSegmentation.hpp"
#include "libslic3r/SurfaceCollection.hpp"
/* Possible future tasks/optimizations,etc.:
* - Improve connecting heuristic to favor connecting to shorter trees
-1
View File
@@ -14,7 +14,6 @@
#include "../../ClipperUtils.hpp"
#include "../../Geometry.hpp"
#include "Utils.hpp"
#include "libslic3r/libslic3r.h"
#include <cassert>
@@ -19,6 +19,7 @@
#include "libslic3r/BoundingBox.hpp"
#include "SVG.hpp"
#include "libslic3r/libslic3r.h"
#include "libslic3r/Line.hpp"
//#define LIGHTNING_TREE_NODE_DEBUG_OUTPUT
+1 -1
View File
@@ -1,7 +1,6 @@
#include "Flow.hpp"
#include "Exception.hpp"
#include "Config.hpp"
#include "I18N.hpp"
#include "Print.hpp"
#include "libslic3r.h"
#include <cmath>
@@ -10,6 +9,7 @@
#include <boost/algorithm/string/predicate.hpp>
#include <string>
#include <math.h>
#include "PrintConfig.hpp"
// Mark string for localization and translate.
#define L(s) Slic3r::I18N::translate(s)
-1
View File
@@ -4,7 +4,6 @@
#include <math.h>
#include "FlushVolPredictor.hpp"
#include "slic3r/Utils/ColorSpaceConvert.hpp"
#include "Utils.hpp"
#include "FlushVolCalc.hpp"
-2
View File
@@ -3,11 +3,9 @@
#include "../Model.hpp"
#include "../Utils.hpp"
#include "../LocalesUtils.hpp"
#include "../GCode.hpp"
#include "../Geometry.hpp"
#include "../GCode/ThumbnailData.hpp"
#include "../Semver.hpp"
#include "../Time.hpp"
#include "../I18N.hpp"
#include "libslic3r/Point.hpp"
-7
View File
@@ -12,17 +12,10 @@
#include <boost/nowide/cstdio.hpp>
#include "../libslic3r.h"
#include "../Exception.hpp"
#include "../Model.hpp"
#include "../GCode.hpp"
#include "../PrintConfig.hpp"
#include "../Utils.hpp"
#include "../I18N.hpp"
#include "../Geometry.hpp"
#include "../CustomGCode.hpp"
#include "../LocalesUtils.hpp"
#include "libslic3r/Config.hpp"
#include "libslic3r/Point.hpp"
#include "libslic3r/TriangleMesh.hpp"
-1
View File
@@ -1,4 +1,3 @@
#include "../libslic3r.h"
#include "../Model.hpp"
#include "../TriangleMesh.hpp"
#include "../TexturePainting.hpp"
+1 -2
View File
@@ -1,7 +1,6 @@
#include "SL1.hpp"
#include "libslic3r/ExPolygon.hpp"
#include "libslic3r/Config.hpp"
#include "GCode/ThumbnailData.hpp"
#include "libslic3r/libslic3r.h"
#include "libslic3r/Polygon.hpp"
#include "libslic3r/Point.hpp"
@@ -35,7 +34,6 @@
#include "libslic3r/SlicesToTriangleMesh.hpp"
#include "libslic3r/MarchingSquares.hpp"
#include "libslic3r/ClipperUtils.hpp"
#include "libslic3r/MTUtils.hpp"
#include "libslic3r/PrintConfig.hpp"
#include "libslic3r/SLA/RasterBase.hpp"
#include "libslic3r/miniz_extension.hpp"
@@ -50,6 +48,7 @@
#include <string>
#include <utility>
#include <string_view>
#include "libslic3r/SLA/Pad.hpp"
namespace marchsq {
-1
View File
@@ -1,4 +1,3 @@
#include "../libslic3r.h"
#include "../Model.hpp"
#include "../TriangleMesh.hpp"
#include "libslic3r/Exception.hpp"
-1
View File
@@ -1,4 +1,3 @@
#include "../libslic3r.h"
#include "../Model.hpp"
#include "../TriangleMesh.hpp"
+1 -1
View File
@@ -9,7 +9,6 @@
#include "../Geometry.hpp"
#include "../GCode/ThumbnailData.hpp"
#include "../Semver.hpp"
#include "../Time.hpp"
#include "../I18N.hpp"
#include "libslic3r/Point.hpp"
@@ -113,6 +112,7 @@ namespace pt = boost::property_tree;
#include "NSVGUtils.hpp"
#include <fast_float/fast_float.h>
#include "libslic3r/ProjectTask.hpp"
// Slightly faster than sprintf("%.9g"), but there is an issue with the karma floating point formatter,
// https://github.com/boostorg/spirit/pull/586
+1
View File
@@ -37,6 +37,7 @@
#include "TopoDS.hxx"
#include "BRepExtrema_SelfIntersection.hxx"
#include "libslic3r/Polygon.hpp"
#include "libslic3r/Polyline.hpp"
namespace Slic3r {
const double STEP_TRANS_CHORD_ERROR = 0.005;
+8 -1
View File
@@ -120,7 +120,6 @@
#include <Shiny/Shiny.h>
#include "miniz_extension.hpp"
using namespace std::literals::string_view_literals;
@@ -132,6 +131,14 @@ using namespace std::literals::string_view_literals;
#endif
#include <assert.h>
#include "AABBTreeLines.hpp"
#include "Extruder.hpp"
#include "ExtrusionEntityCollection.hpp"
#include "FilamentMixer.hpp"
#include "Format/STEP.hpp"
#include "Model.hpp"
#include "MultiNozzleUtils.hpp"
#include "Slicing.hpp"
namespace fs = boost::filesystem;
+4 -3
View File
@@ -4,10 +4,8 @@
#include "ExtrusionEntity.hpp"
#include "Polygon.hpp"
#include "Config.hpp"
#include "ExtrusionEntityCollection.hpp"
#include "Print.hpp"
#include "libslic3r.h"
#include "ExPolygon.hpp"
#include "GCodeWriter.hpp"
#include "Layer.hpp"
#include "Point.hpp"
@@ -22,7 +20,6 @@
#include "GCode/WipeTower.hpp"
#include "GCode/SeamPlacer.hpp"
#include "GCode/GCodeProcessor.hpp"
#include "EdgeGrid.hpp"
#include "GCode/ThumbnailData.hpp"
#include "libslic3r/ObjectID.hpp"
#include "GCode/ExtrusionProcessor.hpp"
@@ -48,6 +45,10 @@
#include <cfloat>
#include <vector>
#include <utility>
#include "BoundingBox.hpp"
#include "Polyline.hpp"
namespace Slic3r { class ExtrusionEntityCollection; }
namespace Slic3r {
@@ -19,6 +19,9 @@
#include <cctype>
#include <string>
#include <utility>
#include "libslic3r/Config.hpp"
#include "libslic3r/GCodeWriter.hpp"
#include "libslic3r/PrintConfig.hpp"
namespace Slic3r {
@@ -6,7 +6,6 @@
#include "../ExPolygon.hpp"
#include "../Geometry.hpp"
#include "../ClipperUtils.hpp"
#include "../SVG.hpp"
#include "libslic3r/Line.hpp"
#include "libslic3r/libslic3r.h"
#include "libslic3r/Point.hpp"
@@ -31,6 +30,10 @@
#include <boost/range/adaptor/reversed.hpp>
#include <vector>
#include <utility>
#include "libslic3r/Extruder.hpp"
#include "libslic3r/GCodeWriter.hpp"
#include "libslic3r/PrintConfig.hpp"
#include "libslic3r/SurfaceCollection.hpp"
namespace Slic3r {
@@ -1,13 +1,13 @@
#ifndef slic3r_AvoidCrossingPerimeters_hpp_
#define slic3r_AvoidCrossingPerimeters_hpp_
#include "../libslic3r.h"
#include "../ExPolygon.hpp"
#include "../EdgeGrid.hpp"
#include "libslic3r/Polyline.hpp"
#include "libslic3r/Polygon.hpp"
#include "libslic3r/BoundingBox.hpp"
#include <vector>
#include "libslic3r/MultiMaterialSegmentation.hpp"
namespace Slic3r {
+1
View File
@@ -23,6 +23,7 @@
#include <atomic>
#include <utility>
#include <vector>
#include "libslic3r/Model.hpp"
namespace Slic3r {
+2 -3
View File
@@ -1,15 +1,12 @@
#ifndef slic3r_ConflictChecker_hpp_
#define slic3r_ConflictChecker_hpp_
#include "../Utils.hpp"
#include "../Model.hpp"
#include "../Print.hpp"
#include "../Layer.hpp"
#include "libslic3r/Line.hpp"
#include "libslic3r/ExtrusionEntity.hpp"
#include "libslic3r/Point.hpp"
#include "libslic3r/Polyline.hpp"
#include "libslic3r/ExtrusionEntityCollection.hpp"
#include "libslic3r/GCode/GCodeProcessor.hpp"
#include <queue>
@@ -20,6 +17,8 @@
#include <vector>
#include <optional>
namespace Slic3r { class ExtrusionEntityCollection; }
namespace Slic3r {
struct LineWithID
+3
View File
@@ -30,6 +30,9 @@
#endif
#include <assert.h>
#include "libslic3r/Config.hpp"
#include "libslic3r/GCodeWriter.hpp"
#include "libslic3r/PrintConfig.hpp"
namespace Slic3r {
-1
View File
@@ -1,7 +1,6 @@
#ifndef slic3r_CoolingBuffer_hpp_
#define slic3r_CoolingBuffer_hpp_
#include "../libslic3r.h"
#include "../Point.hpp"
#include <cstddef>
#include <map>
+2
View File
@@ -33,6 +33,8 @@
#include <boost/log/trivial.hpp>
#include <string>
#include <string_view>
#include "libslic3r/Config.hpp"
#include "libslic3r/GCodeWriter.hpp"
*/

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