Skip to content

Commit 89073b0

Browse files
authored
Merge pull request #1 from ImLevath/copilot/integrate-resin-like-supports
Add Resin-like (auto) support type for FDM printing + CI release workflow
2 parents 7e1b2d9 + ca27e9c commit 89073b0

File tree

8 files changed

+322
-12
lines changed

8 files changed

+322
-12
lines changed
Lines changed: 273 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,273 @@
1+
name: Build and Release
2+
3+
on:
4+
push:
5+
branches:
6+
- 'copilot/**'
7+
workflow_dispatch:
8+
inputs:
9+
create-release:
10+
description: 'Create a GitHub Release with the built artifacts'
11+
type: boolean
12+
default: true
13+
14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.ref }}
16+
cancel-in-progress: true
17+
18+
env:
19+
ver: ''
20+
ver_pure: ''
21+
22+
jobs:
23+
# ──────────────────────────── Linux ────────────────────────────
24+
build_linux:
25+
name: Build Linux (Ubuntu 24.04)
26+
runs-on: ubuntu-24.04
27+
28+
steps:
29+
- name: Checkout
30+
uses: actions/checkout@v6
31+
with:
32+
lfs: 'true'
33+
34+
- name: Get version
35+
id: ver
36+
run: |
37+
ver_pure=$(grep 'set(SoftFever_VERSION' version.inc | cut -d '"' -f2)
38+
ref="${{ github.ref_name }}"
39+
safe_ref="${ref//\//-}"
40+
ver="dev-${safe_ref}-$(date +'%Y%m%d')"
41+
echo "ver=$ver" >> $GITHUB_ENV
42+
echo "ver_pure=$ver_pure" >> $GITHUB_ENV
43+
echo "ver=$ver" >> $GITHUB_OUTPUT
44+
45+
- name: Install system dependencies
46+
uses: ./.github/actions/apt-install-deps
47+
48+
- name: Cache deps
49+
id: cache-deps
50+
uses: actions/cache@v5
51+
with:
52+
path: ${{ github.workspace }}/deps/build/destdir
53+
key: ubuntu-24.04-orcaslicer-deps-${{ hashFiles('deps/**') }}
54+
55+
- name: Build dependencies (if not cached)
56+
if: steps.cache-deps.outputs.cache-hit != 'true'
57+
run: |
58+
mkdir -p ${{ github.workspace }}/deps/build/destdir
59+
./build_linux.sh -dr
60+
61+
- uses: lukka/get-cmake@latest
62+
with:
63+
cmakeVersion: "~3.28.0"
64+
65+
- name: Build OrcaSlicer + AppImage
66+
run: |
67+
./build_linux.sh -istr
68+
mv -n ./build/OrcaSlicer_Linux_V${{ env.ver_pure }}.AppImage \
69+
./build/OrcaSlicer_Linux_${{ env.ver }}.AppImage
70+
chmod +x ./build/OrcaSlicer_Linux_${{ env.ver }}.AppImage
71+
72+
- name: Upload Linux AppImage
73+
uses: actions/upload-artifact@v6
74+
with:
75+
name: OrcaSlicer-Linux-${{ env.ver }}
76+
path: ./build/OrcaSlicer_Linux_${{ env.ver }}.AppImage
77+
if-no-files-found: error
78+
79+
# ──────────────────────────── Windows ────────────────────────────
80+
build_windows:
81+
name: Build Windows
82+
runs-on: windows-latest
83+
84+
steps:
85+
- name: Checkout
86+
uses: actions/checkout@v6
87+
with:
88+
lfs: 'true'
89+
90+
- name: Get version
91+
id: ver
92+
shell: pwsh
93+
run: |
94+
$ver_pure_match = Select-String -Path version.inc -Pattern 'set\(SoftFever_VERSION "(.*?)"\)'
95+
$ver_pure = $ver_pure_match.Matches[0].Groups[1].Value
96+
$ref = "${{ github.ref_name }}" -replace '/', '-'
97+
$date = Get-Date -Format 'yyyyMMdd'
98+
$ver = "dev-$ref-$date"
99+
echo "ver=$ver" | Out-File -Append $env:GITHUB_ENV
100+
echo "ver_pure=$ver_pure" | Out-File -Append $env:GITHUB_ENV
101+
102+
- uses: microsoft/setup-msbuild@v2
103+
104+
- uses: lukka/get-cmake@latest
105+
with:
106+
cmakeVersion: "~3.28.0"
107+
108+
- name: Install Strawberry Perl
109+
run: choco install strawberryperl
110+
111+
- name: Install NSIS
112+
run: choco install nsis
113+
114+
- name: Cache deps
115+
id: cache-deps
116+
uses: actions/cache@v5
117+
with:
118+
path: ${{ github.workspace }}/deps/build/OrcaSlicer_dep
119+
key: windows-latest-orcaslicer-deps-${{ hashFiles('deps/**') }}
120+
121+
- name: Build dependencies (if not cached)
122+
if: steps.cache-deps.outputs.cache-hit != 'true'
123+
env:
124+
WindowsSdkDir: 'C:\Program Files (x86)\Windows Kits\10\'
125+
WindowsSDKVersion: '10.0.26100.0\'
126+
run: |
127+
.\build_release_vs.bat deps
128+
.\build_release_vs.bat pack
129+
130+
- name: Build OrcaSlicer
131+
env:
132+
WindowsSdkDir: 'C:\Program Files (x86)\Windows Kits\10\'
133+
WindowsSDKVersion: '10.0.26100.0\'
134+
run: .\build_release_vs.bat slicer
135+
136+
- name: Create NSIS installer
137+
working-directory: ${{ github.workspace }}/build
138+
run: cpack -G NSIS
139+
140+
- name: Pack portable zip
141+
working-directory: ${{ github.workspace }}/build
142+
shell: cmd
143+
run: |
144+
"C:/Program Files/7-Zip/7z.exe" a -tzip OrcaSlicer_Windows_${{ env.ver }}_portable.zip OrcaSlicer
145+
146+
- name: Upload Windows installer
147+
uses: actions/upload-artifact@v6
148+
with:
149+
name: OrcaSlicer-Windows-Installer-${{ env.ver }}
150+
path: ${{ github.workspace }}/build/OrcaSlicer*.exe
151+
if-no-files-found: error
152+
153+
- name: Upload Windows portable zip
154+
uses: actions/upload-artifact@v6
155+
with:
156+
name: OrcaSlicer-Windows-Portable-${{ env.ver }}
157+
path: ${{ github.workspace }}/build/OrcaSlicer_Windows_${{ env.ver }}_portable.zip
158+
if-no-files-found: error
159+
160+
# ──────────────────────────── macOS ────────────────────────────
161+
build_macos:
162+
name: Build macOS (arm64)
163+
runs-on: macos-14
164+
165+
steps:
166+
- name: Checkout
167+
uses: actions/checkout@v6
168+
with:
169+
lfs: 'true'
170+
171+
- name: Get version
172+
id: ver
173+
run: |
174+
ver_pure=$(grep 'set(SoftFever_VERSION' version.inc | cut -d '"' -f2)
175+
ref="${{ github.ref_name }}"
176+
safe_ref="${ref//\//-}"
177+
ver="dev-${safe_ref}-$(date +'%Y%m%d')"
178+
echo "ver=$ver" >> $GITHUB_ENV
179+
echo "ver_pure=$ver_pure" >> $GITHUB_ENV
180+
181+
- name: Install tools
182+
run: brew install libtool automake texinfo
183+
184+
- name: Cache deps
185+
id: cache-deps
186+
uses: actions/cache@v5
187+
with:
188+
path: ${{ github.workspace }}/deps/build
189+
key: macos-14-arm64-orcaslicer-deps-${{ hashFiles('deps/**') }}
190+
191+
- name: Build dependencies (if not cached)
192+
if: steps.cache-deps.outputs.cache-hit != 'true'
193+
run: |
194+
mkdir -p ${{ github.workspace }}/deps/build
195+
./build_release_macos.sh -dx -1 -a universal -t 10.15
196+
197+
- uses: lukka/get-cmake@latest
198+
with:
199+
cmakeVersion: "~3.28.0"
200+
201+
- name: Build OrcaSlicer
202+
run: ./build_release_macos.sh -s -n -x -1 -a universal -t 10.15
203+
204+
- name: Upload macOS DMG
205+
uses: actions/upload-artifact@v6
206+
with:
207+
name: OrcaSlicer-macOS-${{ env.ver }}
208+
path: ${{ github.workspace }}/build/OrcaSlicer*.dmg
209+
if-no-files-found: error
210+
211+
# ──────────────────────────── Create Release ────────────────────────────
212+
create_release:
213+
name: Create GitHub Release
214+
needs: [build_linux, build_windows, build_macos]
215+
runs-on: ubuntu-24.04
216+
if: ${{ !cancelled() && (github.event_name == 'workflow_dispatch' && inputs.create-release || github.event_name == 'push') }}
217+
permissions:
218+
contents: write
219+
220+
steps:
221+
- name: Checkout
222+
uses: actions/checkout@v6
223+
224+
- name: Get version
225+
run: |
226+
ver_pure=$(grep 'set(SoftFever_VERSION' version.inc | cut -d '"' -f2)
227+
ref="${{ github.ref_name }}"
228+
safe_ref="${ref//\//-}"
229+
ver="dev-${safe_ref}-$(date +'%Y%m%d')"
230+
echo "ver=$ver" >> $GITHUB_ENV
231+
echo "ver_pure=$ver_pure" >> $GITHUB_ENV
232+
233+
- name: Download all artifacts
234+
uses: actions/download-artifact@v7
235+
with:
236+
path: release-artifacts
237+
238+
- name: List artifacts
239+
run: find release-artifacts -type f | sort
240+
241+
- name: Create Release
242+
uses: softprops/action-gh-release@v2
243+
with:
244+
tag_name: ${{ env.ver }}
245+
name: "OrcaSlicer ${{ env.ver_pure }} with Resin-like Supports"
246+
body: |
247+
## OrcaSlicer with Resin-like Supports
248+
249+
This release includes the **Resin-like (auto)** support type — thin-pillar, point-contact supports inspired by SLA/resin printers for easy removal on FDM printers.
250+
251+
### Downloads
252+
| Platform | File |
253+
|---|---|
254+
| Windows | `OrcaSlicer*.exe` (installer) or `*_portable.zip` |
255+
| Linux | `OrcaSlicer_Linux_*.AppImage` |
256+
| macOS | `OrcaSlicer*.dmg` |
257+
258+
### Changes
259+
- New **Resin-like (auto)** entry in the Support Type dropdown
260+
- Uses the organic tree-support kernel with SLA-inspired parameters:
261+
- Pin-head contact tips (= 1 extrusion line wide)
262+
- Thin branch pillars (≤ 2× line width)
263+
- 30% tip density for reliable overhang coverage
264+
- 1-layer interface for minimal contact area
265+
draft: false
266+
prerelease: true
267+
files: |
268+
release-artifacts/**/*.AppImage
269+
release-artifacts/**/*.exe
270+
release-artifacts/**/*.zip
271+
release-artifacts/**/*.dmg
272+
env:
273+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

src/libslic3r/Print.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1317,7 +1317,8 @@ StringObjectException Print::validate(StringObjectException *warning, Polygons*
13171317
// Custom layering is not allowed for tree supports as of now.
13181318
for (size_t print_object_idx = 0; print_object_idx < m_objects.size(); ++ print_object_idx)
13191319
if (const PrintObject &print_object = *m_objects[print_object_idx];
1320-
print_object.has_support_material() && is_tree(print_object.config().support_type.value) && (print_object.config().support_style.value == smsTreeOrganic ||
1320+
print_object.has_support_material() && is_tree(print_object.config().support_type.value) && (print_object.config().support_style.value == smsTreeOrganic ||
1321+
is_resin_like(print_object.config().support_type.value) ||
13211322
// Orca: use organic as default
13221323
print_object.config().support_style.value == smsDefault) &&
13231324
print_object.model_object()->has_custom_layering()) {
@@ -1491,6 +1492,7 @@ StringObjectException Print::validate(StringObjectException *warning, Polygons*
14911492
// Prusa: Fixing crashes with invalid tip diameter or branch diameter
14921493
// https://github.com/prusa3d/PrusaSlicer/commit/96b3ae85013ac363cd1c3e98ec6b7938aeacf46d
14931494
if (is_tree(object->config().support_type.value) && (object->config().support_style == smsTreeOrganic ||
1495+
is_resin_like(object->config().support_type.value) ||
14941496
// Orca: use organic as default
14951497
object->config().support_style == smsDefault)) {
14961498
float extrusion_width = std::min(

src/libslic3r/PrintConfig.cpp

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -313,10 +313,11 @@ static t_config_enum_values s_keys_map_SupportMaterialInterfacePattern {
313313
CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(SupportMaterialInterfacePattern)
314314

315315
static t_config_enum_values s_keys_map_SupportType{
316-
{ "normal(auto)", stNormalAuto },
317-
{ "tree(auto)", stTreeAuto },
318-
{ "normal(manual)", stNormal },
319-
{ "tree(manual)", stTree }
316+
{ "normal(auto)", stNormalAuto },
317+
{ "tree(auto)", stTreeAuto },
318+
{ "normal(manual)", stNormal },
319+
{ "tree(manual)", stTree },
320+
{ "resin_like(auto)", stResinLikeAuto }
320321
};
321322
CONFIG_OPTION_ENUM_DEFINE_STATIC_MAPS(SupportType)
322323

@@ -5553,17 +5554,21 @@ void PrintConfigDef::init_fff_params()
55535554
def = this->add("support_type", coEnum);
55545555
def->label = L("Type");
55555556
def->category = L("Support");
5556-
def->tooltip = L("Normal (auto) and Tree (auto) are used to generate support automatically. "
5557-
"If Normal (manual) or Tree (manual) is selected, only support enforcers are generated.");
5557+
def->tooltip = L("Normal (auto) and Tree (auto) generate support automatically. "
5558+
"Normal (manual) or Tree (manual) generate support only on enforcers. "
5559+
"Resin-like (auto) generates thin-pillar point-contact supports inspired by SLA printers, "
5560+
"for easy removal.");
55585561
def->enum_keys_map = &ConfigOptionEnum<SupportType>::get_enum_values();
55595562
def->enum_values.push_back("normal(auto)");
55605563
def->enum_values.push_back("tree(auto)");
55615564
def->enum_values.push_back("normal(manual)");
55625565
def->enum_values.push_back("tree(manual)");
5566+
def->enum_values.push_back("resin_like(auto)");
55635567
def->enum_labels.push_back(L("Normal (auto)"));
55645568
def->enum_labels.push_back(L("Tree (auto)"));
55655569
def->enum_labels.push_back(L("Normal (manual)"));
55665570
def->enum_labels.push_back(L("Tree (manual)"));
5571+
def->enum_labels.push_back(L("Resin-like (auto)"));
55675572
def->mode = comSimple;
55685573
def->set_default_value(new ConfigOptionEnum<SupportType>(stNormalAuto));
55695574

src/libslic3r/PrintConfig.hpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,19 +176,23 @@ enum SupportMaterialInterfacePattern {
176176

177177
// BBS
178178
enum SupportType {
179-
stNormalAuto, stTreeAuto, stNormal, stTree
179+
stNormalAuto, stTreeAuto, stNormal, stTree, stResinLikeAuto
180180
};
181181
inline bool is_tree(SupportType stype)
182182
{
183-
return std::set<SupportType>{stTreeAuto, stTree}.count(stype) != 0;
183+
return std::set<SupportType>{stTreeAuto, stTree, stResinLikeAuto}.count(stype) != 0;
184184
};
185185
inline bool is_tree_slim(SupportType type, SupportMaterialStyle style)
186186
{
187187
return is_tree(type) && style==smsTreeSlim;
188188
};
189189
inline bool is_auto(SupportType stype)
190190
{
191-
return std::set<SupportType>{stNormalAuto, stTreeAuto}.count(stype) != 0;
191+
return std::set<SupportType>{stNormalAuto, stTreeAuto, stResinLikeAuto}.count(stype) != 0;
192+
};
193+
inline bool is_resin_like(SupportType stype)
194+
{
195+
return stype == stResinLikeAuto;
192196
};
193197

194198
enum SeamPosition {

src/libslic3r/Support/SupportParameters.hpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,10 @@ struct SupportParameters {
177177
!is_tree(object_config.support_type))
178178
support_style = smsDefault;
179179
}
180-
if (support_style == smsDefault) {
180+
// Resin-like type always uses organic generation; ignore any user-set style.
181+
if (is_resin_like(object_config.support_type.value))
182+
support_style = smsTreeOrganic;
183+
else if (support_style == smsDefault) {
181184
if (is_tree(object_config.support_type)) {
182185
// Orca: use organic as default
183186
support_style = smsTreeOrganic;

src/libslic3r/Support/TreeSupportCommon.hpp

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,25 @@ struct TreeSupportMeshGroupSettings {
9191
this->support_tree_top_rate = config.tree_support_top_rate.value; // percent
9292
// this->support_tree_tip_diameter = this->support_line_width;
9393
this->support_tree_tip_diameter = std::clamp(scaled<coord_t>(config.tree_support_tip_diameter.value), (coord_t)0, this->support_tree_branch_diameter);
94+
95+
// Resin-like type: apply SLA-inspired thin-pillar, pin-head parameters automatically.
96+
if (is_resin_like(config.support_type.value)) {
97+
// Tip diameter: use support line width for a single-extrusion pin-head contact point.
98+
this->support_tree_tip_diameter = this->support_line_width;
99+
// Branch diameter: thin pillars — at most 2× line width or the configured value, whichever is smaller.
100+
this->support_tree_branch_diameter = std::min(this->support_tree_branch_diameter,
101+
this->support_line_width * 2);
102+
// Ensure tip_diameter does not exceed branch_diameter.
103+
this->support_tree_tip_diameter = std::min(this->support_tree_tip_diameter,
104+
this->support_tree_branch_diameter);
105+
// High top-rate so thin tips densely cover the overhang area.
106+
this->support_tree_top_rate = 30.;
107+
// Minimal flat interface (1 layer) — easier removal, like resin supports.
108+
if (this->support_roof_enable && this->support_roof_layers > 1)
109+
this->support_roof_layers = 1;
110+
if (this->support_floor_enable && this->support_floor_layers > 1)
111+
this->support_floor_layers = 1;
112+
}
94113
}
95114

96115
/*********************************************************************/

0 commit comments

Comments
 (0)