Compare commits

..
Author SHA1 Message Date
Hanif Koh 35dc1ca6ef Lock Config and Preset Files Across Instances and Write Them Atomically
Every running instance shares one OrcaSlicer.conf and one user preset
tree, and nothing kept their writers apart. Two instances saving at the
same moment, or the cloud preset sync thread writing while the GUI thread
saved, could interleave, and a reader in another instance could open a
preset JSON or .info file between truncate and close and get a partial
file, dropping that preset for the session with a parse error.

Add InstanceLock, a scoped guard that serialises the threads of one
process through a recursive mutex and other processes through an advisory
OS file lock: flock on POSIX, held on the guard's own descriptor so no
other close in the process can drop it, and LockFileEx on Windows. The
outermost guard opens the lock file and closes it on release, so nothing
stays open between saves and a data dir can be removed once nothing is
saving into it; the file itself is kept, since deleting it would let a
third instance lock a fresh file while the second still holds the old
one. It is best effort: when the lock file cannot be opened or locked, or
another instance still holds it after a second, the guard logs once and
lets the write proceed, then leaves the file alone for ten seconds, so a
hung instance never blocks every other one and a holder stuck in a
debugger does not cost a stall per save. The guard sits at the leaf
readers and writers: set_sync_info_and_save() calls save_info() under the
preset collection mutex, so a batch lock around save_user_presets() would
invert the order against the sync thread. The user preset scan reads its
files on worker threads without the guard, since the mutex would
serialise them, and takes it per file in the serial commit step, so a
save never waits for the whole scan. Each read keeps the bytes of the
preset and its .info as they were before parsing; commit compares them
with the disk under the guard and reads a file that changed again, so it
never deletes or writes back over another instance's newer save, nor
installs a .json and .info from two different saves; a preset another
instance removed in the meantime is not installed. Without the guard, in
a cool-down, the scan still loads the presets but leaves their files
alone: an unreadable file stays for the next scan, and a derived
compatible printer is not written back. Read-only scans, which is what
the CLI does, take no lock and create no lock file.

AppConfig holds OrcaSlicer.conf.lock in load() and save(); load is
included because the Windows path restores from the .bak copy. Every
user preset writer and reader holds user.lock: Preset::save(), which
writes no .info when the preset itself could not be written, since an
.info without its preset reads as a cloud deletion request, save_info(),
reload() and remove_files(), each preset the scan commits, the
bundle metadata reads and write, the .info removal after a cloud-confirmed
delete, the orphaned-.info scan on the sync thread, the bundle folder
removal on unsubscribe and the physical printer writers and delete
paths. A bundle import extracts under cache/ into a folder per process
and per import, where no scan reads.

Preset JSON, .info, bundle metadata, physical printer and config files,
and the caches and state files that already used a temporary by hand,
now go through write_file_atomically(), which writes <file>.<pid>.<n>.tmp
beside the target and renames it over, so a reader that never waits sees
a complete old or new file. A symlink is followed; a target that is not
a regular file is written in place; and when no temporary can be created
beside an existing target, or the rename itself is refused, by a Windows
reader holding the file open or a mount that cannot replace in one step,
the helper writes in place as before, since losing the save is worse
than a torn read. On POSIX the rename replaces the
target atomically where the old code removed it first and left a window
with no file at all; only a mount that refuses a one-step replace gets
the old remove-then-rename. A crash between temporary and rename leaves
the temporary behind, which no scan reads. Preset::save() returns
whether it wrote the preset, so the scan counts a compatible printer it
could not write back as an error. A failed config write keeps
the config dirty, and the idle handler waits ten seconds before retrying
while an explicit save always tries.
2026-09-28 16:21:31 +08:00
raistlin7447 7f30eb8a49 libslic3r: merge the loaded vendors' presets in one pass
load_vendors merged each vendor's bundle into the startup bundle in turn,
inserting every preset at its sorted place in a deque, so each insert shifted
every preset after it.

PresetBundle::merge_presets now takes every loaded bundle at once, and each
collection merges its sorted presets with theirs in one pass. A preset name this
bundle or an earlier one of the list already has is still left out and reported
under the vendor that repeats it, in the same order as before.
2026-09-27 08:42:38 -05:00
raistlin7447 b5d1866445 libslic3r: read the other vendors while the filament library loads
Installing a vendor's filaments looks up the filament library, so load_vendors
loads the library first. Reading a vendor, from its cache or its JSONs, needs
nothing from the library, yet every other vendor waited for it before starting.

load_vendor_configs_from_json splits into read_vendor and install_vendor_read.
load_vendors reads the other vendors in parallel while the library loads, and
installs each against it as soon as both its read and the library are done. A
cache the library can no longer install is still replaced by a parse of the
vendor's JSONs, now when it installs; a canceled load is not mistaken for such
a cache. Vendors start costliest first, and a cache older than the profile
beside it is ordered as a parse.

load_vendors also names the vendors that failed, the library included, which
keeps what it installed before failing and so stays among the bundle's vendors.
The setup wizard falls back to its own scan on that list rather than on which
vendors the bundle holds.
2026-09-27 08:42:37 -05:00
raistlin7447 3b1a5c0630 libslic3r: copy the configs a vendor keeps while resolving
A vendor keeps a copy of each config its other entries inherit, and the filament
library keeps every one of them for the vendors that inherit from it. The copy
was made in commit, one entry at a time on the calling thread while the workers
waited, and the library alone makes 960 of them.

Whether an entry's config is kept depends only on names known before any entry
resolves, so resolve_vendor_preset makes the copy alongside the rest of its work
and commit moves it in.
2026-09-27 08:42:36 -05:00
raistlin7447 18867094fa libslic3r: load the setup wizard's vendors the way startup does
When the wizard's profile-data cache is stale, which any vendor's version change
makes it, the printer and filament selection dialogs rebuild it by loading every
shipped vendor, 66 of them here, one after another. Startup loads its vendors in
parallel once the filament library is in.

That step moves out of load_system_presets_from_json into
PresetBundle::load_vendors, which takes each vendor with the directory it is
installed in, and the wizard calls it too. A vendor that fails to load still
sends the wizard to its hand-written JSON scan, as the exception it used to throw
did, now once the others have loaded and with the error logged. merge_presets
goes private, since the wizard no longer merges bundles itself.

Opening either dialog with a stale cache goes from 3.38-3.55 s to 2.33-2.47 s on
a 16-core desktop, and the vendor rebuild inside it from 2.34-2.48 s to
1.27-1.41 s. The catalog it writes is byte-identical to the one main writes, and
a dump of every preset startup loads is unchanged.
2026-09-27 08:42:36 -05:00
raistlin7447 5ae88ae5c7 libslic3r: install parsed and cached presets through one routine
A cache load installed the entries others inherit from or include first and
resolved the rest together, while the JSON parse installed each entry straight
after parsing it. The two orders only agree while every preset is listed after
what it depends on. An include listed after the preset naming it was missing for
one and found by the other, and every new kind of reference between presets
would have needed the same care in two places.

Both loads now go through install_vendor, which installs processes, filaments and
printers in listing order. Entries resolve together in runs and commit one at a
time, and a run ends before an entry that inherits or includes one already in
it. No entry resolves against a registration from its own run, so the result is
what installing one at a time gives, in any listing order.

The JSON parse reads every sub-file first, under one numeric locale setter, and
stops at the first that fails. The ones before it are installed before the
failure is raised, as they were one at a time, and the filament library's maps
are published only from a complete load. Each entry's parse errors are logged and
counted when it installs, so the log and a load that fails partway come out as
one-at-a-time loading leaves them.

Every preset already in the collection counts as taken for a new one's name.

resolve_vendor_preset and commit_vendor_preset take a VendorInstall with the
collection's shared state in place of a dozen parameters, const for resolve.

The first launch after an update, which parses every profile, goes from
1510-1533 ms to 806-849 ms on a 16-core desktop, and a cached launch from
342-357 ms to 328-334 ms.
2026-09-27 08:42:35 -05:00
raistlin7447 ea3a40d073 libslic3r: move the filament library's config map instead of copying it
Every preset of the filament library keeps its config for other vendors to
inherit from, and publishing that map copied all 1281 of them. The map it is
built in is cleared by the next install before anything reads it again, so the
copy was of no use to anyone.

Loading the library goes from 145 to 86 ms, and the whole preset load from 360
to 300 ms.
2026-09-27 08:42:35 -05:00
raistlin7447 806568287c libslic3r: append a vendor's presets and sort once
Installing a preset placed it at its position in the sorted collection, which
moves every preset after it, so a vendor with 2528 filaments paid an O(n)
insertion 2528 times. That is serial work at the end of a load whose per-preset
part now runs across threads, so it is what the load waits on.

The entries are appended and the collection sorted once they are all in, the way
user presets are already loaded. The sort is on a scope guard, so it also runs
for an entry that cannot be installed and throws past the end of the loop. A
repeated name was caught by find_preset against the half-filled collection,
which an unsorted one cannot answer, so the names are kept in a set, seeded with
the default presets that are in the collection before the first entry arrives.
2026-09-27 08:42:34 -05:00
raistlin7447 0342ddbe26 libslic3r: check only the keys an entry added for validity
A preset's config is a copy of the one it inherits with the entry's diff applied
over it, so the only keys it can hold that the parent does not define are the
ones in that diff. Scanning all of them instead walked 141 keys per filament
preset where 23 would do, and built a vector of every key's name to do it.

The keys the caller knows were added are checked where it has them, and the scan
of everything stays for the callers that do not. An entry that includes a
template is checked the same way, since an include diff holds only keys of the
collection default. The check also moves above Preset::normalize, which derives
keys from the ones it finds. A key derived from one the profile should not have
carried is in neither the diff nor the parent, so after normalize nothing would
name it.
2026-09-27 08:42:34 -05:00
raistlin7447 33af0651b7 libslic3r: resolve user presets together
A user preset is read from its own file and flattened against the system preset
it inherits. It cannot inherit another file of the same pass, because the presets
being read only join the collection once they have all been read, so the files
are independent of each other.

load_presets splits the way the vendor cache load already does:
resolve_user_preset reads and flattens one file and touches nothing shared, and
commit_user_preset installs it, counts its errors, and does the file work a load
can trigger (removing an unreadable preset, writing back a filament preset that
named no compatible printer). Both callers now share resolve_then_commit, which
holds the two-phase shape, works through the items in batches so what is held at
once does not grow with how many there are, and gives each piece of a batch one
CNumericLocalesSetter rather than one per file. It throws rather than commit a
batch that a canceled task group of the caller left unresolved.

A setter nested in another on the same thread does nothing while the locale is
still "C", so one setter per piece of a batch covers every file in it, and each
batch runs isolated, so a thread waiting on it picks up none of the caller's
other work. A filament preset whose derived compatible printer cannot be written
back still loads, with the failure counted.

Loading 328 user presets goes from 105 to 34 ms on a 16-core desktop.
2026-09-27 08:42:33 -05:00
raistlin7447 781a5d8516 libslic3r: compare preset json keys without the locale
Reading one preset file tries a dozen key names against every key in it with
boost::iequals, which compares through std::locale(). Constructing that takes a
lock the whole process shares in the MSVC runtime, so it is both the bulk of the
work in a preset file's parse and the reason two threads cannot do it at once.

Comparing the bytes instead takes loading 328 user presets from 129 to 105 ms
one at a time, and the same files spread across threads from 132 to 27 ms. The
first launch after an update, when the system profiles are parsed from JSON
rather than served from their cache, goes through the same function.
2026-09-27 08:42:32 -05:00
raistlin7447 38446ab77a libslic3r: resolve a vendor's cached presets together
Installing one entry is a config copy, the entry's diff applied over it,
normalization and an invalid-key scan. For the largest vendor that is around
2000 filaments at about 115 us each, and all of it reads state that does not
change while the collection loads.

load_vendor_preset splits into resolve_vendor_preset, which flattens an entry
and touches nothing shared, and commit_vendor_preset, which installs it. A
cache load installs the entries others inherit from first, since what those
register is what the rest resolve against, then resolves the rest together and
commits them one at a time. The JSON parse calls the two back to back as before.

On a 16-core desktop with 4263 system presets installed, preset loading goes
from 644-652 ms to 370-376 ms, and a bundle loaded either way comes out
identical, preset for preset and option for option.
2026-09-27 08:42:32 -05:00
raistlin7447 9080269f6f libslic3r: split the system preset load across threads reliably
The parallel_for over the vendors used an auto_partitioner, which splits its
range only while a worker is asking for work. At six vendors that often did not
happen at all. In two runs out of four on this machine every vendor in that step
ran on the calling thread, which the log shows as one thread id for all of them.

A grain of one splits the range up front. The vendors also start slowest first,
so the vendor that decides when the step ends is not the one left until last. A
vendor with no cache is parsed from its JSONs, which costs far more than any
cache load, so those go before cached ones, and within each group the bigger
file goes first, the cache or the profile index that names the vendor's presets.
2026-09-27 08:42:31 -05:00
173 changed files with 3737 additions and 2371 deletions
+45 -19
View File
@@ -28,8 +28,8 @@ Per-vendor granularity is what makes the system practical:
- A vendor whose profile is bumped invalidates only its own cache. The other 60-odd
vendors keep theirs — even when the bumped vendor is the shared Orca filament
library everyone else inherits from.
- The setup wizard, which loads vendors one at a time, gets the same speedup as
startup without a second code path.
- The setup wizard loads its vendors through the same routine as startup, so it
gets the same speedup without a second code path.
- A vendor with no cache, or a broken one, costs only that vendor a parse.
A cache holds *system* presets only. User presets, project settings and modified
@@ -162,15 +162,20 @@ cache nothing can invalidate is worse than no cache.
Vendors load in a fixed order, because filament inheritance crosses exactly one
boundary: any vendor's filament may inherit from the shared Orca filament library,
and nothing else reaches across vendors — an `include` is always vendor-local. The
library therefore goes first, alone; every other vendor follows in parallel, resolving
against it; and the results are merged in a stable order:
and nothing else reaches across vendors — an `include` is always vendor-local. Only
installing a vendor's presets crosses it; reading the vendor, from its cache or its
JSONs, needs nothing from the library. So every other vendor is read while the library
loads, each is installed against it as soon as both are done, and the results are
merged in a stable order:
```mermaid
flowchart LR
lib["1 · OrcaFilamentLibrary<br/>loaded first, synchronously"] --> par["2 · every other vendor in parallel,<br/>each into its own bundle, filaments<br/>resolving against the loaded library"] --> merge["3 · bundles merged into one,<br/>sequentially, in stable vendor order"]
lib["1 · OrcaFilamentLibrary loaded;<br/>meanwhile every other vendor read<br/>from its cache or its JSONs"] --> par["2 · every other vendor installed<br/>in parallel, each into its own bundle,<br/>filaments resolving against the library"] --> merge["3 · bundles merged into one,<br/>in one pass per collection,<br/>in stable vendor order"]
```
`PresetBundle::load_vendors` runs these steps for startup and for the setup wizard,
which hand it the vendors to load and the directory each is installed in.
Whether a vendor comes from its cache or from a parse changes nothing in that
order — both produce the same bundle, so cached and parsed vendors mix freely in
one startup.
@@ -211,11 +216,12 @@ shipped cache answered first, so the profile in `<data_dir>/system/` was never p
and its cache was never written back.
Serving from a cache is not a memory-image restore. The entries are deserialized and
then installed one by one — inheritance resolved against the presets installed before
them and the currently loaded filament library, includes layered in, configs flattened
onto the collection defaults, validated and registered — by the same function the JSON
path calls straight after parsing a sub-file. An `include` layers what the included
base states, between the parent and the preset's own keys: the base's diff against the
then installed by `install_vendor`, the routine the JSON path hands the vendor's entries
to once it has parsed the sub-files: inheritance resolved against the presets installed
before them and the currently loaded filament library, includes layered in, configs
flattened onto the collection defaults, validated and registered. An `include` layers
what the included base states, between the parent and the preset's own keys: the base's
diff against the
default, taken when the base itself was installed and before the per-variant padding
`inherits` sees, so only what a template sets reaches the presets including it. The two
paths share everything below the parse, which is what makes a cache-loaded bundle
@@ -223,6 +229,16 @@ indistinguishable from a JSON-loaded one by construction rather than by test cov
Installation also rebuilds each preset's file path from the local data directory, so a
shipped cache never carries the generating machine's paths.
Installing an entry is split in two. `resolve_vendor_preset` flattens it, reading only
what is registered under the names it inherits and includes, and `commit_vendor_preset`
registers it, the only step that writes anything shared. Entries resolve across threads
in runs and commit in the order the vendor lists them. A run ends before an entry that
inherits or includes one already in it, since that one's commit registers what the
entry resolves against, so no entry in a run reads what another in it registers. An
entry's parse messages are held until it commits. The bundle, the log's parse and
install messages and the error count therefore come out as parsing and installing one
entry at a time would leave them, whatever the listing order.
App upgrades work because a cache normally survives one. Only a deliberate
`CACHE_VERSION` bump makes an installed cache unreadable, and that is handled at
install time rather than at load: a vendor whose cache this build cannot read counts
@@ -254,17 +270,20 @@ the wizard caches the *derived JSON*, not another form of the inputs:
open, the wizard computes the current stamps (one version peek per vendor) and, when
they match, serves the catalog from the file — no bundle built, no preset installed.
Caching bundle inputs instead was tried and measured: rebuilding the bundle from
per-vendor caches costs ~2 s of preset installation whatever feeds it, so only
skipping the rebuild entirely wins.
per-vendor caches costs over a second of preset installation whatever feeds it, so
only skipping the rebuild entirely wins.
Any change to the set — a vendor added, removed or updated, or its cache-only
`.opc` replaced by a newer one — changes the stamps and retires the whole file;
the wizard then rebuilds the bundle vendor by vendor (per-vendor caches serving where
they cover) and writes the catalog back. Selections, region and per-open decorations
are applied downstream of the cache either way, so a served catalog is
indistinguishable from a rebuilt one. Nothing ships this file and the updater never
touches it; it is a locally written artifact, re-derived whenever stale, written
through a temp file and rename so half a cache is never readable.
the wizard then rebuilds the bundle with `PresetBundle::load_vendors`, the load
startup uses (per-vendor caches serving where they cover), and writes the catalog
back. When a vendor fails to load, the filament library included, that open falls
back to the wizard's own scan of the vendor JSONs, as when no bundle can be built,
and writes nothing. Selections, region and per-open decorations are applied
downstream of the cache either way, so a served catalog is indistinguishable from a
rebuilt one. Nothing ships this file and the updater never touches it; it is a
locally written artifact, re-derived whenever stale, written through a temp file and
rename so half a cache is never readable.
The cache lives under `<data_dir>/cache/`, not beside the vendors: everything that
scans `<data_dir>/system/` treats any `.opc` there as a vendor, so a non-vendor
@@ -378,6 +397,13 @@ enumerates only `*.json` will find no vendors at all in a packaged build.
the `CachedPreset` field list — written and read by `visit_entry` in
`PresetCacheFormat.cpp`, one list for the save, the load and the name peek alike — or
the cache's own layout or stamps, requires bumping `CACHE_VERSION` by hand.
- **Adding a kind of reference between presets**, as `inherits` and `include` are:
parse the names into `CachedPreset` (a field change, so `CACHE_VERSION` is bumped),
have `install_vendor_entries` end a run before an entry that names one already in it
and retain what the names point at, look them up only in `resolve_vendor_preset`, and
register what they point at only in `commit_vendor_preset`. The listing-order test in
`test_vendor_cache.cpp` fails for a kind the runs do not check once its fixture uses
it.
- **The dictionary indexes with a `uint16`**, so `print_config_def` may hold at most
65535 options and one cache at most 65535 distinct enum value names.
`CacheDictionary::save` throws past that, which surfaces when CI generates the
+55 -155
View File
@@ -1,6 +1,6 @@
{
"name": "Blocks",
"version": "02.04.00.13",
"version": "02.04.00.04",
"force_update": "0",
"description": "Blocks configurations",
"machine_model_list": [
@@ -43,8 +43,8 @@
"sub_path": "process/0.16mm Optimal 0.4 nozzle @Blocks_RF50.json"
},
{
"name": "0.20mm Standard 0.4 nozzle @Blocks_Pro_S100",
"sub_path": "process/0.20mm Standard 0.4 nozzle @Blocks_Pro_S100.json"
"name": "0.20mm Standard 0.4 nozzle @Blocks",
"sub_path": "process/0.20mm Standard 0.4 nozzle @Blocks.json"
},
{
"name": "0.20mm Standard 0.4 nozzle @Blocks_RD50_V2",
@@ -55,8 +55,8 @@
"sub_path": "process/0.20mm Standard 0.4 nozzle @Blocks_RF50.json"
},
{
"name": "0.24mm Draft 0.4 nozzle @Blocks_Pro_S100",
"sub_path": "process/0.24mm Draft 0.4 nozzle @Blocks_Pro_S100.json"
"name": "0.24mm Draft 0.4 nozzle @Blocks",
"sub_path": "process/0.24mm Draft 0.4 nozzle @Blocks.json"
},
{
"name": "0.24mm Draft 0.4 nozzle @Blocks_RD50_V2",
@@ -75,8 +75,8 @@
"sub_path": "process/0.28mm Extra Draft 0.4 nozzle @Blocks_RF50.json"
},
{
"name": "0.30mm Extra Draft 0.4 nozzle @Blocks_Pro_S100",
"sub_path": "process/0.30mm Extra Draft 0.4 nozzle @Blocks_Pro_S100.json"
"name": "0.30mm Extra Draft 0.4 nozzle @Blocks",
"sub_path": "process/0.30mm Extra Draft 0.4 nozzle @Blocks.json"
},
{
"name": "fdm_process_common 0.6 nozzle",
@@ -111,8 +111,8 @@
"sub_path": "process/0.26mm Standard 0.6 nozzle @Blocks_RF50.json"
},
{
"name": "0.30mm Standard 0.6 nozzle @Blocks_Pro_S100",
"sub_path": "process/0.30mm Standard 0.6 nozzle @Blocks_Pro_S100.json"
"name": "0.30mm Standard 0.6 nozzle @Blocks",
"sub_path": "process/0.30mm Standard 0.6 nozzle @Blocks.json"
},
{
"name": "0.32mm Draft 0.6 nozzle @Blocks_RD50_V2",
@@ -131,12 +131,12 @@
"sub_path": "process/0.38mm Extra Draft 0.6 nozzle @Blocks_RF50.json"
},
{
"name": "0.40mm Draft 0.6 nozzle @Blocks_Pro_S100",
"sub_path": "process/0.40mm Draft 0.6 nozzle @Blocks_Pro_S100.json"
"name": "0.40mm Draft 0.6 nozzle @Blocks",
"sub_path": "process/0.40mm Draft 0.6 nozzle @Blocks.json"
},
{
"name": "0.30mm Optimal 0.8 nozzle @Blocks_Pro_S100",
"sub_path": "process/0.30mm Optimal 0.8 nozzle @Blocks_Pro_S100.json"
"name": "0.30mm Optimal 0.8 nozzle @Blocks",
"sub_path": "process/0.30mm Optimal 0.8 nozzle @Blocks.json"
},
{
"name": "0.30mm Optimal 0.8 nozzle @Blocks_RD50_V2",
@@ -155,8 +155,8 @@
"sub_path": "process/0.38mm Standard 0.8 nozzle @Blocks_RF50.json"
},
{
"name": "0.40mm Standard 0.8 nozzle @Blocks_Pro_S100",
"sub_path": "process/0.40mm Standard 0.8 nozzle @Blocks_Pro_S100.json"
"name": "0.40mm Standard 0.8 nozzle @Blocks",
"sub_path": "process/0.40mm Standard 0.8 nozzle @Blocks.json"
},
{
"name": "0.46mm Draft 0.8 nozzle @Blocks_RD50_V2",
@@ -167,8 +167,8 @@
"sub_path": "process/0.46mm Draft 0.8 nozzle @Blocks_RF50.json"
},
{
"name": "0.50mm Draft 0.8 nozzle @Blocks_Pro_S100",
"sub_path": "process/0.50mm Draft 0.8 nozzle @Blocks_Pro_S100.json"
"name": "0.50mm Draft 0.8 nozzle @Blocks",
"sub_path": "process/0.50mm Draft 0.8 nozzle @Blocks.json"
},
{
"name": "0.54mm Extra Draft 0.8 nozzle @Blocks_RD50_V2",
@@ -179,36 +179,36 @@
"sub_path": "process/0.54mm Extra Draft 0.8 nozzle @Blocks_RF50.json"
},
{
"name": "0.30mm Optimal 1.0 nozzle @Blocks_Pro_S100",
"sub_path": "process/0.30mm Optimal 1.0 nozzle @Blocks_Pro_S100.json"
"name": "0.30mm Optimal 1.0 nozzle @Blocks",
"sub_path": "process/0.30mm Optimal 1.0 nozzle @Blocks.json"
},
{
"name": "0.50mm Standard 1.0 nozzle @Blocks_Pro_S100",
"sub_path": "process/0.50mm Standard 1.0 nozzle @Blocks_Pro_S100.json"
"name": "0.50mm Standard 1.0 nozzle @Blocks",
"sub_path": "process/0.50mm Standard 1.0 nozzle @Blocks.json"
},
{
"name": "0.60mm Draft 1.0 nozzle @Blocks_Pro_S100",
"sub_path": "process/0.60mm Draft 1.0 nozzle @Blocks_Pro_S100.json"
"name": "0.60mm Draft 1.0 nozzle @Blocks",
"sub_path": "process/0.60mm Draft 1.0 nozzle @Blocks.json"
},
{
"name": "0.70mm Extra Draft 1.0 nozzle @Blocks_Pro_S100",
"sub_path": "process/0.70mm Extra Draft 1.0 nozzle @Blocks_Pro_S100.json"
"name": "0.70mm Extra Draft 1.0 nozzle @Blocks",
"sub_path": "process/0.70mm Extra Draft 1.0 nozzle @Blocks.json"
},
{
"name": "0.50mm Optimal 1.2 nozzle @Blocks_Pro_S100",
"sub_path": "process/0.50mm Optimal 1.2 nozzle @Blocks_Pro_S100.json"
"name": "0.50mm Optimal 1.2 nozzle @Blocks",
"sub_path": "process/0.50mm Optimal 1.2 nozzle @Blocks.json"
},
{
"name": "0.60mm Standard 1.2 nozzle @Blocks_Pro_S100",
"sub_path": "process/0.60mm Standard 1.2 nozzle @Blocks_Pro_S100.json"
"name": "0.60mm Standard 1.2 nozzle @Blocks",
"sub_path": "process/0.60mm Standard 1.2 nozzle @Blocks.json"
},
{
"name": "0.70mm Draft 1.2 nozzle @Blocks_Pro_S100",
"sub_path": "process/0.70mm Draft 1.2 nozzle @Blocks_Pro_S100.json"
"name": "0.70mm Draft 1.2 nozzle @Blocks",
"sub_path": "process/0.70mm Draft 1.2 nozzle @Blocks.json"
},
{
"name": "0.80mm Extra Draft 1.2 nozzle @Blocks_Pro_S100",
"sub_path": "process/0.80mm Extra Draft 1.2 nozzle @Blocks_Pro_S100.json"
"name": "0.80mm Extra Draft 1.2 nozzle @Blocks",
"sub_path": "process/0.80mm Extra Draft 1.2 nozzle @Blocks.json"
}
],
"filament_list": [
@@ -249,148 +249,48 @@
"sub_path": "filament/fdm_filament_tpu.json"
},
{
"name": "Blocks ABS @base",
"sub_path": "filament/Blocks ABS @base.json"
"name": "Generic ABS @Blocks",
"sub_path": "filament/Generic ABS @Blocks.json"
},
{
"name": "Blocks ASA @base",
"sub_path": "filament/Blocks ASA @base.json"
"name": "Generic ASA @Blocks",
"sub_path": "filament/Generic ASA @Blocks.json"
},
{
"name": "Blocks ASA-CF @base",
"sub_path": "filament/Blocks ASA-CF @base.json"
"name": "Generic ASA-CF @Blocks",
"sub_path": "filament/Generic ASA-CF @Blocks.json"
},
{
"name": "Blocks PA @base",
"sub_path": "filament/Blocks PA @base.json"
"name": "Generic PA @Blocks",
"sub_path": "filament/Generic PA @Blocks.json"
},
{
"name": "Blocks PA-CF @base",
"sub_path": "filament/Blocks PA-CF @base.json"
"name": "Generic PA-CF @Blocks",
"sub_path": "filament/Generic PA-CF @Blocks.json"
},
{
"name": "Blocks PC @base",
"sub_path": "filament/Blocks PC @base.json"
"name": "Generic PC @Blocks",
"sub_path": "filament/Generic PC @Blocks.json"
},
{
"name": "Blocks PETG @base",
"sub_path": "filament/Blocks PETG @base.json"
"name": "Generic PETG @Blocks",
"sub_path": "filament/Generic PETG @Blocks.json"
},
{
"name": "Blocks PLA @base",
"sub_path": "filament/Blocks PLA @base.json"
"name": "Generic PLA @Blocks",
"sub_path": "filament/Generic PLA @Blocks.json"
},
{
"name": "Blocks PLA-CF @base",
"sub_path": "filament/Blocks PLA-CF @base.json"
"name": "Generic PLA-CF @Blocks",
"sub_path": "filament/Generic PLA-CF @Blocks.json"
},
{
"name": "Blocks PVA @base",
"sub_path": "filament/Blocks PVA @base.json"
"name": "Generic PVA @Blocks",
"sub_path": "filament/Generic PVA @Blocks.json"
},
{
"name": "Blocks TPU @base",
"sub_path": "filament/Blocks TPU @base.json"
},
{
"name": "Blocks ABS @Blocks_RD50_V2",
"sub_path": "filament/Blocks ABS @Blocks_RD50_V2.json"
},
{
"name": "Blocks ABS @Blocks_RF50",
"sub_path": "filament/Blocks ABS @Blocks_RF50.json"
},
{
"name": "Blocks ASA @Blocks_RD50_V2",
"sub_path": "filament/Blocks ASA @Blocks_RD50_V2.json"
},
{
"name": "Blocks ASA @Blocks_RF50",
"sub_path": "filament/Blocks ASA @Blocks_RF50.json"
},
{
"name": "Blocks ASA-CF @Blocks_RD50_V2",
"sub_path": "filament/Blocks ASA-CF @Blocks_RD50_V2.json"
},
{
"name": "Blocks ASA-CF @Blocks_RF50",
"sub_path": "filament/Blocks ASA-CF @Blocks_RF50.json"
},
{
"name": "Blocks PA @Blocks_RD50_V2",
"sub_path": "filament/Blocks PA @Blocks_RD50_V2.json"
},
{
"name": "Blocks PA @Blocks_RF50",
"sub_path": "filament/Blocks PA @Blocks_RF50.json"
},
{
"name": "Blocks PA-CF @Blocks_RD50_V2",
"sub_path": "filament/Blocks PA-CF @Blocks_RD50_V2.json"
},
{
"name": "Blocks PA-CF @Blocks_RF50",
"sub_path": "filament/Blocks PA-CF @Blocks_RF50.json"
},
{
"name": "Blocks PC @Blocks_RD50_V2",
"sub_path": "filament/Blocks PC @Blocks_RD50_V2.json"
},
{
"name": "Blocks PC @Blocks_RF50",
"sub_path": "filament/Blocks PC @Blocks_RF50.json"
},
{
"name": "Blocks PETG @Blocks_Pro_S100",
"sub_path": "filament/Blocks PETG @Blocks_Pro_S100.json"
},
{
"name": "Blocks PETG @Blocks_RD50_V2",
"sub_path": "filament/Blocks PETG @Blocks_RD50_V2.json"
},
{
"name": "Blocks PETG @Blocks_RF50",
"sub_path": "filament/Blocks PETG @Blocks_RF50.json"
},
{
"name": "Blocks PLA @Blocks_Pro_S100",
"sub_path": "filament/Blocks PLA @Blocks_Pro_S100.json"
},
{
"name": "Blocks PLA @Blocks_RD50_V2",
"sub_path": "filament/Blocks PLA @Blocks_RD50_V2.json"
},
{
"name": "Blocks PLA @Blocks_RF50",
"sub_path": "filament/Blocks PLA @Blocks_RF50.json"
},
{
"name": "Blocks PLA-CF @Blocks_RD50_V2",
"sub_path": "filament/Blocks PLA-CF @Blocks_RD50_V2.json"
},
{
"name": "Blocks PLA-CF @Blocks_RF50",
"sub_path": "filament/Blocks PLA-CF @Blocks_RF50.json"
},
{
"name": "Blocks PVA @Blocks_RD50_V2",
"sub_path": "filament/Blocks PVA @Blocks_RD50_V2.json"
},
{
"name": "Blocks PVA @Blocks_RF50",
"sub_path": "filament/Blocks PVA @Blocks_RF50.json"
},
{
"name": "Blocks TPU @Blocks_Pro_S100",
"sub_path": "filament/Blocks TPU @Blocks_Pro_S100.json"
},
{
"name": "Blocks TPU @Blocks_RD50_V2",
"sub_path": "filament/Blocks TPU @Blocks_RD50_V2.json"
},
{
"name": "Blocks TPU @Blocks_RF50",
"sub_path": "filament/Blocks TPU @Blocks_RF50.json"
"name": "Generic TPU @Blocks",
"sub_path": "filament/Generic TPU @Blocks.json"
}
],
"machine_list": [
@@ -1,14 +0,0 @@
{
"type": "filament",
"name": "Blocks ABS @Blocks_RD50_V2",
"inherits": "Blocks ABS @base",
"from": "system",
"setting_id": "qhQ0qQDGJgsueCAF",
"instantiation": "true",
"compatible_printers": [
"BLOCKS RD50 V2 0.4 nozzle",
"BLOCKS RD50 V2 0.6 nozzle",
"BLOCKS RD50 V2 0.8 nozzle"
],
"renamed_from": "Blocks Generic ABS;Generic ABS @Blocks"
}
@@ -1,13 +0,0 @@
{
"type": "filament",
"name": "Blocks ABS @Blocks_RF50",
"inherits": "Blocks ABS @base",
"from": "system",
"setting_id": "bGYMFFdKiROKuSiY",
"instantiation": "true",
"compatible_printers": [
"BLOCKS RF50 0.4 nozzle",
"BLOCKS RF50 0.6 nozzle",
"BLOCKS RF50 0.8 nozzle"
]
}
@@ -1,14 +0,0 @@
{
"type": "filament",
"name": "Blocks ASA @Blocks_RD50_V2",
"inherits": "Blocks ASA @base",
"from": "system",
"setting_id": "HW7xDXThvpVFbMq5",
"instantiation": "true",
"compatible_printers": [
"BLOCKS RD50 V2 0.4 nozzle",
"BLOCKS RD50 V2 0.6 nozzle",
"BLOCKS RD50 V2 0.8 nozzle"
],
"renamed_from": "Blocks Generic ASA;Generic ASA @Blocks"
}
@@ -1,13 +0,0 @@
{
"type": "filament",
"name": "Blocks ASA @Blocks_RF50",
"inherits": "Blocks ASA @base",
"from": "system",
"setting_id": "lBW7SCsvawi4icNU",
"instantiation": "true",
"compatible_printers": [
"BLOCKS RF50 0.4 nozzle",
"BLOCKS RF50 0.6 nozzle",
"BLOCKS RF50 0.8 nozzle"
]
}
@@ -1,14 +0,0 @@
{
"type": "filament",
"name": "Blocks ASA-CF @Blocks_RD50_V2",
"inherits": "Blocks ASA-CF @base",
"from": "system",
"setting_id": "x5ksnGLGGy1PgDns",
"instantiation": "true",
"compatible_printers": [
"BLOCKS RD50 V2 0.4 nozzle",
"BLOCKS RD50 V2 0.6 nozzle",
"BLOCKS RD50 V2 0.8 nozzle"
],
"renamed_from": "Blocks Generic ASA-CF;Generic ASA-CF @Blocks"
}
@@ -1,13 +0,0 @@
{
"type": "filament",
"name": "Blocks ASA-CF @Blocks_RF50",
"inherits": "Blocks ASA-CF @base",
"from": "system",
"setting_id": "pcbd5qFiMZAvDPg1",
"instantiation": "true",
"compatible_printers": [
"BLOCKS RF50 0.4 nozzle",
"BLOCKS RF50 0.6 nozzle",
"BLOCKS RF50 0.8 nozzle"
]
}
@@ -1,14 +0,0 @@
{
"type": "filament",
"name": "Blocks PA @Blocks_RD50_V2",
"inherits": "Blocks PA @base",
"from": "system",
"setting_id": "gxD81n2jjrReLD29",
"instantiation": "true",
"compatible_printers": [
"BLOCKS RD50 V2 0.4 nozzle",
"BLOCKS RD50 V2 0.6 nozzle",
"BLOCKS RD50 V2 0.8 nozzle"
],
"renamed_from": "Blocks Generic PA;Generic PA @Blocks"
}
@@ -1,13 +0,0 @@
{
"type": "filament",
"name": "Blocks PA @Blocks_RF50",
"inherits": "Blocks PA @base",
"from": "system",
"setting_id": "PzKxRMDnQUzVWRer",
"instantiation": "true",
"compatible_printers": [
"BLOCKS RF50 0.4 nozzle",
"BLOCKS RF50 0.6 nozzle",
"BLOCKS RF50 0.8 nozzle"
]
}
@@ -1,17 +0,0 @@
{
"type": "filament",
"name": "Blocks PA @base",
"inherits": "fdm_filament_pa",
"from": "system",
"filament_id": "OFidOgK4",
"instantiation": "false",
"filament_vendor": [
"Blocks"
],
"filament_flow_ratio": [
"0.98"
],
"filament_max_volumetric_speed": [
"10"
]
}
@@ -1,14 +0,0 @@
{
"type": "filament",
"name": "Blocks PA-CF @Blocks_RD50_V2",
"inherits": "Blocks PA-CF @base",
"from": "system",
"setting_id": "EtbeKx3rbhUo1TtM",
"instantiation": "true",
"compatible_printers": [
"BLOCKS RD50 V2 0.4 nozzle",
"BLOCKS RD50 V2 0.6 nozzle",
"BLOCKS RD50 V2 0.8 nozzle"
],
"renamed_from": "Blocks Generic PA-CF;Generic PA-CF @Blocks"
}
@@ -1,13 +0,0 @@
{
"type": "filament",
"name": "Blocks PA-CF @Blocks_RF50",
"inherits": "Blocks PA-CF @base",
"from": "system",
"setting_id": "udI8Q4X7HaPIaPt4",
"instantiation": "true",
"compatible_printers": [
"BLOCKS RF50 0.4 nozzle",
"BLOCKS RF50 0.6 nozzle",
"BLOCKS RF50 0.8 nozzle"
]
}
@@ -1,14 +0,0 @@
{
"type": "filament",
"name": "Blocks PC @Blocks_RD50_V2",
"inherits": "Blocks PC @base",
"from": "system",
"setting_id": "HLc0shWnKwJzSFyW",
"instantiation": "true",
"compatible_printers": [
"BLOCKS RD50 V2 0.4 nozzle",
"BLOCKS RD50 V2 0.6 nozzle",
"BLOCKS RD50 V2 0.8 nozzle"
],
"renamed_from": "Blocks Generic PC;Generic PC @Blocks"
}
@@ -1,13 +0,0 @@
{
"type": "filament",
"name": "Blocks PC @Blocks_RF50",
"inherits": "Blocks PC @base",
"from": "system",
"setting_id": "9a6bccZopMTeNHYu",
"instantiation": "true",
"compatible_printers": [
"BLOCKS RF50 0.4 nozzle",
"BLOCKS RF50 0.6 nozzle",
"BLOCKS RF50 0.8 nozzle"
]
}
@@ -1,17 +0,0 @@
{
"type": "filament",
"name": "Blocks PC @base",
"inherits": "fdm_filament_pc",
"from": "system",
"filament_id": "OFlGY0MN",
"instantiation": "false",
"filament_vendor": [
"Blocks"
],
"filament_flow_ratio": [
"0.94"
],
"filament_max_volumetric_speed": [
"10"
]
}
@@ -1,16 +0,0 @@
{
"type": "filament",
"name": "Blocks PETG @Blocks_Pro_S100",
"inherits": "Blocks PETG @base",
"from": "system",
"setting_id": "AhMR49fcFqtrQ6hI",
"instantiation": "true",
"compatible_printers": [
"BLOCKS Pro S100 0.4 nozzle",
"BLOCKS Pro S100 0.6 nozzle",
"BLOCKS Pro S100 0.8 nozzle",
"BLOCKS Pro S100 1.0 nozzle",
"BLOCKS Pro S100 1.2 nozzle"
],
"renamed_from": "Blocks Generic PETG;Generic PETG @Blocks"
}
@@ -1,13 +0,0 @@
{
"type": "filament",
"name": "Blocks PETG @Blocks_RD50_V2",
"inherits": "Blocks PETG @base",
"from": "system",
"setting_id": "3v7ah1zVG8MERPSJ",
"instantiation": "true",
"compatible_printers": [
"BLOCKS RD50 V2 0.4 nozzle",
"BLOCKS RD50 V2 0.6 nozzle",
"BLOCKS RD50 V2 0.8 nozzle"
]
}
@@ -1,13 +0,0 @@
{
"type": "filament",
"name": "Blocks PETG @Blocks_RF50",
"inherits": "Blocks PETG @base",
"from": "system",
"setting_id": "S7weR19wo9meJ6Yz",
"instantiation": "true",
"compatible_printers": [
"BLOCKS RF50 0.4 nozzle",
"BLOCKS RF50 0.6 nozzle",
"BLOCKS RF50 0.8 nozzle"
]
}
@@ -1,16 +0,0 @@
{
"type": "filament",
"name": "Blocks PLA @Blocks_Pro_S100",
"inherits": "Blocks PLA @base",
"from": "system",
"setting_id": "vWojuLYIfduLGFLL",
"instantiation": "true",
"compatible_printers": [
"BLOCKS Pro S100 0.4 nozzle",
"BLOCKS Pro S100 0.6 nozzle",
"BLOCKS Pro S100 0.8 nozzle",
"BLOCKS Pro S100 1.0 nozzle",
"BLOCKS Pro S100 1.2 nozzle"
],
"renamed_from": "Blocks Generic PLA;Generic PLA @Blocks"
}
@@ -1,13 +0,0 @@
{
"type": "filament",
"name": "Blocks PLA @Blocks_RD50_V2",
"inherits": "Blocks PLA @base",
"from": "system",
"setting_id": "y7y8NcXNdp17sJUs",
"instantiation": "true",
"compatible_printers": [
"BLOCKS RD50 V2 0.4 nozzle",
"BLOCKS RD50 V2 0.6 nozzle",
"BLOCKS RD50 V2 0.8 nozzle"
]
}
@@ -1,13 +0,0 @@
{
"type": "filament",
"name": "Blocks PLA @Blocks_RF50",
"inherits": "Blocks PLA @base",
"from": "system",
"setting_id": "jt1MJF4eZzkkscEJ",
"instantiation": "true",
"compatible_printers": [
"BLOCKS RF50 0.4 nozzle",
"BLOCKS RF50 0.6 nozzle",
"BLOCKS RF50 0.8 nozzle"
]
}
@@ -1,14 +0,0 @@
{
"type": "filament",
"name": "Blocks PLA-CF @Blocks_RD50_V2",
"inherits": "Blocks PLA-CF @base",
"from": "system",
"setting_id": "lhBtMKP1DmOB3HOI",
"instantiation": "true",
"compatible_printers": [
"BLOCKS RD50 V2 0.4 nozzle",
"BLOCKS RD50 V2 0.6 nozzle",
"BLOCKS RD50 V2 0.8 nozzle"
],
"renamed_from": "Blocks Generic PLA-CF;Generic PLA-CF @Blocks"
}
@@ -1,13 +0,0 @@
{
"type": "filament",
"name": "Blocks PLA-CF @Blocks_RF50",
"inherits": "Blocks PLA-CF @base",
"from": "system",
"setting_id": "6CU83mAyhcZ4FCPI",
"instantiation": "true",
"compatible_printers": [
"BLOCKS RF50 0.4 nozzle",
"BLOCKS RF50 0.6 nozzle",
"BLOCKS RF50 0.8 nozzle"
]
}
@@ -1,23 +0,0 @@
{
"type": "filament",
"name": "Blocks PLA-CF @base",
"inherits": "fdm_filament_pla",
"from": "system",
"filament_id": "OF6FfwOP",
"instantiation": "false",
"filament_vendor": [
"Blocks"
],
"filament_flow_ratio": [
"0.95"
],
"filament_max_volumetric_speed": [
"20"
],
"filament_type": [
"PLA-CF"
],
"slow_down_layer_time": [
"7"
]
}
@@ -1,14 +0,0 @@
{
"type": "filament",
"name": "Blocks PVA @Blocks_RD50_V2",
"inherits": "Blocks PVA @base",
"from": "system",
"setting_id": "hREDqwKF6qyKkakp",
"instantiation": "true",
"compatible_printers": [
"BLOCKS RD50 V2 0.4 nozzle",
"BLOCKS RD50 V2 0.6 nozzle",
"BLOCKS RD50 V2 0.8 nozzle"
],
"renamed_from": "Blocks Generic PVA;Generic PVA @Blocks"
}
@@ -1,13 +0,0 @@
{
"type": "filament",
"name": "Blocks PVA @Blocks_RF50",
"inherits": "Blocks PVA @base",
"from": "system",
"setting_id": "q6pKqHY7Iz4OZaAC",
"instantiation": "true",
"compatible_printers": [
"BLOCKS RF50 0.4 nozzle",
"BLOCKS RF50 0.6 nozzle",
"BLOCKS RF50 0.8 nozzle"
]
}
@@ -1,17 +0,0 @@
{
"type": "filament",
"name": "Blocks PVA @base",
"inherits": "fdm_filament_pva",
"from": "system",
"filament_id": "OFqcNuE1",
"instantiation": "false",
"filament_vendor": [
"Blocks"
],
"filament_flow_ratio": [
"0.98"
],
"filament_max_volumetric_speed": [
"20"
]
}
@@ -1,16 +0,0 @@
{
"type": "filament",
"name": "Blocks TPU @Blocks_Pro_S100",
"inherits": "Blocks TPU @base",
"from": "system",
"setting_id": "6Rkz2je91JRTRoTi",
"instantiation": "true",
"compatible_printers": [
"BLOCKS Pro S100 0.4 nozzle",
"BLOCKS Pro S100 0.6 nozzle",
"BLOCKS Pro S100 0.8 nozzle",
"BLOCKS Pro S100 1.0 nozzle",
"BLOCKS Pro S100 1.2 nozzle"
],
"renamed_from": "Blocks Generic TPU;Generic TPU @Blocks"
}
@@ -1,13 +0,0 @@
{
"type": "filament",
"name": "Blocks TPU @Blocks_RD50_V2",
"inherits": "Blocks TPU @base",
"from": "system",
"setting_id": "mkCqRQTtXldzoEUg",
"instantiation": "true",
"compatible_printers": [
"BLOCKS RD50 V2 0.4 nozzle",
"BLOCKS RD50 V2 0.6 nozzle",
"BLOCKS RD50 V2 0.8 nozzle"
]
}
@@ -1,13 +0,0 @@
{
"type": "filament",
"name": "Blocks TPU @Blocks_RF50",
"inherits": "Blocks TPU @base",
"from": "system",
"setting_id": "bCCvu5Ow1JkwIrRR",
"instantiation": "true",
"compatible_printers": [
"BLOCKS RF50 0.4 nozzle",
"BLOCKS RF50 0.6 nozzle",
"BLOCKS RF50 0.8 nozzle"
]
}
@@ -1,13 +1,12 @@
{
"type": "filament",
"name": "Blocks ABS @base",
"name": "Generic ABS @Blocks",
"inherits": "fdm_filament_abs",
"renamed_from": "Blocks Generic ABS",
"from": "system",
"filament_id": "OFBBhiX8",
"instantiation": "false",
"filament_vendor": [
"Blocks"
],
"setting_id": "TL1Q1kA4t36GGObG",
"filament_id": "OFY9muEs",
"instantiation": "true",
"filament_flow_ratio": [
"0.95"
],
@@ -82,5 +81,13 @@
],
"during_print_exhaust_fan_speed": [
"100"
],
"compatible_printers": [
"BLOCKS RD50 V2 0.4 nozzle",
"BLOCKS RD50 V2 0.6 nozzle",
"BLOCKS RD50 V2 0.8 nozzle",
"BLOCKS RF50 0.4 nozzle",
"BLOCKS RF50 0.6 nozzle",
"BLOCKS RF50 0.8 nozzle"
]
}
@@ -1,13 +1,12 @@
{
"type": "filament",
"name": "Blocks ASA @base",
"name": "Generic ASA @Blocks",
"inherits": "fdm_filament_asa",
"renamed_from": "Blocks Generic ASA",
"from": "system",
"filament_id": "OFTz2YXa",
"instantiation": "false",
"filament_vendor": [
"Blocks"
],
"setting_id": "xP7cB4RHgbm4cYDD",
"filament_id": "OFLPAxz3",
"instantiation": "true",
"filament_flow_ratio": [
"0.95"
],
@@ -82,5 +81,13 @@
],
"during_print_exhaust_fan_speed": [
"100"
],
"compatible_printers": [
"BLOCKS RD50 V2 0.4 nozzle",
"BLOCKS RD50 V2 0.6 nozzle",
"BLOCKS RD50 V2 0.8 nozzle",
"BLOCKS RF50 0.4 nozzle",
"BLOCKS RF50 0.6 nozzle",
"BLOCKS RF50 0.8 nozzle"
]
}
@@ -1,13 +1,12 @@
{
"type": "filament",
"name": "Blocks ASA-CF @base",
"name": "Generic ASA-CF @Blocks",
"inherits": "fdm_filament_asa",
"renamed_from": "Blocks Generic ASA-CF",
"from": "system",
"filament_id": "OF8b9I7o",
"instantiation": "false",
"filament_vendor": [
"Blocks"
],
"setting_id": "ju4ue7yJoz3ujny6",
"filament_id": "OF53eLVD",
"instantiation": "true",
"filament_type": [
"ASA-CF"
],
@@ -85,5 +84,13 @@
],
"during_print_exhaust_fan_speed": [
"100"
],
"compatible_printers": [
"BLOCKS RD50 V2 0.4 nozzle",
"BLOCKS RD50 V2 0.6 nozzle",
"BLOCKS RD50 V2 0.8 nozzle",
"BLOCKS RF50 0.4 nozzle",
"BLOCKS RF50 0.6 nozzle",
"BLOCKS RF50 0.8 nozzle"
]
}
@@ -0,0 +1,24 @@
{
"type": "filament",
"name": "Generic PA @Blocks",
"inherits": "fdm_filament_pa",
"renamed_from": "Blocks Generic PA",
"from": "system",
"setting_id": "hL3p8gAeciwDkjNK",
"filament_id": "OFg8ndtj",
"instantiation": "true",
"filament_flow_ratio": [
"0.98"
],
"filament_max_volumetric_speed": [
"10"
],
"compatible_printers": [
"BLOCKS RD50 V2 0.4 nozzle",
"BLOCKS RD50 V2 0.6 nozzle",
"BLOCKS RD50 V2 0.8 nozzle",
"BLOCKS RF50 0.4 nozzle",
"BLOCKS RF50 0.6 nozzle",
"BLOCKS RF50 0.8 nozzle"
]
}
@@ -1,13 +1,12 @@
{
"type": "filament",
"name": "Blocks PA-CF @base",
"name": "Generic PA-CF @Blocks",
"inherits": "fdm_filament_pa",
"renamed_from": "Blocks Generic PA-CF",
"from": "system",
"filament_id": "OFdWrXpL",
"instantiation": "false",
"filament_vendor": [
"Blocks"
],
"setting_id": "T6SO0WRdnG6wcyG8",
"filament_id": "OFQLcbps",
"instantiation": "true",
"filament_type": [
"PA-CF"
],
@@ -88,5 +87,13 @@
],
"during_print_exhaust_fan_speed": [
"80"
],
"compatible_printers": [
"BLOCKS RD50 V2 0.4 nozzle",
"BLOCKS RD50 V2 0.6 nozzle",
"BLOCKS RD50 V2 0.8 nozzle",
"BLOCKS RF50 0.4 nozzle",
"BLOCKS RF50 0.6 nozzle",
"BLOCKS RF50 0.8 nozzle"
]
}
@@ -0,0 +1,24 @@
{
"type": "filament",
"name": "Generic PC @Blocks",
"inherits": "fdm_filament_pc",
"renamed_from": "Blocks Generic PC",
"from": "system",
"setting_id": "Xhs8PjtmwwVj0ksE",
"filament_id": "OFLakOUI",
"instantiation": "true",
"filament_flow_ratio": [
"0.94"
],
"filament_max_volumetric_speed": [
"10"
],
"compatible_printers": [
"BLOCKS RD50 V2 0.4 nozzle",
"BLOCKS RD50 V2 0.6 nozzle",
"BLOCKS RD50 V2 0.8 nozzle",
"BLOCKS RF50 0.4 nozzle",
"BLOCKS RF50 0.6 nozzle",
"BLOCKS RF50 0.8 nozzle"
]
}
@@ -1,13 +1,12 @@
{
"type": "filament",
"name": "Blocks PETG @base",
"name": "Generic PETG @Blocks",
"inherits": "fdm_filament_petg",
"renamed_from": "Blocks Generic PETG",
"from": "system",
"filament_id": "OF9t1Ga0",
"instantiation": "false",
"filament_vendor": [
"Blocks"
],
"setting_id": "NgzPlYItKHbmGgv3",
"filament_id": "OFYPdQJh",
"instantiation": "true",
"filament_flow_ratio": [
"0.94"
],
@@ -82,5 +81,18 @@
],
"slow_down_layer_time": [
"5"
],
"compatible_printers": [
"BLOCKS Pro S100 0.4 nozzle",
"BLOCKS Pro S100 0.6 nozzle",
"BLOCKS Pro S100 0.8 nozzle",
"BLOCKS Pro S100 1.0 nozzle",
"BLOCKS Pro S100 1.2 nozzle",
"BLOCKS RD50 V2 0.4 nozzle",
"BLOCKS RD50 V2 0.6 nozzle",
"BLOCKS RD50 V2 0.8 nozzle",
"BLOCKS RF50 0.4 nozzle",
"BLOCKS RF50 0.6 nozzle",
"BLOCKS RF50 0.8 nozzle"
]
}
@@ -1,13 +1,12 @@
{
"type": "filament",
"name": "Blocks PLA @base",
"name": "Generic PLA @Blocks",
"inherits": "fdm_filament_pla",
"renamed_from": "Blocks Generic PLA",
"from": "system",
"filament_id": "OFVGAC8g",
"instantiation": "false",
"filament_vendor": [
"Blocks"
],
"setting_id": "kjhuttx4T8OtTNmV",
"filament_id": "OFDSrzZ8",
"instantiation": "true",
"filament_flow_ratio": [
"0.95"
],
@@ -40,5 +39,18 @@
],
"during_print_exhaust_fan_speed": [
"100"
],
"compatible_printers": [
"BLOCKS Pro S100 0.4 nozzle",
"BLOCKS Pro S100 0.6 nozzle",
"BLOCKS Pro S100 0.8 nozzle",
"BLOCKS Pro S100 1.0 nozzle",
"BLOCKS Pro S100 1.2 nozzle",
"BLOCKS RD50 V2 0.4 nozzle",
"BLOCKS RD50 V2 0.6 nozzle",
"BLOCKS RD50 V2 0.8 nozzle",
"BLOCKS RF50 0.4 nozzle",
"BLOCKS RF50 0.6 nozzle",
"BLOCKS RF50 0.8 nozzle"
]
}
@@ -0,0 +1,30 @@
{
"type": "filament",
"name": "Generic PLA-CF @Blocks",
"inherits": "fdm_filament_pla",
"renamed_from": "Blocks Generic PLA-CF",
"from": "system",
"setting_id": "oKUqzwAWMrpiyGLf",
"filament_id": "OFWbdGsC",
"instantiation": "true",
"filament_flow_ratio": [
"0.95"
],
"filament_max_volumetric_speed": [
"20"
],
"filament_type": [
"PLA-CF"
],
"slow_down_layer_time": [
"7"
],
"compatible_printers": [
"BLOCKS RD50 V2 0.4 nozzle",
"BLOCKS RD50 V2 0.6 nozzle",
"BLOCKS RD50 V2 0.8 nozzle",
"BLOCKS RF50 0.4 nozzle",
"BLOCKS RF50 0.6 nozzle",
"BLOCKS RF50 0.8 nozzle"
]
}
@@ -0,0 +1,24 @@
{
"type": "filament",
"name": "Generic PVA @Blocks",
"inherits": "fdm_filament_pva",
"renamed_from": "Blocks Generic PVA",
"from": "system",
"setting_id": "tNw3oe7VovLkgUbB",
"filament_id": "OFDvXujf",
"instantiation": "true",
"filament_flow_ratio": [
"0.98"
],
"filament_max_volumetric_speed": [
"20"
],
"compatible_printers": [
"BLOCKS RD50 V2 0.4 nozzle",
"BLOCKS RD50 V2 0.6 nozzle",
"BLOCKS RD50 V2 0.8 nozzle",
"BLOCKS RF50 0.4 nozzle",
"BLOCKS RF50 0.6 nozzle",
"BLOCKS RF50 0.8 nozzle"
]
}
@@ -1,13 +1,12 @@
{
"type": "filament",
"name": "Blocks TPU @base",
"name": "Generic TPU @Blocks",
"inherits": "fdm_filament_tpu",
"renamed_from": "Blocks Generic TPU",
"from": "system",
"filament_id": "OFYnedOZ",
"instantiation": "false",
"filament_vendor": [
"Blocks"
],
"setting_id": "6iVYOCZo8ugs4JA0",
"filament_id": "OFgbpcy9",
"instantiation": "true",
"filament_max_volumetric_speed": [
"4"
],
@@ -55,5 +54,18 @@
],
"during_print_exhaust_fan_speed": [
"80"
],
"compatible_printers": [
"BLOCKS Pro S100 0.4 nozzle",
"BLOCKS Pro S100 0.6 nozzle",
"BLOCKS Pro S100 0.8 nozzle",
"BLOCKS Pro S100 1.0 nozzle",
"BLOCKS Pro S100 1.2 nozzle",
"BLOCKS RD50 V2 0.4 nozzle",
"BLOCKS RD50 V2 0.6 nozzle",
"BLOCKS RD50 V2 0.8 nozzle",
"BLOCKS RF50 0.4 nozzle",
"BLOCKS RF50 0.6 nozzle",
"BLOCKS RF50 0.8 nozzle"
]
}
@@ -6,7 +6,7 @@
"setting_id": "G7HQgaspHXduDM8O",
"instantiation": "true",
"printer_model": "BLOCKS Pro S100",
"default_print_profile": "0.20mm Standard 0.4 nozzle @Blocks_Pro_S100",
"default_print_profile": "0.20mm Standard 0.4 nozzle @Blocks",
"max_layer_height": [
"0.30"
],
@@ -25,8 +25,5 @@
"printable_height": "900",
"upward_compatible_machine": [
"BLOCKS Pro S100"
],
"default_filament_profile": [
"Blocks PLA @Blocks_Pro_S100"
]
}
@@ -6,7 +6,7 @@
"setting_id": "XkWdS210oUMQN17N",
"instantiation": "true",
"printer_model": "BLOCKS Pro S100",
"default_print_profile": "0.30mm Standard 0.6 nozzle @Blocks_Pro_S100",
"default_print_profile": "0.30mm Standard 0.6 nozzle @Blocks",
"max_layer_height": [
"0.50"
],
@@ -26,8 +26,5 @@
"upward_compatible_machine": [
"BLOCKS Pro S100"
],
"printer_variant": "0.6",
"default_filament_profile": [
"Blocks PLA @Blocks_Pro_S100"
]
"printer_variant": "0.6"
}
@@ -6,7 +6,7 @@
"setting_id": "I6PdeCS7SbvIlkZf",
"instantiation": "true",
"printer_model": "BLOCKS Pro S100",
"default_print_profile": "0.40mm Standard 0.8 nozzle @Blocks_Pro_S100",
"default_print_profile": "0.40mm Standard 0.8 nozzle @Blocks",
"max_layer_height": [
"0.56"
],
@@ -26,8 +26,5 @@
"upward_compatible_machine": [
"BLOCKS Pro S100"
],
"printer_variant": "0.8",
"default_filament_profile": [
"Blocks PLA @Blocks_Pro_S100"
]
"printer_variant": "0.8"
}
@@ -6,7 +6,7 @@
"setting_id": "elLdUyy9RhUoa37o",
"instantiation": "true",
"printer_model": "BLOCKS Pro S100",
"default_print_profile": "0.50mm Standard 1.0 nozzle @Blocks_Pro_S100",
"default_print_profile": "0.50mm Standard 1.0 nozzle @Blocks",
"max_layer_height": [
"0.7"
],
@@ -26,8 +26,5 @@
"upward_compatible_machine": [
"BLOCKS Pro S100"
],
"printer_variant": "1.0",
"default_filament_profile": [
"Blocks PLA @Blocks_Pro_S100"
]
"printer_variant": "1.0"
}
@@ -6,7 +6,7 @@
"setting_id": "xtsGSJ4JkbHTPi44",
"instantiation": "true",
"printer_model": "BLOCKS Pro S100",
"default_print_profile": "0.60mm Standard 1.2 nozzle @Blocks_Pro_S100",
"default_print_profile": "0.60mm Standard 1.2 nozzle @Blocks",
"max_layer_height": [
"0.8"
],
@@ -26,8 +26,5 @@
"upward_compatible_machine": [
"BLOCKS Pro S100"
],
"printer_variant": "1.2",
"default_filament_profile": [
"Blocks PLA @Blocks_Pro_S100"
]
"printer_variant": "1.2"
}
@@ -8,5 +8,5 @@
"bed_model": "PRO S100 HotBed model.stl",
"bed_texture": "PRO S100 HotBed texture.svg",
"hotend_model": "BLOCKS PrintCore.stl",
"default_materials": "Blocks PLA @Blocks_Pro_S100;Blocks PETG @Blocks_Pro_S100;Blocks TPU @Blocks_Pro_S100"
"default_materials": "Generic PLA @Blocks;Generic PETG @Blocks;Generic TPU @Blocks"
}
@@ -34,9 +34,5 @@
"printable_height": "500",
"upward_compatible_machine": [
"BLOCKS RD50 V2"
],
"printer_variant": "0.4",
"default_filament_profile": [
"Blocks PLA @Blocks_RD50_V2"
]
}
@@ -35,8 +35,5 @@
"deretraction_speed": [
"80"
],
"printer_variant": "0.6",
"default_filament_profile": [
"Blocks PLA @Blocks_RD50_V2"
]
"printer_variant": "0.6"
}
@@ -35,8 +35,5 @@
"deretraction_speed": [
"80"
],
"printer_variant": "0.8",
"default_filament_profile": [
"Blocks PLA @Blocks_RD50_V2"
]
"printer_variant": "0.8"
}
@@ -8,5 +8,5 @@
"bed_model": "RD50 V2 HotBed model.stl",
"bed_texture": "RD50 V2 HotBed texture.svg",
"hotend_model": "BLOCKS PrintCore.stl",
"default_materials": "Blocks PLA @Blocks_RD50_V2;Blocks PETG @Blocks_RD50_V2;Blocks TPU @Blocks_RD50_V2"
"default_materials": "Generic PLA @Blocks;Generic PETG @Blocks;Generic TPU @Blocks"
}
@@ -51,7 +51,7 @@
"12"
],
"retraction_length": [
"1.2"
"1"
],
"retraction_speed": [
"60"
@@ -79,10 +79,5 @@
],
"retract_before_wipe": [
"0"
],
"default_filament_profile": [
"Blocks PLA @Blocks_RF50"
],
"support_multi_bed_types": "1",
"default_bed_type": "Textured PEI Plate"
]
}
@@ -51,7 +51,7 @@
"12"
],
"retraction_length": [
"1.2"
"1"
],
"retraction_speed": [
"60"
@@ -75,8 +75,8 @@
"BLOCKS RF50"
],
"machine_start_gcode": [
"PRINT_START EXTRUDER=[nozzle_temperature_initial_layer] BED=[bed_temperature_initial_layer]\n",
"SET_PRESSURE_ADVANCE ADVANCE=0.046\n"
"PRINT_START EXTRUDER=[nozzle_temperature_initial_layer] BED=[bed_temperature_initial_layer]",
"SET_PRESSURE_ADVANCE ADVANCE=0.046"
],
"printer_variant": "0.6",
"wipe_distance": [
@@ -84,10 +84,5 @@
],
"retract_before_wipe": [
"0"
],
"default_filament_profile": [
"Blocks PLA @Blocks_RF50"
],
"support_multi_bed_types": "1",
"default_bed_type": "Textured PEI Plate"
]
}
@@ -51,7 +51,7 @@
"12"
],
"retraction_length": [
"1.2"
"1"
],
"retraction_speed": [
"60"
@@ -80,10 +80,5 @@
],
"retract_before_wipe": [
"0"
],
"default_filament_profile": [
"Blocks PLA @Blocks_RF50"
],
"support_multi_bed_types": "1",
"default_bed_type": "Textured PEI Plate"
]
}
@@ -8,6 +8,5 @@
"bed_model": "RF50 HotBed model.stl",
"bed_texture": "RF50 HotBed texture.svg",
"hotend_model": "BLOCKS PrintCore.stl",
"default_materials": "Blocks PLA @Blocks_RF50;Blocks PETG @Blocks_RF50;Blocks TPU @Blocks_RF50",
"not_support_bed_type": "Smooth Cool Plate;Engineering Plate;Textured Cool Plate;Cool Plate (SuperTack)"
"default_materials": "Generic PLA @Blocks;Generic PETG @Blocks;Generic TPU @Blocks"
}
@@ -123,6 +123,9 @@
"wipe": [
"1"
],
"default_filament_profile": [
"Generic PLA @Blocks"
],
"bed_exclude_area": [
"0x0"
],
@@ -21,7 +21,7 @@
"top_solid_infill_flow_ratio": "0.97",
"bottom_solid_infill_flow_ratio": "1.08",
"seam_position": "aligned",
"sparse_infill_pattern": "grid",
"sparse_infill_patter": "grid",
"initial_layer_speed": "60",
"initial_layer_infill_speed": "80",
"initial_travel_speed": "100%",
@@ -57,7 +57,5 @@
"accel_to_decel_enable": "1",
"accel_to_decel_factor": "50%",
"elefant_foot_compensation": "0.25",
"elefant_foot_compensation_layers": "1",
"skirt_loops": "2",
"skirt_type": "perobject"
"elefant_foot_compensation_layers": "1"
}
@@ -21,7 +21,7 @@
"top_solid_infill_flow_ratio": "0.97",
"bottom_solid_infill_flow_ratio": "1.08",
"seam_position": "aligned",
"sparse_infill_pattern": "grid",
"sparse_infill_patter": "grid",
"initial_layer_speed": "60",
"initial_layer_infill_speed": "80",
"initial_travel_speed": "100%",
@@ -57,7 +57,5 @@
"accel_to_decel_enable": "1",
"accel_to_decel_factor": "50%",
"elefant_foot_compensation": "0.25",
"elefant_foot_compensation_layers": "1",
"skirt_loops": "2",
"skirt_type": "perobject"
"elefant_foot_compensation_layers": "1"
}
@@ -21,7 +21,7 @@
"top_solid_infill_flow_ratio": "0.97",
"bottom_solid_infill_flow_ratio": "1.08",
"seam_position": "aligned",
"sparse_infill_pattern": "grid",
"sparse_infill_patter": "grid",
"initial_layer_speed": "60",
"initial_layer_infill_speed": "80",
"initial_travel_speed": "100%",
@@ -57,7 +57,5 @@
"accel_to_decel_enable": "1",
"accel_to_decel_factor": "50%",
"elefant_foot_compensation": "0.25",
"elefant_foot_compensation_layers": "1",
"skirt_loops": "2",
"skirt_type": "perobject"
"elefant_foot_compensation_layers": "1"
}
@@ -1,15 +1,14 @@
{
"type": "process",
"name": "0.20mm Standard 0.4 nozzle @Blocks_Pro_S100",
"name": "0.20mm Standard 0.4 nozzle @Blocks",
"inherits": "fdm_process_blocks_common",
"from": "system",
"setting_id": "QSEguMMChNFZsK5H",
"setting_id": "47aDtVL6E5DVr7Mt",
"instantiation": "true",
"layer_height": "0.2",
"bottom_shell_layers": "4",
"top_shell_layers": "5",
"compatible_printers": [
"BLOCKS Pro S100 0.4 nozzle"
],
"renamed_from": "0.20mm Standard 0.4 nozzle @Blocks"
]
}
@@ -25,7 +25,7 @@
"top_solid_infill_flow_ratio": "0.97",
"bottom_solid_infill_flow_ratio": "1.08",
"seam_position": "aligned",
"sparse_infill_pattern": "grid",
"sparse_infill_patter": "grid",
"initial_layer_speed": "60",
"initial_layer_infill_speed": "80",
"initial_travel_speed": "100%",
@@ -61,7 +61,5 @@
"accel_to_decel_enable": "1",
"accel_to_decel_factor": "50%",
"elefant_foot_compensation": "0.25",
"elefant_foot_compensation_layers": "1",
"skirt_loops": "2",
"skirt_type": "perobject"
"elefant_foot_compensation_layers": "1"
}
@@ -1,15 +1,14 @@
{
"type": "process",
"name": "0.24mm Draft 0.4 nozzle @Blocks_Pro_S100",
"name": "0.24mm Draft 0.4 nozzle @Blocks",
"inherits": "fdm_process_blocks_common",
"from": "system",
"setting_id": "uALfEFHGmup6vBYI",
"setting_id": "ETADjxV6ViJQdnHA",
"instantiation": "true",
"layer_height": "0.24",
"bottom_shell_layers": "4",
"top_shell_layers": "5",
"compatible_printers": [
"BLOCKS Pro S100 0.4 nozzle"
],
"renamed_from": "0.24mm Draft 0.4 nozzle @Blocks"
]
}
@@ -21,7 +21,7 @@
"top_solid_infill_flow_ratio": "0.97",
"bottom_solid_infill_flow_ratio": "1.08",
"seam_position": "aligned",
"sparse_infill_pattern": "grid",
"sparse_infill_patter": "grid",
"initial_layer_speed": "60",
"initial_layer_infill_speed": "80",
"initial_travel_speed": "100%",
@@ -57,7 +57,5 @@
"accel_to_decel_enable": "1",
"accel_to_decel_factor": "50%",
"elefant_foot_compensation": "0.25",
"elefant_foot_compensation_layers": "1",
"skirt_loops": "2",
"skirt_type": "perobject"
"elefant_foot_compensation_layers": "1"
}
@@ -21,7 +21,7 @@
"top_solid_infill_flow_ratio": "0.97",
"bottom_solid_infill_flow_ratio": "1.08",
"seam_position": "aligned",
"sparse_infill_pattern": "grid",
"sparse_infill_patter": "grid",
"initial_layer_speed": "60",
"initial_layer_infill_speed": "80",
"initial_travel_speed": "100%",
@@ -57,7 +57,5 @@
"accel_to_decel_enable": "1",
"accel_to_decel_factor": "50%",
"elefant_foot_compensation": "0.25",
"elefant_foot_compensation_layers": "1",
"skirt_loops": "2",
"skirt_type": "perobject"
"elefant_foot_compensation_layers": "1"
}
@@ -22,7 +22,7 @@
"top_solid_infill_flow_ratio": "0.97",
"bottom_solid_infill_flow_ratio": "1.08",
"seam_position": "aligned",
"sparse_infill_pattern": "grid",
"sparse_infill_patter": "grid",
"initial_layer_speed": "60",
"initial_layer_infill_speed": "80",
"initial_travel_speed": "100%",
@@ -57,7 +57,5 @@
"accel_to_decel_enable": "1",
"accel_to_decel_factor": "50%",
"elefant_foot_compensation": "0.25",
"elefant_foot_compensation_layers": "1",
"skirt_loops": "2",
"skirt_type": "perobject"
"elefant_foot_compensation_layers": "1"
}
@@ -1,15 +1,14 @@
{
"type": "process",
"name": "0.30mm Extra Draft 0.4 nozzle @Blocks_Pro_S100",
"name": "0.30mm Extra Draft 0.4 nozzle @Blocks",
"inherits": "fdm_process_blocks_common",
"from": "system",
"setting_id": "HYKF5l2OGvpugSQy",
"setting_id": "UbuICsmppKDsaaZ4",
"instantiation": "true",
"bottom_shell_layers": "3",
"top_shell_layers": "4",
"layer_height": "0.30",
"compatible_printers": [
"BLOCKS Pro S100 0.4 nozzle"
],
"renamed_from": "0.30mm Extra Draft 0.4 nozzle @Blocks"
]
}
@@ -1,15 +1,14 @@
{
"type": "process",
"name": "0.30mm Optimal 0.8 nozzle @Blocks_Pro_S100",
"name": "0.30mm Optimal 0.8 nozzle @Blocks",
"inherits": "fdm_process_common 0.8 nozzle",
"from": "system",
"setting_id": "OUfZvizM5MGnvHfp",
"setting_id": "YqkYzp5zdH4R5upm",
"instantiation": "true",
"bottom_shell_layers": "3",
"top_shell_layers": "3",
"layer_height": "0.3",
"compatible_printers": [
"BLOCKS Pro S100 0.8 nozzle"
],
"renamed_from": "0.30mm Optimal 0.8 nozzle @Blocks"
]
}
@@ -21,7 +21,7 @@
"top_solid_infill_flow_ratio": "0.97",
"bottom_solid_infill_flow_ratio": "1.08",
"seam_position": "aligned",
"sparse_infill_pattern": "grid",
"sparse_infill_patter": "grid",
"initial_layer_speed": "60",
"initial_layer_infill_speed": "80",
"initial_travel_speed": "100%",
@@ -57,7 +57,5 @@
"accel_to_decel_enable": "1",
"accel_to_decel_factor": "50%",
"elefant_foot_compensation": "0.25",
"elefant_foot_compensation_layers": "1",
"skirt_loops": "2",
"skirt_type": "perobject"
"elefant_foot_compensation_layers": "1"
}
@@ -1,15 +1,14 @@
{
"type": "process",
"name": "0.30mm Optimal 1.0 nozzle @Blocks_Pro_S100",
"name": "0.30mm Optimal 1.0 nozzle @Blocks",
"inherits": "fdm_process_common 1.0 nozzle",
"from": "system",
"setting_id": "HGG9WxKVr89qNFDx",
"setting_id": "8pBawPScHkyQu0SW",
"instantiation": "true",
"bottom_shell_layers": "4",
"top_shell_layers": "4",
"layer_height": "0.30",
"compatible_printers": [
"BLOCKS Pro S100 1.0 nozzle"
],
"renamed_from": "0.30mm Optimal 1.0 nozzle @Blocks"
]
}
@@ -1,15 +1,14 @@
{
"type": "process",
"name": "0.30mm Standard 0.6 nozzle @Blocks_Pro_S100",
"name": "0.30mm Standard 0.6 nozzle @Blocks",
"inherits": "fdm_process_common 0.6 nozzle",
"from": "system",
"setting_id": "gO2I1YjBl4nf8yzr",
"setting_id": "EPI3PAVK9LpJOZWO",
"instantiation": "true",
"bottom_shell_layers": "3",
"top_shell_layers": "3",
"layer_height": "0.30",
"compatible_printers": [
"BLOCKS Pro S100 0.6 nozzle"
],
"renamed_from": "0.30mm Standard 0.6 nozzle @Blocks"
]
}
@@ -22,7 +22,7 @@
"top_solid_infill_flow_ratio": "0.97",
"bottom_solid_infill_flow_ratio": "1.08",
"seam_position": "aligned",
"sparse_infill_pattern": "grid",
"sparse_infill_patter": "grid",
"initial_layer_speed": "60",
"initial_layer_infill_speed": "80",
"initial_travel_speed": "100%",
@@ -57,7 +57,5 @@
"accel_to_decel_enable": "1",
"accel_to_decel_factor": "50%",
"elefant_foot_compensation": "0.25",
"elefant_foot_compensation_layers": "1",
"skirt_loops": "2",
"skirt_type": "perobject"
"elefant_foot_compensation_layers": "1"
}
@@ -21,7 +21,7 @@
"top_solid_infill_flow_ratio": "0.97",
"bottom_solid_infill_flow_ratio": "1.08",
"seam_position": "aligned",
"sparse_infill_pattern": "grid",
"sparse_infill_patter": "grid",
"initial_layer_speed": "60",
"initial_layer_infill_speed": "80",
"initial_travel_speed": "100%",
@@ -57,7 +57,5 @@
"accel_to_decel_enable": "1",
"accel_to_decel_factor": "50%",
"elefant_foot_compensation": "0.25",
"elefant_foot_compensation_layers": "1",
"skirt_loops": "2",
"skirt_type": "perobject"
"elefant_foot_compensation_layers": "1"
}
@@ -22,7 +22,7 @@
"top_solid_infill_flow_ratio": "0.97",
"bottom_solid_infill_flow_ratio": "1.08",
"seam_position": "aligned",
"sparse_infill_pattern": "grid",
"sparse_infill_patter": "grid",
"initial_layer_speed": "60",
"initial_layer_infill_speed": "80",
"initial_travel_speed": "100%",
@@ -57,7 +57,5 @@
"accel_to_decel_enable": "1",
"accel_to_decel_factor": "50%",
"elefant_foot_compensation": "0.25",
"elefant_foot_compensation_layers": "1",
"skirt_loops": "2",
"skirt_type": "perobject"
"elefant_foot_compensation_layers": "1"
}
@@ -1,15 +1,14 @@
{
"type": "process",
"name": "0.40mm Draft 0.6 nozzle @Blocks_Pro_S100",
"name": "0.40mm Draft 0.6 nozzle @Blocks",
"inherits": "fdm_process_common 0.6 nozzle",
"from": "system",
"setting_id": "OjsLUl1heqv1cevs",
"setting_id": "CShVKoGspbMJNPw8",
"instantiation": "true",
"bottom_shell_layers": "2",
"top_shell_layers": "2",
"layer_height": "0.40",
"compatible_printers": [
"BLOCKS Pro S100 0.6 nozzle"
],
"renamed_from": "0.40mm Draft 0.6 nozzle @Blocks"
]
}
@@ -1,15 +1,14 @@
{
"type": "process",
"name": "0.40mm Standard 0.8 nozzle @Blocks_Pro_S100",
"name": "0.40mm Standard 0.8 nozzle @Blocks",
"inherits": "fdm_process_common 0.8 nozzle",
"from": "system",
"setting_id": "laOTioBGySeudJpl",
"setting_id": "TSRjmfWaatY7oLJB",
"instantiation": "true",
"bottom_shell_layers": "3",
"top_shell_layers": "4",
"layer_height": "0.40",
"compatible_printers": [
"BLOCKS Pro S100 0.8 nozzle"
],
"renamed_from": "0.40mm Standard 0.8 nozzle @Blocks"
]
}
@@ -22,7 +22,7 @@
"top_solid_infill_flow_ratio": "0.97",
"bottom_solid_infill_flow_ratio": "1.08",
"seam_position": "aligned",
"sparse_infill_pattern": "grid",
"sparse_infill_patter": "grid",
"initial_layer_speed": "60",
"initial_layer_infill_speed": "80",
"initial_travel_speed": "100%",
@@ -57,7 +57,5 @@
"accel_to_decel_enable": "1",
"accel_to_decel_factor": "50%",
"elefant_foot_compensation": "0.25",
"elefant_foot_compensation_layers": "1",
"skirt_loops": "2",
"skirt_type": "perobject"
"elefant_foot_compensation_layers": "1"
}
@@ -1,15 +1,14 @@
{
"type": "process",
"name": "0.50mm Draft 0.8 nozzle @Blocks_Pro_S100",
"name": "0.50mm Draft 0.8 nozzle @Blocks",
"inherits": "fdm_process_common 0.8 nozzle",
"from": "system",
"setting_id": "oAhgUZdADR7kP87e",
"setting_id": "vOtZHrDS88Shmf2m",
"instantiation": "true",
"bottom_shell_layers": "3",
"top_shell_layers": "4",
"layer_height": "0.50",
"compatible_printers": [
"BLOCKS Pro S100 0.8 nozzle"
],
"renamed_from": "0.50mm Draft 0.8 nozzle @Blocks"
]
}
@@ -1,15 +1,14 @@
{
"type": "process",
"name": "0.50mm Optimal 1.2 nozzle @Blocks_Pro_S100",
"name": "0.50mm Optimal 1.2 nozzle @Blocks",
"inherits": "fdm_process_common 1.2 nozzle",
"from": "system",
"setting_id": "0eqNgX26jemsBfV5",
"setting_id": "BKrEAKqDYzdH43wc",
"instantiation": "true",
"bottom_shell_layers": "2",
"top_shell_layers": "3",
"layer_height": "0.50",
"compatible_printers": [
"BLOCKS Pro S100 1.2 nozzle"
],
"renamed_from": "0.50mm Optimal 1.2 nozzle @Blocks"
]
}
@@ -1,15 +1,14 @@
{
"type": "process",
"name": "0.50mm Standard 1.0 nozzle @Blocks_Pro_S100",
"name": "0.50mm Standard 1.0 nozzle @Blocks",
"inherits": "fdm_process_common 1.0 nozzle",
"from": "system",
"setting_id": "z1qCW1cEMc4QvBbV",
"setting_id": "D40iksDm7mFjhSKn",
"instantiation": "true",
"bottom_shell_layers": "3",
"top_shell_layers": "3",
"layer_height": "0.50",
"compatible_printers": [
"BLOCKS Pro S100 1.0 nozzle"
],
"renamed_from": "0.50mm Standard 1.0 nozzle @Blocks"
]
}
@@ -21,7 +21,7 @@
"top_solid_infill_flow_ratio": "0.97",
"bottom_solid_infill_flow_ratio": "1.08",
"seam_position": "aligned",
"sparse_infill_pattern": "grid",
"sparse_infill_patter": "grid",
"initial_layer_speed": "60",
"initial_layer_infill_speed": "80",
"initial_travel_speed": "100%",
@@ -57,7 +57,5 @@
"accel_to_decel_enable": "1",
"accel_to_decel_factor": "50%",
"elefant_foot_compensation": "0.25",
"elefant_foot_compensation_layers": "1",
"skirt_loops": "2",
"skirt_type": "perobject"
"elefant_foot_compensation_layers": "1"
}
@@ -1,15 +1,14 @@
{
"type": "process",
"name": "0.60mm Draft 1.0 nozzle @Blocks_Pro_S100",
"name": "0.60mm Draft 1.0 nozzle @Blocks",
"inherits": "fdm_process_common 1.0 nozzle",
"from": "system",
"setting_id": "gTTgtfG8qb9My3hH",
"setting_id": "UJUe8XCBzZf8NyCL",
"instantiation": "true",
"bottom_shell_layers": "2",
"top_shell_layers": "3",
"layer_height": "0.60",
"compatible_printers": [
"BLOCKS Pro S100 1.0 nozzle"
],
"renamed_from": "0.60mm Draft 1.0 nozzle @Blocks"
]
}
@@ -1,15 +1,14 @@
{
"type": "process",
"name": "0.60mm Standard 1.2 nozzle @Blocks_Pro_S100",
"name": "0.60mm Standard 1.2 nozzle @Blocks",
"inherits": "fdm_process_common 1.2 nozzle",
"from": "system",
"setting_id": "ApcyToENCIANrI71",
"setting_id": "PSBFrTykpkytPI2Q",
"instantiation": "true",
"bottom_shell_layers": "2",
"top_shell_layers": "3",
"layer_height": "0.60",
"compatible_printers": [
"BLOCKS Pro S100 1.2 nozzle"
],
"renamed_from": "0.60mm Standard 1.2 nozzle @Blocks"
]
}
@@ -1,15 +1,14 @@
{
"type": "process",
"name": "0.70mm Draft 1.2 nozzle @Blocks_Pro_S100",
"name": "0.70mm Draft 1.2 nozzle @Blocks",
"inherits": "fdm_process_common 1.2 nozzle",
"from": "system",
"setting_id": "DEv7X7zaTfxRQmjo",
"setting_id": "0ZQ0USGX9SwAKr29",
"instantiation": "true",
"bottom_shell_layers": "2",
"top_shell_layers": "3",
"layer_height": "0.70",
"compatible_printers": [
"BLOCKS Pro S100 1.2 nozzle"
],
"renamed_from": "0.70mm Draft 1.2 nozzle @Blocks"
]
}
@@ -1,15 +1,14 @@
{
"type": "process",
"name": "0.70mm Extra Draft 1.0 nozzle @Blocks_Pro_S100",
"name": "0.70mm Extra Draft 1.0 nozzle @Blocks",
"inherits": "fdm_process_common 1.0 nozzle",
"from": "system",
"setting_id": "nUW7N9dJmTyQT4AG",
"setting_id": "69PFmjOVFBOIp3Qg",
"instantiation": "true",
"bottom_shell_layers": "2",
"top_shell_layers": "3",
"layer_height": "0.70",
"compatible_printers": [
"BLOCKS Pro S100 1.0 nozzle"
],
"renamed_from": "0.70mm Extra Draft 1.0 nozzle @Blocks"
]
}
@@ -1,15 +1,14 @@
{
"type": "process",
"name": "0.80mm Extra Draft 1.2 nozzle @Blocks_Pro_S100",
"name": "0.80mm Extra Draft 1.2 nozzle @Blocks",
"inherits": "fdm_process_common 1.2 nozzle",
"from": "system",
"setting_id": "JMy62SonRfK0cAdL",
"setting_id": "iBwRI5JJewW5HJSv",
"instantiation": "true",
"bottom_shell_layers": "2",
"top_shell_layers": "2",
"layer_height": "0.80",
"compatible_printers": [
"BLOCKS Pro S100 1.2 nozzle"
],
"renamed_from": "0.80mm Extra Draft 1.2 nozzle @Blocks"
]
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "OrcaFilamentLibrary",
"version": "02.04.00.13",
"version": "02.04.00.12",
"force_update": "0",
"description": "Orca Filament Library",
"filament_list": [
@@ -6,7 +6,7 @@
"filament_id": "OFvgE0Zh",
"instantiation": "false",
"fan_cooling_layer_time": [
"81"
"80"
],
"fan_min_speed": [
"50"
+46 -64
View File
@@ -5,6 +5,7 @@
//BBS
#include "Preset.hpp"
#include "Exception.hpp"
#include "InstanceLock.hpp"
#include "LocalesUtils.hpp"
#include "Thread.hpp"
#include "format.hpp"
@@ -739,10 +740,13 @@ static bool verify_config_file_checksum(boost::nowide::ifstream &ifs)
#ifdef USE_JSON_CONFIG
std::string AppConfig::load()
std::string AppConfig::load(bool read_only)
{
json j;
// Keep another instance from replacing or restoring the file mid-read.
InstanceLock instance_lock(read_only ? std::string() : lock_path());
// 1) Read the complete config file into a boost::property_tree.
namespace pt = boost::property_tree;
pt::ptree tree;
@@ -992,7 +996,6 @@ void AppConfig::save()
// The config is first written to a file with a PID suffix and then moved
// to avoid race conditions with multiple instances of Slic3r
const auto path = config_path();
std::string path_pid = (boost::format("%1%.%2%") % path % get_current_pid()).str();
json j;
@@ -1122,43 +1125,18 @@ void AppConfig::save()
j["local_machines"][local_machine.first] = m_json;
}
boost::nowide::ofstream c;
c.open(path_pid, std::ios::out | std::ios::trunc);
c << j.dump(1, '\t') << std::endl;
#ifdef WIN32
// WIN32 specific: The final "rename_file()" call is not safe in case of an application crash, there is no atomic "rename file" API
// provided by Windows (sic!). Therefore we save a MD5 checksum to be able to verify file corruption. In addition,
// we save the config file into a backup first before moving it to the final destination.
c << appconfig_md5_hash_line(j.dump(1, '\t'));
#endif
c.close();
if (c.fail()) {
BOOST_LOG_TRIVIAL(error) << "Failed to write new configuration to " << path_pid << "; aborting attempt to overwrite original configuration";
return;
}
#ifdef WIN32
// Make a backup of the configuration file before copying it to the final destination.
std::string error_message;
std::string backup_path = (boost::format("%1%.bak") % path).str();
// Copy configuration file with PID suffix into the configuration file with "bak" suffix.
if (copy_file(path_pid, backup_path, error_message, false) != SUCCESS)
BOOST_LOG_TRIVIAL(error) << "Copying from " << path_pid << " to " << backup_path << " failed. Failed to create a backup configuration.";
#endif
// Rename the config atomically.
// On Windows, the rename is likely NOT atomic, thus it may fail if PrusaSlicer crashes on another thread in the meanwhile.
// To cope with that, we already made a backup of the config on Windows.
rename_file(path_pid, path);
const std::string config_str = j.dump(1, '\t');
if (write_config_file(path, config_str + "\n", config_str))
m_dirty = false;
}
#else
std::string AppConfig::load()
std::string AppConfig::load(bool read_only)
{
// Keep another instance from replacing or restoring the file mid-read.
InstanceLock instance_lock(read_only ? std::string() : lock_path());
// 1) Read the complete config file into a boost::property_tree.
namespace pt = boost::property_tree;
pt::ptree tree;
@@ -1296,7 +1274,6 @@ void AppConfig::save()
// The config is first written to a file with a PID suffix and then moved
// to avoid race conditions with multiple instances of Slic3r
const auto path = config_path();
std::string path_pid = (boost::format("%1%.%2%") % path % get_current_pid()).str();
std::stringstream config_ss;
if (m_mode == EAppMode::Editor)
@@ -1332,39 +1309,39 @@ void AppConfig::save()
// One empty line before the MD5 sum.
config_ss << std::endl;
std::string config_str = config_ss.str();
boost::nowide::ofstream c;
c.open(path_pid, std::ios::out | std::ios::trunc);
c << config_str;
#ifdef WIN32
// WIN32 specific: The final "rename_file()" call is not safe in case of an application crash, there is no atomic "rename file" API
// provided by Windows (sic!). Therefore we save a MD5 checksum to be able to verify file corruption. In addition,
// we save the config file into a backup first before moving it to the final destination.
c << appconfig_md5_hash_line(config_str);
#endif
c.close();
if (c.fail()) {
BOOST_LOG_TRIVIAL(error) << "Failed to write new configuration to " << path_pid << "; aborting attempt to overwrite original configuration";
return;
}
#ifdef WIN32
// Make a backup of the configuration file before copying it to the final destination.
std::string error_message;
std::string backup_path = (boost::format("%1%.bak") % path).str();
// Copy configuration file with PID suffix into the configuration file with "bak" suffix.
if (copy_file(path_pid, backup_path, error_message, false) != SUCCESS)
BOOST_LOG_TRIVIAL(error) << "Copying from " << path_pid << " to " << backup_path << " failed. Failed to create a backup configuration.";
#endif
// Rename the config atomically.
// On Windows, the rename is likely NOT atomic, thus it may fail if PrusaSlicer crashes on another thread in the meanwhile.
// To cope with that, we already made a backup of the config on Windows.
rename_file(path_pid, path);
const std::string config_str = config_ss.str();
if (write_config_file(path, config_str, config_str))
m_dirty = false;
}
#endif
bool AppConfig::write_config_file(const std::string &path, std::string body, const std::string &checksum_source)
{
// Everything before this is assembly; only the writes need the other instances kept out.
InstanceLock instance_lock(lock_path());
#ifdef WIN32
// WIN32 specific: the final replace is not safe in case of an application crash, there is no atomic "rename file" API
// provided by Windows (sic!). Therefore we save a MD5 checksum to be able to verify file corruption. In addition,
// we save the config file into a backup first before moving it to the final destination.
body += appconfig_md5_hash_line(checksum_source);
#endif
// Not flushed to the device: the idle handler saves on the GUI thread after
// any change, and the rename already gives a complete old or new file.
if (const std::error_code ec = write_file_atomically(path, body)) {
BOOST_LOG_TRIVIAL(error) << "Failed to write the configuration " << path << ": " << ec.message() << "; trying again in 10 s";
m_retry_save_at = std::chrono::steady_clock::now() + std::chrono::seconds(10);
return false;
}
m_retry_save_at = {};
#ifdef WIN32
// Written after the config, so the backup never holds a state that was not confirmed written.
const std::string backup_path = (boost::format("%1%.bak") % path).str();
if (const std::error_code ec = write_file_atomically(backup_path, body))
BOOST_LOG_TRIVIAL(error) << "Failed to write the backup configuration " << backup_path << ": " << ec.message();
#endif
return true;
}
bool AppConfig::get_variant(const std::string &vendor, const std::string &model, const std::string &variant) const
{
const auto it_v = m_vendors.find(vendor);
@@ -1853,6 +1830,11 @@ void AppConfig::reset_selections()
}
}
std::string AppConfig::lock_path()
{
return Slic3r::data_dir().empty() ? std::string() : config_path() + ".lock";
}
std::string AppConfig::config_path()
{
#ifdef USE_JSON_CONFIG
@@ -1889,7 +1871,7 @@ bool AppConfig::exists()
std::string AppConfig::load_if_exists()
{
return boost::filesystem::exists(loading_path()) ? load() : std::string();
return boost::filesystem::exists(loading_path()) ? load(/*read_only=*/true) : std::string();
}
}; // namespace Slic3r
+16 -1
View File
@@ -2,6 +2,7 @@
#define slic3r_AppConfig_hpp_
#include <set>
#include <chrono>
#include <map>
#include <string>
#include "nlohmann/json.hpp"
@@ -122,14 +123,18 @@ public:
// Load the slic3r.ini from a user profile directory (or a datadir, if configured).
// Return an error string, or an empty string on success.
std::string load();
std::string load(bool read_only = false);
// Treat a missing config as default state; otherwise load it normally.
// The CLI's load: it never saves, so it takes no lock and creates no lock file.
std::string load_if_exists();
// Store the slic3r.ini into a user profile directory (or a datadir, if configured).
void save();
// Does this config need to be saved?
bool dirty() const { return m_dirty; }
// False for ten seconds after a failed write, so the idle handler does not
// repeat a hopeless attempt on every event; an explicit save() always tries.
bool save_due() const { return std::chrono::steady_clock::now() >= m_retry_save_at; }
void set_dirty() { m_dirty = true; }
@@ -339,6 +344,8 @@ public:
// Get the default config path from Slic3r::data_dir().
std::string config_path();
// Lock file guarding config_path() against other running instances; empty without a data dir.
std::string lock_path();
// Returns true if the user's data directory comes from before Slic3r 1.40.0 (no updating)
bool legacy_datadir() const { return m_legacy_datadir; }
@@ -449,8 +456,16 @@ private:
// Preset for each machine
MachineSettingMap m_printer_settings;
// Writes the assembled config text, and on Windows its checksum and a backup copy; false when the
// config itself could not be written, in which case the caller stays dirty and retries. `checksum_source`
// is the text load() will verify, which for the JSON config ends before the trailing newline.
bool write_config_file(const std::string &path, std::string body, const std::string &checksum_source);
// Has any value been modified since the config.ini has been last saved or loaded?
bool m_dirty;
// After a failed write, save_due() is false for the next ten seconds, so the
// idle handler does not repeat a hopeless write on every event.
std::chrono::steady_clock::time_point m_retry_save_at{};
// Original version found in the ini file before it was overwritten
Semver m_orig_version;
// Whether the existing version is before system profiles & configuration updating
+2 -2
View File
@@ -2673,10 +2673,10 @@ void CadDocument::apply_feature(TopoDS_Shape& result, bool& have_body,
ridge = pipe.Shape();
have_ridge = !ridge.IsNull();
}
} catch (const Standard_Failure&) {
have_ridge = false; // OCCT failure — on OCCT >= 8 Standard_Failure derives from std::exception, so this handler must come first
} catch (const std::exception&) {
have_ridge = false; // fall back to the bare cylinder/bore below
} catch (const Standard_Failure&) {
have_ridge = false; // OCCT failure (not a std::exception) — must be caught here too
}
if (f.thread_internal) {
-2
View File
@@ -15,8 +15,6 @@
#include <TopExp.hxx>
#include <TopTools.hxx>
#include <TopTools_IndexedMapOfShape.hxx>
#include <TopTools_ListOfShape.hxx>
#include <TopTools_IndexedDataMapOfShapeListOfShape.hxx>
#include <Poly_Triangulation.hxx>
#include <gp_Ax2.hxx>
#include <gp_Dir.hxx>
+3
View File
@@ -304,6 +304,8 @@ set(lisbslic3r_sources
Geometry/VoronoiUtils.cpp
Geometry/VoronoiUtils.hpp
Geometry/VoronoiVisualUtils.hpp
InstanceLock.cpp
InstanceLock.hpp
Int128.hpp
KDTreeIndirect.hpp
Layer.cpp
@@ -353,6 +355,7 @@ set(lisbslic3r_sources
Optimize/Optimizer.hpp
Orient.cpp
Orient.hpp
ParallelResolve.hpp
ParameterUtils.cpp
ParameterUtils.hpp
pchheader.cpp
+29 -18
View File
@@ -849,6 +849,19 @@ ConfigSubstitutions ConfigBase::load_from_json(const std::string &file, ForwardC
return std::move(substitutions_ctxt.substitutions);
}
// Case-insensitive compare of a JSON key against a fixed ASCII one, without
// boost::iequals, whose std::locale() takes a lock the whole process shares in the
// MSVC runtime.
static bool ascii_iequals(const std::string &key, const char *literal)
{
auto lower = [](char c) { return (c >= 'A' && c <= 'Z') ? char(c - 'A' + 'a') : c; };
size_t i = 0;
for (; i < key.size() && literal[i] != '\0'; ++ i)
if (lower(key[i]) != lower(literal[i]))
return false;
return i == key.size() && literal[i] == '\0';
}
int ConfigBase::load_from_json(const std::string &file, ConfigSubstitutionContext& substitution_context, bool load_inherits_to_config, std::map<std::string, std::string>& key_values, std::string& reason)
{
json j;
@@ -916,44 +929,44 @@ int ConfigBase::load_from_json(const std::string &file, ConfigSubstitutionContex
}
//parse the json elements
for (auto it = j.begin(); it != j.end(); it++) {
if (boost::iequals(it.key(),BBL_JSON_KEY_VERSION)) {
if (ascii_iequals(it.key(), BBL_JSON_KEY_VERSION)) {
key_values.emplace(BBL_JSON_KEY_VERSION, it.value());
}
else if (boost::iequals(it.key(), BBL_JSON_KEY_IS_CUSTOM)) {
else if (ascii_iequals(it.key(), BBL_JSON_KEY_IS_CUSTOM)) {
//skip it
}
else if (boost::iequals(it.key(), BBL_JSON_KEY_NAME)) {
else if (ascii_iequals(it.key(), BBL_JSON_KEY_NAME)) {
key_values.emplace(BBL_JSON_KEY_NAME, it.value());
if (it.value() == "project_settings")
is_project_settings = true;
}
else if (boost::iequals(it.key(), BBL_JSON_KEY_URL)) {
else if (ascii_iequals(it.key(), BBL_JSON_KEY_URL)) {
key_values.emplace(BBL_JSON_KEY_URL, it.value());
}
else if (boost::iequals(it.key(), BBL_JSON_KEY_TYPE)) {
else if (ascii_iequals(it.key(), BBL_JSON_KEY_TYPE)) {
key_values.emplace(BBL_JSON_KEY_TYPE, it.value());
}
else if (boost::iequals(it.key(), BBL_JSON_KEY_SETTING_ID)) {
else if (ascii_iequals(it.key(), BBL_JSON_KEY_SETTING_ID)) {
key_values.emplace(BBL_JSON_KEY_SETTING_ID, it.value());
}
else if (boost::iequals(it.key(), BBL_JSON_KEY_FILAMENT_ID)) {
else if (ascii_iequals(it.key(), BBL_JSON_KEY_FILAMENT_ID)) {
key_values.emplace(BBL_JSON_KEY_FILAMENT_ID, it.value());
}
else if (boost::iequals(it.key(), BBL_JSON_KEY_FROM)) {
else if (ascii_iequals(it.key(), BBL_JSON_KEY_FROM)) {
key_values.emplace(BBL_JSON_KEY_FROM, it.value());
}
else if (boost::iequals(it.key(), BBL_JSON_KEY_DESCRIPTION)) {
else if (ascii_iequals(it.key(), BBL_JSON_KEY_DESCRIPTION)) {
key_values.emplace(BBL_JSON_KEY_DESCRIPTION, it.value());
}
else if (boost::iequals(it.key(), BBL_JSON_KEY_INSTANTIATION)) {
else if (ascii_iequals(it.key(), BBL_JSON_KEY_INSTANTIATION)) {
key_values.emplace(BBL_JSON_KEY_INSTANTIATION, it.value());
}
else if (!load_inherits_to_config && boost::iequals(it.key(), BBL_JSON_KEY_INHERITS)) {
else if (!load_inherits_to_config && ascii_iequals(it.key(), BBL_JSON_KEY_INHERITS)) {
key_values.emplace(BBL_JSON_KEY_INHERITS, it.value());
}
else if (!load_inherits_to_config && boost::iequals(it.key(), BBL_JSON_KEY_INCLUDES)) {
else if (!load_inherits_to_config && ascii_iequals(it.key(), BBL_JSON_KEY_INCLUDES)) {
key_values.emplace(BBL_JSON_KEY_INCLUDES, it.value().dump());
} else if (boost::iequals(it.key(), ORCA_JSON_KEY_RENAMED_FROM)) {
} else if (ascii_iequals(it.key(), ORCA_JSON_KEY_RENAMED_FROM)) {
key_values.emplace(ORCA_JSON_KEY_RENAMED_FROM, it.value());
} else {
t_config_option_key opt_key = it.key();
@@ -1525,11 +1538,9 @@ void ConfigBase::save_to_json(const std::string &file, const std::string &name,
// Serialize first: if that throws (invalid UTF-8), the existing file stays untouched.
std::ostringstream ss;
this->save_to_json(ss, name, from, version);
boost::nowide::ofstream c;
c.open(file, std::ios::out | std::ios::trunc);
c << ss.str();
c.close();
if (const std::error_code ec = write_file_atomically(file, ss.str()))
BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << boost::format(": failed to save config to %1%: %2%") % file % ec.message();
else
BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << ":" <<__LINE__ << boost::format(", saved config to %1%\n")%file;
}
-1
View File
@@ -25,7 +25,6 @@
#include "XCAFDoc_DocumentTool.hxx"
#include "XCAFDoc_ShapeTool.hxx"
#include "XCAFApp_Application.hxx"
#include "TDF_LabelSequence.hxx"
#include "TopoDS_Solid.hxx"
#include "TopoDS_Compound.hxx"
#include "TopoDS_Builder.hxx"
+28 -38
View File
@@ -2504,8 +2504,7 @@ void GCode::do_export(Print* print, const char* path, GCodeProcessorResult* resu
{
LifecycleEventContext ctx;
ctx.id = std::to_string(print->model().id().id);
ctx.name = print->get_model_name();
ctx.name = std::to_string(print->model().id().id);
ctx.code = LifecycleEvtCode::Ok;
ctx.msg = path;
ctx.cancellation_check = [print]() { return print->canceled(); };
@@ -2557,8 +2556,7 @@ void GCode::do_export(Print* print, const char* path, GCodeProcessorResult* resu
}
{
LifecycleEventContext ctx;
ctx.id = std::to_string(print->model().id().id);
ctx.name = print->get_model_name();
ctx.name = std::to_string(print->model().id().id);
ctx.code = LifecycleEvtCode::Error;
ctx.msg = std::string(path) + "\n" + err_msg;
ctx.cancellation_check = [print]() { return print->canceled(); };
@@ -2582,8 +2580,7 @@ void GCode::do_export(Print* print, const char* path, GCodeProcessorResult* resu
boost::nowide::remove(path_tmp.c_str());
{
LifecycleEventContext ctx;
ctx.id = std::to_string(print->model().id().id);
ctx.name = print->get_model_name();
ctx.name = std::to_string(print->model().id().id);
ctx.code = LifecycleEvtCode::Error;
ctx.msg = std::string(path) + "\n" + ex.what();
ctx.cancellation_check = [print]() { return print->canceled(); };
@@ -2696,8 +2693,7 @@ void GCode::do_export(Print* print, const char* path, GCodeProcessorResult* resu
if (ret) {
{
LifecycleEventContext ctx;
ctx.id = std::to_string(print->model().id().id);
ctx.name = print->get_model_name();
ctx.name = std::to_string(print->model().id().id);
ctx.code = LifecycleEvtCode::Error;
ctx.msg = std::string(path) + "\nFailed to rename the output G-code file: " + ret.message();
ctx.cancellation_check = [print]() { return print->canceled(); };
@@ -2716,8 +2712,7 @@ void GCode::do_export(Print* print, const char* path, GCodeProcessorResult* resu
{
LifecycleEventContext ctx;
ctx.id = std::to_string(print->model().id().id);
ctx.name = print->get_model_name();
ctx.name = std::to_string(print->model().id().id);
ctx.code = LifecycleEvtCode::Ok;
ctx.msg = path;
ctx.cancellation_check = [print]() { return print->canceled(); };
@@ -7969,20 +7964,6 @@ double GCode::calc_max_volumetric_speed(const double layer_height, const double
return res;
}
// ORCA: Overlap at or below which the overhang fan switches on; negative when it does not depend on overlap
// (Overhang_threshold_none cools every external perimeter).
static float overhang_fan_overlap_threshold(int overhang_fan_threshold)
{
switch (overhang_fan_threshold) {
case (int) Overhang_threshold_1_4: return 0.9f;
case (int) Overhang_threshold_2_4: return 0.75f;
case (int) Overhang_threshold_3_4: return 0.5f;
case (int) Overhang_threshold_4_4: return 0.25f;
case (int) Overhang_threshold_bridge: return 0.05f;
default: return -1.f;
}
}
std::string GCode::_extrude(const ExtrusionPath &path, std::string description, double speed)
{
std::string gcode;
@@ -8325,13 +8306,6 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description,
ConfigOptionPercents overhang_overlap_levels({90, 75, 50, 25, 13, 0});
// ORCA: Lets the path be split where the overhang fan switches, not only where the speed changes.
// Bridges and overhang perimeters are cooled regardless of overlap.
float fan_overlap_threshold = -1.f;
if (FILAMENT_CONFIG(enable_overhang_bridge_fan) && m_enable_cooling_markers && path.role() != erBridgeInfill &&
path.role() != erOverhangPerimeter)
fan_overlap_threshold = overhang_fan_overlap_threshold(FILAMENT_CONFIG(overhang_fan_threshold));
if (NOZZLE_CONFIG(slowdown_for_curled_perimeters)){
ConfigOptionFloatsOrPercents dynamic_overhang_speeds(
{FloatOrPercent{100, true},
@@ -8352,8 +8326,7 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description,
FloatOrPercent{NOZZLE_CONFIG(overhang_4_4_speed).get_abs_value(ref_speed) * 100 / ref_speed, true}});
new_points = m_extrusion_quality_estimator.estimate_extrusion_quality(path, overhang_overlap_levels, dynamic_overhang_speeds,
ref_speed, speed, NOZZLE_CONFIG(slowdown_for_curled_perimeters),
fan_overlap_threshold);
ref_speed, speed, NOZZLE_CONFIG(slowdown_for_curled_perimeters));
}else{
ConfigOptionFloatsOrPercents dynamic_overhang_speeds(
{FloatOrPercent{100, true},
@@ -8372,8 +8345,7 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description,
FloatOrPercent{NOZZLE_CONFIG(bridge_speed) * 100 / ref_speed, true}});
new_points = m_extrusion_quality_estimator.estimate_extrusion_quality(path, overhang_overlap_levels, dynamic_overhang_speeds,
ref_speed, speed, NOZZLE_CONFIG(slowdown_for_curled_perimeters),
fan_overlap_threshold);
ref_speed, speed, NOZZLE_CONFIG(slowdown_for_curled_perimeters));
}
variable_speed = std::any_of(new_points.begin(), new_points.end(),
[speed](const ProcessedPoint &p) { return fabs(double(p.speed) - speed) > 1; }); // Ignore small speed variations (under 1mm/sec)
@@ -8525,10 +8497,28 @@ std::string GCode::_extrude(const ExtrusionPath &path, std::string description,
if (role == erBridgeInfill || role == erOverhangPerimeter) { // ORCA: Split out bridge infill to internal and external to apply separate fan settings
return true;
}
if (overhang_fan_threshold == Overhang_threshold_none)
switch (overhang_fan_threshold) {
case (int)Overhang_threshold_1_4:
return overlap <= 0.9f;
break;
case (int)Overhang_threshold_2_4:
return overlap <= 0.75f;
break;
case (int)Overhang_threshold_3_4:
return overlap <= 0.5f;
break;
case (int)Overhang_threshold_4_4:
return overlap <= 0.25f;
break;
case (int)Overhang_threshold_bridge:
return overlap <= 0.05f;
break;
case (int)Overhang_threshold_none:
return is_external_perimeter(role);
const float overlap_threshold = overhang_fan_overlap_threshold(overhang_fan_threshold);
return overlap_threshold >= 0.f && overlap <= overlap_threshold;
break;
default:
return false;
}
};
std::string comment;
+73 -109
View File
@@ -41,12 +41,10 @@ std::vector<ExtendedPoint<L::Dim>> estimate_points_properties(const POINTS&
float flow_width,
float max_line_length = -1.0f,
float min_distance = -1.0f,
// Speed an overhang distance prints at. Without it, interior sampling
// is skipped and every line over 4mm is split.
const std::function<float(float)>& distance_to_speed = {},
// Overlap (1 - distance / flow_width) at or below which the overhang
// fan switches on; negative when the fan does not depend on overlap.
float fan_overlap_threshold = -1.0f)
// Maps an overhang distance onto the speed it will be printed at. Interior sampling
// needs it to tell which of the points it could add would change the G-code, and is
// skipped without it.
const std::function<float(float)>& distance_to_speed = {})
{
bool looped = input_points.front() == input_points.back();
std::function<size_t(size_t,size_t)> get_prev_index = [](size_t idx, size_t count) {
@@ -127,43 +125,29 @@ std::vector<ExtendedPoint<L::Dim>> estimate_points_properties(const POINTS&
points.push_back(next_point);
}
// ORCA: How an overhang distance prints, which is what the passes below compare. A segment is printed at the lower
// of the speeds at its two ends, and with the overhang fan on if the overlap at either end turns it on. A point
// added to a path can therefore only change the G-code where it prints at a different speed or fan state from the
// points either side of it, and the passes below add points there and nowhere else.
const float width_inv = 1.f / flow_width;
// Whether an overhang distance turns the overhang fan on. The overlap test check_overhang_fan applies in GCode.cpp.
auto fan_on = [fan_overlap_threshold, width_inv](float distance) {
return fan_overlap_threshold >= 0.f && 1.f - distance * width_inv <= fan_overlap_threshold;
};
// Whether two overhang distances are interchangeable ie have the same speed (beyond a 1mm/sec threshold that gcode.cpp filters out on)
// and the same fan state.
auto same_speed_and_fan = [&distance_to_speed, &fan_on](float a, float b) {
return std::abs(distance_to_speed(a) - distance_to_speed(b)) <= 1.f && fan_on(a) == fan_on(b);
};
// Whether the first overhang distance prints slower than the second, beyond the 1mm/sec gcode.cpp tolerance, or turns the overhang
// fan on where the second does not. Against a supported point (overhang distance 0) it tells whether an end is
// affected by the overhang.
auto slower_or_cooled = [&distance_to_speed, &fan_on](float a, float b) {
return distance_to_speed(a) < distance_to_speed(b) - 1.f || (fan_on(a) && !fan_on(b));
};
// ORCA: Interior sampling
// The passes below infer the support under a span from its endpoints alone, so a part that is supported
// differently from both ends is invisible to them. The outer perimeter of an overhang whose ends are supported by
// reads as supported along its whole length. Probe the interior, keep the samples the endpoint interpolation fails to predict,
// and bisect either side of each one, so a span that is only partly unsupported gets points where its support actually changes
// instead of one reading being spread across all of it.
// Skipped where there is nothing to find: min_distance <= 0 when no overhang can slow this path down, and
// fan_overlap_threshold < 0 when no overhang switches the fan on. It also needs distance_to_speed to tell which of
// the points it could add would change the G-code.
if (PREV_LAYER_BOUNDARY_OFFSET && ADD_INTERSECTIONS && distance_to_speed && (min_distance > 0 || fan_overlap_threshold >= 0.f)) {
// The passes below infer the support under a span from its endpoints alone, so an interior that is supported
// differently from both ends is invisible to them: the outer perimeter of an overhang whose ends are caged by
// full height walls reads as supported along its whole length. Probe the interior, keep the samples the
// endpoint interpolation fails to predict, and bisect either side of each one, so a span that is only partly
// unsupported gets points where its support actually changes instead of one reading spread across all of it.
if (PREV_LAYER_BOUNDARY_OFFSET && ADD_INTERSECTIONS && min_distance > 0 && distance_to_speed) {
// Probe at least this densely before treating matching samples as evidence that a span is uniform. The
// segmentation pass below only splits lines of 2mm or more, and every pass here drops points closer
// together than min_spacing, so finer discovery would not produce a more precise transition.
// together than min_spacing, so finer discovery would not produce a more precise speed transition.
const double max_probe_spacing = std::max(2., 4. * min_spacing);
// A backstop for that length test, which on a non-finite length would never be met.
constexpr int max_bisection_depth = 10;
// Whether two readings are interchangeable. A segment is printed at the lower of the speeds its ends
// read, so a sample that agrees on speed with what is already known cannot change the G-code, whatever
// its distance says. The distances themselves are far too coarse a stand-in for this: the speed sections
// interpolate, so readings a small fraction of min_distance apart can still be tens of mm/s apart.
// The tolerance matches the one GCode.cpp applies when it decides a path has a variable speed at all.
auto same_speed = [&distance_to_speed](float a, float b) {
return std::abs(distance_to_speed(a) - distance_to_speed(b)) <= 1.f;
};
// Whether the first reading is printed slower than the second, once they are known to differ.
auto prints_slower = [&distance_to_speed](float a, float b) { return distance_to_speed(a) < distance_to_speed(b); };
// Part of a segment still to bisect: its positions along the segment and bisections left.
struct Subspan { double t0, t1; int depth; };
@@ -201,8 +185,8 @@ std::vector<ExtendedPoint<L::Dim>> estimate_points_properties(const POINTS&
if (!interior.empty()) {
std::sort(interior.begin(), interior.end(),
[](const std::pair<double, float>& l, const std::pair<double, float>& r) { return l.first < r.first; });
// Coarse probing keeps every sample it took until this pass can see which ones bracket a speed or
// fan transition. Matching samples cannot be discarded during discovery: one may be the last
// Coarse probing keeps every sample it took until this pass can see which ones bracket a speed
// transition. Matching samples cannot be discarded during discovery: one may be the last
// supported point before a narrow unsupported pocket found by a later probe.
size_t kept = 0;
for (size_t i = 0; i < interior.size(); ++i) {
@@ -211,15 +195,15 @@ std::vector<ExtendedPoint<L::Dim>> estimate_points_properties(const POINTS&
const bool at_end = i + 1 == interior.size(); // And nothing follows the last sample but the segment's end
const float before = at_start ? curr.distance : interior[kept - 1].second;
const float after = at_end ? next.distance : interior[i + 1].second;
// A sample is worth a point in the path only where it prints differently, in speed or fan state,
// from the points either side of it. Differing from one of the segment's own ends is not enough on
// its own where the sample is not the slower or cooled of the two: the segmentation pass below
// already confines the slowdown and cooling at an end, at a distance taken from how far out that
// end is rather than from wherever bisection happened to stop, and a point here would leave the
// span beside the end too short for that pass to run at all. Support an end cannot account for,
// where the interior is the slower or cooled of the two, is exactly what this pass is here to find.
const bool worth_before = !same_speed_and_fan(sample, before) && (!at_start || slower_or_cooled(sample, before));
const bool worth_after = !same_speed_and_fan(sample, after) && (!at_end || slower_or_cooled(sample, after));
// A sample is worth a point in the path only where it prints at a different speed from the
// readings either side of it. Differing from one of the segment's own ends is not enough on
// its own where the sample is the faster of the two: the segmentation pass below already
// ends the slowdown an end reads, at a distance taken from how far out that end is rather
// than from wherever bisection happened to stop, and a point here would leave the span
// beside the end too short for that pass to run at all. Support an end cannot account for,
// where the interior is the slower reading, is exactly what this pass is here to find.
const bool worth_before = !same_speed(sample, before) && (!at_start || prints_slower(sample, before));
const bool worth_after = !same_speed(sample, after) && (!at_end || prints_slower(sample, after));
if (worth_before || worth_after)
interior[kept++] = interior[i];
}
@@ -255,59 +239,51 @@ std::vector<ExtendedPoint<L::Dim>> estimate_points_properties(const POINTS&
(next.distance > -boundary_offset && next.distance < boundary_offset + 2.0f)) {
double line_len = (next.position - curr.position).norm();
// ORCA: A line prints as slow as its slower end and is cooled if either end is, so an overhang at one
// end would otherwise slow down or cool the whole line. Split the line so that only the part beside
// that end prints that way, if the line is reasonably long (2mm or more) and at least one end prints
// slower or cooled compared with a supported point (overhang distance 0). Deciding on how the end
// prints, rather than on its overhang distance against min_distance, also catches an end whose overhang
// distance is exactly where the slowdown begins, such as an outline crossing at half a line width.
// Without distance_to_speed, split every line over 4mm.
const bool split_line = distance_to_speed ?
line_len >= 2.f && (slower_or_cooled(curr.distance, 0.f) || slower_or_cooled(next.distance, 0.f)) :
line_len > 4.0f;
if (split_line) {
// Each end's piece is that end's overhang distance plus 1.5 line widths (3 * boundary_offset) long:
// a0 ends the piece beside curr, a1 starts the piece beside next.
// ORCA: Segment path to smaller lines by adding additional points only if the path has an overhang that
// will trigger a slowdown and the path is also reasonably large, i.e. 2mm in length or more
// If there is no overhang in the start/end point, dont segment it.
// Ignore this check if the control of segmentation for overhangs is disabled (min_distance=-1)
if ((min_distance > 0 && ((std::abs(curr.distance) > min_distance) || (std::abs(next.distance) > min_distance)) && line_len >= 2.f) ||
(min_distance <= 0 && line_len > 4.0f)) {
double a0 = std::clamp((curr.distance + 3 * boundary_offset) / line_len, 0.0, 1.0);
double a1 = std::clamp(1.0f - (next.distance + 3 * boundary_offset) / line_len, 0.0, 1.0);
double t0 = std::min(a0, a1);
double t1 = std::max(a0, a1);
// Up to two cut points, in order along the line. Each takes its own overhang distance, so every
// piece prints by the overhang distances at its own two ends. t0 >= 1 or t1 <= 0 falls on the
// line's own end, so there is no cut. A cut closer than min_spacing to either end of the line is
// not meaningful and is filtered out (#6714).
ExtendedPoint<L::Dim> cut[2]{};
bool keep[2] = {false, false};
for (int k = 0; k < 2; ++k) {
const double t = k == 0 ? t0 : t1;
if (k == 0 ? t >= 1.0 : t <= 0.0)
continue;
const Vec p = curr.position + t * (next.position - curr.position);
auto [p_dist, p_near_l, p_x] = unscaled_prev_layer.template distance_from_lines_extra<SIGNED_DISTANCE>(
p.template cast<AABBScalar>());
cut[k].position = p;
cut[k].distance = float(p_dist + boundary_offset);
keep[k] = (p - curr.position).norm() > min_spacing && (next.position - p).norm() > min_spacing;
if (t0 < 1.0) {
Vec p0 = curr.position + t0 * (next.position - curr.position);
auto [p0_dist, p0_near_l, p0_x] = unscaled_prev_layer.template distance_from_lines_extra<SIGNED_DISTANCE>(
p0.template cast<AABBScalar>());
ExtendedPoint<L::Dim> new_p{};
new_p.position = p0;
new_p.distance = float(p0_dist + boundary_offset);
// ORCA: only create a new point in the path if the new point overhang distance will be used to generate a speed change
// or if this option is disabled (min_distance<=0)
if( (std::abs(p0_dist) > min_distance) || (min_distance<=0)){
// ORCA: also filter out points that are introduced to the start of the path when their distance from the start point is
// not meaningful
if ((p0 - curr.position).norm() > min_spacing && (next.position - p0).norm() > min_spacing) {
new_points.push_back(new_p);
}
}
}
if (t1 > 0.0) {
Vec p1 = curr.position + t1 * (next.position - curr.position);
auto [p1_dist, p1_near_l, p1_x] = unscaled_prev_layer.template distance_from_lines_extra<SIGNED_DISTANCE>(
p1.template cast<AABBScalar>());
ExtendedPoint<L::Dim> new_p{};
new_p.position = p1;
new_p.distance = float(p1_dist + boundary_offset);
// ORCA: only create a new point in the path if the new point overhang distance will be used to generate a speed change
// or if this option is disabled (min_distance<=0)
if( (std::abs(p1_dist) > min_distance) || (min_distance<=0)){
// ORCA: filter out points that are introduced to the end of the path when their distance from the end point is
// not meaningful
if ((p1 - curr.position).norm() > min_spacing && (next.position - p1).norm() > min_spacing) {
new_points.push_back(new_p);
}
}
if (distance_to_speed) {
// Only keep a cut that changes the G-code: one that prints differently from at least one of the
// points either side of it, which are the line's ends or the other cut where that is kept. A cut
// that prints like both would only split a move into two identical ones.
if (keep[0])
keep[0] = !same_speed_and_fan(cut[0].distance, curr.distance) ||
!same_speed_and_fan(cut[0].distance, keep[1] ? cut[1].distance : next.distance);
if (keep[1])
keep[1] = !same_speed_and_fan(cut[1].distance, keep[0] ? cut[0].distance : curr.distance) ||
!same_speed_and_fan(cut[1].distance, next.distance);
// Two cuts closer together than min_spacing would leave a micro segment between them, so only the
// first is kept.
if (keep[0] && keep[1] && (cut[1].position - cut[0].position).norm() <= min_spacing)
keep[1] = false;
}
for (int k = 0; k < 2; ++k)
if (keep[k])
new_points.push_back(cut[k]);
}
}
new_points.push_back(next);
@@ -447,10 +423,7 @@ public:
const ConfigOptionFloatsOrPercents &speeds,
float ext_perimeter_speed,
float original_speed,
bool slowdown_for_curled_edges,
// Overlap at or below which the overhang fan switches on; negative when the fan
// does not depend on overlap.
float fan_overlap_threshold = -1.0f)
bool slowdown_for_curled_edges)
{
size_t speed_sections_count = std::min(overlaps.values.size(), speeds.values.size());
std::vector<std::pair<float, float>> speed_sections;
@@ -490,8 +463,7 @@ public:
}
}
// If no overhang distance slows this path down, -1 turns interior sampling off unless the overhang fan can switch.
// Lines are only split where an end prints slower or cooled, so here only a fan switch splits them.
// If a meaningful (i.e. needing slowdown) overhang distance was not found, then we shouldn't split the lines
if (!found)
smallest_distance_with_lower_speed=-1.f;
@@ -515,17 +487,9 @@ public:
return round(final_speed);
};
// ORCA: The speed sections are built from ext_perimeter_speed, which can be above the speed this path prints at
// (original_speed, e.g. held down by resonance avoidance). Every segment is capped at original_speed below, so
// overhang distances whose speeds differ only above it print the same and must not count as a speed change when
// the path is split.
auto effective_speed = [&calculate_speed, original_speed](float distance) {
return std::min(calculate_speed(distance), original_speed);
};
std::vector<ExtendedPoint<3>> extended_points =
estimate_points_properties<true, true, true, true>(path.polyline.points, prev_layer_boundaries[current_object], path.width, -1,
smallest_distance_with_lower_speed, effective_speed, fan_overlap_threshold);
smallest_distance_with_lower_speed, calculate_speed);
const auto width_inv = 1.0f / path.width;
std::vector<ProcessedPoint> processed_points;
processed_points.reserve(extended_points.size());
+165
View File
@@ -0,0 +1,165 @@
#include "InstanceLock.hpp"
#include <map>
#include <memory>
#include <system_error>
#include <thread>
#include <boost/filesystem.hpp>
#include <boost/log/trivial.hpp>
#include <boost/nowide/fstream.hpp>
#ifdef _WIN32
#include <boost/interprocess/sync/file_lock.hpp>
#include <boost/nowide/convert.hpp>
#else
#include <cerrno>
#include <fcntl.h>
#include <sys/file.h>
#include <unistd.h>
#endif
namespace Slic3r {
#ifdef _WIN32
// LockFileEx, held by this handle alone.
using NativeFileLock = boost::interprocess::file_lock;
#else
// flock(2) rather than an fcntl lock: it belongs to this open file description,
// so any other code in the process that opens and closes the lock file, as a
// backup or an export walking the data dir might, cannot drop it. An fcntl
// lock would go with the first such close.
class NativeFileLock
{
public:
explicit NativeFileLock(const char *path) : m_fd(::open(path, O_RDWR | O_CREAT | O_CLOEXEC, 0644))
{
if (m_fd < 0)
throw std::system_error(errno, std::generic_category(), path);
}
~NativeFileLock() { ::close(m_fd); }
bool try_lock()
{
if (::flock(m_fd, LOCK_EX | LOCK_NB) == 0)
return true;
// A signal (a child exiting, for one) interrupts the call like any other; the caller polls again.
if (errno == EWOULDBLOCK || errno == EINTR)
return false;
throw std::system_error(errno, std::generic_category(), "flock");
}
void unlock() { ::flock(m_fd, LOCK_UN); }
private:
int m_fd;
};
#endif
// One slot per lock file, shared by every guard in the process: one lock
// object per path behind a mutex is what makes the guard re-entrant and safe
// to use from the preset sync thread and the GUI thread at once. The lock
// file is opened by the outermost guard and closed when it goes, so the file
// is never held open between guards: whatever is at the path is what gets
// locked, and a data dir can be removed once nothing is saving into it. The
// file is kept rather than deleted on release because the lock state lives in
// the kernel on the open file, and deleting it would let a third instance
// lock a fresh file while the second still holds the old one.
struct InstanceLock::Slot
{
std::recursive_mutex mutex;
// Non-null exactly while this process holds the file lock.
std::unique_ptr<NativeFileLock> file_lock;
int depth{0};
// Until this point, after a guard could not open, lock or wait out the
// file, guards do not touch it.
std::chrono::steady_clock::time_point cooldown_until{};
};
InstanceLock::Slot &InstanceLock::slot_for(const std::string &lock_file_path)
{
// Never freed: a save during static destruction still needs its slot.
static auto *registry_mutex = new std::mutex();
static auto *registry = new std::map<std::string, std::unique_ptr<Slot>>();
std::lock_guard<std::mutex> guard(*registry_mutex);
std::unique_ptr<Slot> &slot = (*registry)[lock_file_path];
if (! slot)
slot = std::make_unique<Slot>();
return *slot;
}
// Starts the cool-down. Called with the slot mutex held.
void InstanceLock::defer(Slot &slot, const std::string &reason)
{
slot.cooldown_until = std::chrono::steady_clock::now() + cooldown;
BOOST_LOG_TRIVIAL(warning) << reason << "; proceeding without the lock for the next " << cooldown.count() << " ms";
}
// Creates the lock file if needed and opens it, or starts the cool-down.
// Called with the slot mutex held.
bool InstanceLock::open_lock_file(Slot &slot, const std::string &lock_file_path)
{
try {
#ifdef _WIN32
// The lock opens an existing file; created once, on the first miss.
const std::wstring wide_path = boost::nowide::widen(lock_file_path);
try {
slot.file_lock = std::make_unique<NativeFileLock>(wide_path.c_str());
} catch (const std::exception &) {
boost::nowide::ofstream(lock_file_path, std::ios::app).close();
slot.file_lock = std::make_unique<NativeFileLock>(wide_path.c_str());
}
#else
slot.file_lock = std::make_unique<NativeFileLock>(lock_file_path.c_str());
#endif
return true;
} catch (const std::exception &e) {
defer(slot, "Cannot open lock file " + lock_file_path + ": " + e.what() + " (check its owner and permissions)");
return false;
}
}
InstanceLock::InstanceLock(const std::string &lock_file_path, std::chrono::milliseconds timeout)
{
if (lock_file_path.empty())
return;
m_slot = &slot_for(lock_file_path);
m_slot_guard = std::unique_lock<std::recursive_mutex>(m_slot->mutex);
const auto now = std::chrono::steady_clock::now();
if (m_slot->depth == 0 && now >= m_slot->cooldown_until && open_lock_file(*m_slot, lock_file_path)) {
const auto deadline = now + timeout;
bool taken = false;
for (;;) {
try {
if ((taken = m_slot->file_lock->try_lock()))
break;
} catch (const std::exception &e) {
defer(*m_slot, "Cannot lock " + lock_file_path + ": " + e.what());
break;
}
if (std::chrono::steady_clock::now() >= deadline) {
defer(*m_slot, "Another instance has held " + lock_file_path + " for over " + std::to_string(timeout.count()) + " ms");
break;
}
std::this_thread::sleep_for(std::chrono::milliseconds(5));
}
if (! taken)
m_slot->file_lock.reset();
}
// Counted last, so a throw above leaves the slot exactly as it was found.
++ m_slot->depth;
m_locked = m_slot->file_lock != nullptr;
}
InstanceLock::~InstanceLock()
{
if (m_slot == nullptr)
return;
if (-- m_slot->depth == 0 && m_slot->file_lock) {
try {
m_slot->file_lock->unlock();
} catch (const std::exception &e) {
BOOST_LOG_TRIVIAL(warning) << "Cannot unlock instance lock: " << e.what();
}
m_slot->file_lock.reset();
}
}
} // namespace Slic3r
+60
View File
@@ -0,0 +1,60 @@
#pragma once
#include <chrono>
#include <mutex>
#include <string>
namespace Slic3r {
// Scoped write lock on a file shared by every running instance of the
// application, such as the app config or the user preset directory: threads
// of this process are serialised through a recursive mutex, other processes
// through an advisory OS file lock on `lock_file_path`. The lock file is
// created on first use and kept; the OS releases the lock when its holder
// exits, so a crashed instance never leaves a stale lock behind.
//
// Best effort: when the lock file cannot be opened or locked, or another
// instance still holds it after `timeout`, the guard keeps only the in-process
// mutex, locked() reports false and the write proceeds, since a hung instance
// must never block another one from saving. For `cooldown` afterwards guards
// leave the file alone. The wait for the in-process mutex is bounded only by
// the longest critical section, so a guard covers a few file operations and
// nothing slower.
//
// Lock order: the preset collection mutex may be held when a guard is taken
// (set_sync_info_and_save() calls save_info() under it), never the reverse;
// that is why the guards sit at the leaf readers and writers and why a guard
// must not be added around save_user_presets(), which takes the collection
// mutex through delete_preset().
class InstanceLock
{
public:
// Long against a critical section of milliseconds, short against the GUI
// thread, which is where most guards are taken.
static constexpr std::chrono::milliseconds default_timeout{1000};
// Long enough that a holder stuck in a debugger does not cost a stall per
// save; mutable so tests can shorten it.
static inline std::chrono::milliseconds cooldown{10000};
// An empty path makes the guard a no-op.
explicit InstanceLock(const std::string &lock_file_path, std::chrono::milliseconds timeout = default_timeout);
~InstanceLock();
InstanceLock(const InstanceLock &) = delete;
InstanceLock &operator=(const InstanceLock &) = delete;
// True while this process holds the cross-process file lock.
bool locked() const { return m_locked; }
private:
struct Slot;
static Slot &slot_for(const std::string &lock_file_path);
static bool open_lock_file(Slot &slot, const std::string &lock_file_path);
static void defer(Slot &slot, const std::string &reason);
Slot *m_slot{nullptr};
std::unique_lock<std::recursive_mutex> m_slot_guard;
bool m_locked{false};
};
} // namespace Slic3r
+16
View File
@@ -13,8 +13,19 @@
namespace Slic3r {
// How many setters this thread holds, so the ones nested in another can skip
// setlocale, which takes a lock the whole process shares on Windows.
static thread_local int s_numeric_locale_depth = 0;
CNumericLocalesSetter::CNumericLocalesSetter()
{
// Nested in another setter on this thread, whose "C" the separator check
// confirms is still set.
if (s_numeric_locale_depth > 0 && is_decimal_separator_point()) {
m_nested = true;
++ s_numeric_locale_depth;
return;
}
#ifdef _WIN32
_configthreadlocale(_ENABLE_PER_THREAD_LOCALE);
m_orig_numeric_locale = std::setlocale(LC_NUMERIC, nullptr);
@@ -29,12 +40,17 @@ CNumericLocalesSetter::CNumericLocalesSetter()
m_new_locale = newlocale(LC_NUMERIC_MASK, "C", m_new_locale);
uselocale(m_new_locale);
#endif
// Counted last, since the destructor does not run for a constructor that throws.
++ s_numeric_locale_depth;
}
CNumericLocalesSetter::~CNumericLocalesSetter()
{
-- s_numeric_locale_depth;
if (m_nested)
return;
#ifdef _WIN32
std::setlocale(LC_NUMERIC, m_orig_numeric_locale.data());
#else

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