diff --git a/.github/workflows/build_all.yml b/.github/workflows/build_all.yml index ac65eddf11..5589315491 100644 --- a/.github/workflows/build_all.yml +++ b/.github/workflows/build_all.yml @@ -268,6 +268,10 @@ jobs: - /opt/ghc:/opt/ghc1 - /usr/local/share/boost:/usr/local/share/boost1 - /opt/hostedtoolcache:/opt/hostedtoolcache1 + # Updating a runtime renames its old deployment, which fails with + # "Invalid cross-device link" on hosts whose Docker overlay cannot + # rename directories from an image layer. A volume is not overlay. + - /var/lib/flatpak strategy: fail-fast: false matrix: diff --git a/docs/HLSD/prime-tower-sparse-layers.md b/docs/HLSD/prime-tower-sparse-layers.md index 19802c9169..47a0ff4163 100644 --- a/docs/HLSD/prime-tower-sparse-layers.md +++ b/docs/HLSD/prime-tower-sparse-layers.md @@ -29,7 +29,32 @@ the tower is continuous from the bed to its last purge. `wipe_tower_layer_height is the distance from the previous tower layer, which is the object's layer height whenever the tower prints on every layer. -`Print::_make_wipe_tower` plans one tower layer per such object layer. A layer +A tower layer thinner than the printer's minimum layer height (by more than +`EPSILON`, so layers sliced at exactly the minimum stay apart; never less than the +towers' own 1e-3 mm merge) is not printed on its own: it joins the tower layer +below. Precise Z height leaves such layers when it ends each object at its exact +top, moving one object's last layers off another's by anything up to a layer +height; a purge sized for a layer a few microns thick would run hundreds of mm. +A joined layer takes `wipe_tower_print_z` and `wipe_tower_layer_height` from the +tower layer below, and its purges print down at that tower layer's z: the emitter +travels over the tower first, descends, and climbs back to the object layer, the +same sequence it uses for a tower compacted below the objects. After a custom +`change_filament_gcode` the descent happens wherever the macro leaves the head, so +a macro has to end over the tower, as it already must for the compacted tower. +Layers from the minimum layer height up stay tower layers of their own, sized for +their height. + +The emitter takes one tower result per toolchange, and a layer without one takes +a result only to finish the tower layer. So `wipe_tower_layer_ends` marks the last +of the tower layer and its joined layers that changes tools, or the last of them +when none does: a joined layer that changes nothing after the results are all +taken has nothing left to finish with. A joined layer also does not reset the +Type 1 tower's first print, so smooth timelapse prints each tower layer's wall +once. + +`Print::_make_wipe_tower` plans every such object layer at its +`wipe_tower_print_z`: one tower layer per object layer, except that a joined +layer's toolchanges land in the tower layer below. A layer whose only call keeps the current filament leaves no toolchange in the plan, and the layer it generates is a single result whose initial and new tool are equal. That is what `wipe_tower_layer_is_sparse` recognises, and it is the unit both @@ -37,8 +62,8 @@ settings work on. The plan stays one entry per tower layer in every case. The G-code emitter walks `WipeTowerData::tool_changes` by layer index, advancing once per object layer -that carries a tower, so a planner that removed entries would silently shift -every later layer onto the wrong tower geometry. Layers that print nothing are +that carries a tower and does not join the one below, so a planner that removed +entries would silently shift every later layer onto the wrong tower geometry. Layers that print nothing are therefore still planned and still generated; they are marked, and the emitter drops them. @@ -193,5 +218,9 @@ read as off rather than compacting or merging in one place and not another. and the clearance geometry the plater draws. - [Slicing tests](../../tests/fff_print/test_wipe_tower.cpp) slice a real print and check that a run folds, that the tower still covers the object exactly - once, that a run too thin for the cap is left alone, and that a merged layer - declares its height in the tag the printer's processor reads. + once, that a run too thin for the cap is left alone, that a merged layer + declares its height in the tag the printer's processor reads, and that layers + precise Z height moves less than a minimum layer height off another object's + join the tower layer below and print at its z, with and without their own + toolchange and with smooth timelapse, while layers sliced at exactly the + minimum height do not join. diff --git a/docs/HLSD/selection-outline.md b/docs/HLSD/selection-outline.md new file mode 100644 index 0000000000..d2f94fcf26 --- /dev/null +++ b/docs/HLSD/selection-outline.md @@ -0,0 +1,102 @@ +# Selection outline — High Level Design + +## Purpose and scope + +When the Outline view option is on, the selected volumes of the 3D canvas are outlined: a ring of +constant screen width around their silhouette, and thinner lines along their inner edges, the creases +between faces, the contours where one part of the selection hides another, and the seams between +neighboring parts. It is a view setting. It changes nothing in the model or the project, and it reaches +neither the picking pass nor thumbnails. + +`SelectionOutline` draws it once per frame for the whole selection, after the object passes of +`GLCanvas3D::_render_scene()`. Its cost depends on the screen area of the selection, not on its triangle +count, apart from one extra draw of the selected volumes. + +## Passes + +`GLVolumeCollection::render()` collects the selected volumes it draws, when the canvas passes it a list, +and sets bit `SelectionOutline::StencilBit` of the canvas stencil wherever one of them passes the depth +test. The stencil is cleared with the depth buffer at the start of the frame. `SelectionOutline::render()` +then runs three passes, restricted by the scissor to the screen box of the selection, padded by how far +each pass reads the one before it. + +1. **Mask** (`outline_mask`). The selected volumes are drawn again, with the clipping of the object + passes, into a 16 bit RGBA target with a depth texture of its own. Each texel packs, in two bytes per + channel, the octahedral encoded view normal turned towards the camera, the part index of its volume, + and the distances from the texel center to the edge of its triangle along +x, -x, + +y and -y. GLModel gives every triangle three vertices of its own, so `gl_VertexID % 3` yields the + barycentrics, and their screen derivatives the distances. +2. **Edges** (`outline_edges`). For every texel, and each pair it forms with its right and upper neighbor, + an inner edge is classified and located, and packed as a 4 bit strength and a 4 bit crossing position + between the two texel centers. Along its row, the pass also finds the nearest covered texel and sums + the coverage under a gaussian. +3. **Composite** (`outline`). A full screen quad, drawn twice into the canvas framebuffer. The ring pass + draws where the stencil bit is clear, so its inner edge is the multisampled silhouette of the + selection itself. The lines pass draws where it is set, so inner lines stop exactly at the silhouette. + +The targets, 16 bytes a pixel at canvas size, are allocated when something is outlined and kept from frame +to frame, and they are freed in the first frame with nothing to outline. + +## Inner edges + +A pair of covered texels makes an edge when its normals differ by more than 25 degrees, fully at 40, +when one surface hides the other, or when the texels belong to different parts. One surface hides the +other when the view space step between the texels lies more than a few pixels off their planes, and +each texel lies more than a pixel off the surface of the other side carried on over the pair. A curved +surface seen edge on carries on smoothly, so it does not break into lines, nor does a fillet whose facets +turn a little at every texel on both sides. A texel on a triangle smaller than a pixel both ways +takes the normal of a neighbor beside it: the normals of such slivers can be far off their surface and +would otherwise show as dots. + +The crossing is placed between the texel centers, in this order of preference: + +- where the triangles under both texels end, when they agree: the edge they share; +- where the depth planes of the two sides meet, extrapolated from two texels on each side, when each side + is flat over them and the planes part clearly along the axis; +- for a hidden surface, where the triangle of the nearer one ends, when the texel behind it or the two + beside it end on the same straight line, as a curved contour made of strips narrower than a pixel does + not; +- otherwise half way. + +The lines pass takes the nearest crossing along the row of the pixel and the nearest along its column. +For a straight line at distance d, they lie at d / |cos| and d / |sin| of its normal, so +1 / d² = 1 / dx² + 1 / dy², which gives the distance at any angle without knowing it. The line is drawn +with a smooth edge around its half width. + +## Ring + +The binary mask places the silhouette only within half a texel, which would show as a ripple along the +outer edge of the ring. The coverage of the mask under a gaussian, summed over the rows by the edges pass +and over the columns by the ring pass, is the normal tail beyond d / sigma for a straight silhouette at +distance d, which the ring pass inverts for a sub-texel distance. Corners and features thinner than the +gaussian lose coverage faster, so the distance is kept within half a texel of the one to the nearest +covered texel, which the same two passes find exactly. + +## Occlusion + +The composite is depth tested against the canvas, so what stands in front of the selection hides its +outline. It writes the depth of the selection at each pixel, from the mask, moved forward by the spread +of that depth over the pixel, so that the selection passes the test on every sample. The ring takes the +depth of the nearest covered texel, brought forward with its distance from the silhouette, so that it +also shows over the plate the object stands on, which lies in front of the silhouette right below it. + +The outline sets `SelectionOutline::DrawnBit` of the stencil wherever it draws, and the screen space +ambient occlusion pass of the realistic view, which runs after it, leaves those samples as they are. The +outline lies on top of the surfaces, so their occlusion would only darken it, unevenly, in the creases it +marks. + +## Colors and sizes + +The outline is white. Its lines have a width on the model, 0.35 mm for the ring and 0.18 mm for the inner +lines, so they grow as the camera closes in, kept between 2.5 and 5 pixels for the ring and 1.2 and 2.4 for +the inner lines, scaled by the canvas scale. An inner line that would be thinner than 1.2 pixels fades +instead, down to 40%, so that a far selection does not turn into lines. Inner lines are drawn at 75% +opacity. Both have a smooth edge 1.2 pixels wide. + +## Requirements + +The outline needs ARB framebuffer objects, a 16 bit RGBA color renderable texture and the outline +shaders, and it is not drawn without them. Under GLSL 1.10 there is no `gl_VertexID`: crossings fall +back on the depth planes and the half way point, and slivers are not detected. Without 8 stencil bits, +which the two bits used need, the ring stays off the pixels the mask covers and loses the exact inner +edge, and the occlusion pass shades the outline too. diff --git a/docs/HLSD/wipe-inward.md b/docs/HLSD/wipe-inward.md index 9f1c617cc3..03f259543b 100644 --- a/docs/HLSD/wipe-inward.md +++ b/docs/HLSD/wipe-inward.md @@ -24,11 +24,22 @@ millimeters. Using the path width makes Auto width and Arachne's variable widths meaningful. The effective offset is limited by that width and the spacing to the adjacent wall. A zero distance disables the offset. -Only external perimeters with a suitable, previously printed inner perimeter -are eligible. A configured wall count alone cannot establish eligibility: -the local geometry may contain fewer walls, and walls scheduled later do not -provide support. Outer/Inner wall order therefore normally retains the regular -wipe path. +Only external perimeters with an adjacent inner perimeter are eligible. A +configured wall count alone cannot establish eligibility: the local geometry +may contain fewer walls. With Inner/Outer order the adjacent wall must already +be printed. Walls scheduled later never support the path. + +Outer/Inner and Inner/Outer/Inner wall orders print the adjacent inner wall +after the external wall. Its geometry still identifies the inward side and the +presence of an adjacent wall, but an inward wipe can then use the external +bead's own material only up to half its actual width. Larger requested offsets +are limited to this half-width, even if a more distant inner perimeter was +printed earlier: the third wall in Inner/Outer/Inner order, or the inner wall +of another loop across a thin section in Outer/Inner order. The limit follows +the configured order, so it also applies on the first layer, where sandwich +order is not used. +It applies to percentages and equivalent absolute distances, using the actual +extrusion width rather than the configured Auto width. Retraction and pressure advance calibrations disable inward wiping so it cannot mask the behavior being measured. The calibration settings turn it off, and @@ -39,7 +50,10 @@ G-code generation enforces this even if a profile or object override enables it. The planner identifies an adjacent inner perimeter on the material side of the outgoing wall. Contour winding and the distinction between outer contours and holes establish a preferred direction; local printed geometry resolves ambiguous -or self-touching contours. +or self-touching contours. Sampling farther along the wall identifies its adjacent +branch, while the available offset is measured from a nearby support point at the +extrusion endpoint. This local search has the same bounded corner reach as support +validation; a displacement measured at the sample cannot substitute for local support. Candidate paths offset or translate the portion needed for the configured wipe distance. A wide seam gap can prevent a supported forward path; following the @@ -51,19 +65,25 @@ complete executable path, including its connector from the nozzle position, against the current and earlier printed perimeters. Nearby endpoints alone do not establish support across a gap. -Each region accumulates its printed perimeter prefix once, in extrusion order. -Every entity contributes its geometry only after it is printed, and the prefix -is discarded when the region ends. This collection is skipped when inward wiping -is disabled or its configured distance is zero. A mixed inner-wall loop remains -an eligible target even when its first path is an overhang: ordinary inner-wall +Each region of an island accumulates its printed perimeter prefix once, in +extrusion order. Every entity contributes its geometry only after it is printed, +and the prefix is discarded when that region of the island ends. This collection +is skipped when inward wiping is disabled or its configured distance is zero. +With Outer/Inner and Inner/Outer/Inner order, all inner walls of the region are +collected as targets before printing; they do not support the path until printed. +A mixed inner-wall loop remains an eligible target even when its first path is +an overhang: ordinary inner-wall paths elsewhere in the loop identify it. Likewise, an external loop with an overhanging start remains eligible when other segments identify the external wall. It is available for support checks but is not an inner-wall target. Candidate-specific support filtering and AABB trees are built only for eligible -external loops, then reused across their candidate paths. +external loops, then reused across their candidate paths. They contain only the +printed walls within the wipe length plus twice the corner reach of the support +checks around the seam, so an island with many holes does not rebuild trees of +its whole printed prefix for every loop. Material-side validation applies with or without a seam gap. Along each -candidate, local wall normals point toward the adjacent printed inner wall; +candidate, local wall normals point toward the adjacent inner wall; samples on the opposite side are rejected even when they remain close enough to the external wall to pass the support check. This uses the open wall geometry without treating it as a closed polygon. Full paths at a zero-gap seam also @@ -73,9 +93,10 @@ material-side and support checks apply without that additional clearance rule. An accepted candidate replaces the stored wipe path as a whole. A short direct inward move is also eligible when longer candidates fail validation. It may -waive full wall clearance, but must pass the material-side check. Its initial -direction is checked from the actual nozzle position after any loop pre-move; -the original wall endpoint is retained separately for intersection checks. It takes +waive full wall clearance, but must pass the material-side check. Every candidate's +initial direction is checked from the actual nozzle position, including the seam +gap and any loop pre-move; its construction origin is retained separately for +intersection checks. The short direct move takes priority over the alternate offset when the preferred and translated paths are unusable. A longer reversed path may replace the selected candidate only when its distance to the target inner wall is no worse within tolerance. @@ -84,9 +105,10 @@ when its distance to the target inner wall is no worse within tolerance. The original wipe path is retained when: -- No suitable adjacent inner wall has already been printed near the seam. This - includes single-wall areas, locally missing inner walls and normally Outer/Inner - wall order. A distant wall or a wall on the air side does not qualify. +- The external wall has no suitable adjacent inner wall near the seam, as in + single-wall areas or where inner walls are locally missing. With Inner/Outer + order it must already be printed. A distant wall or a wall on the air side + does not qualify. - The requested or available offset, or the configured wipe distance, is zero or too small at the geometry's coordinate precision. - Degenerate geometry prevents construction of a usable candidate, or all @@ -128,18 +150,19 @@ Joins that already backtrack across the seam gap are not adjusted this way. ## Execution and retraction -The stored wipe path uses a sentinel first point. Execution starts from the -actual nozzle position and proceeds to the second stored point. Path selection, -support validation and wipe-length calculation must all use this same executable -geometry, especially after a Wipe on loop move. +Regular and inward wipe paths use a sentinel first point, replaced by the +actual nozzle position during execution. Selecting an inward path changes only +the stored wipe geometry. Seam selection and travel planning retain the actual +post-extrusion position, including any Wipe on loop move. -An accepted inward path executes at the end of the external loop, after any -Wipe on loop move, without retracting filament. It consumes the stored path and -updates the nozzle position before travel planning. A short travel to the next -wall cannot discard this wipe or force a retraction or Z-hop. Subsequent travel -uses the normal minimum-travel threshold and retraction/lift settings from the -new position. The regular wipe, including fallback, remains deferred until a -normal retraction uses it. +The next travel applies the normal minimum-travel threshold and retraction/lift +rules from that position. If retraction is needed, the ordinary retract operation +executes the selected wipe with the configured before/during/after split, then +replans travel from the wipe's endpoint when necessary. If a regular wipe would +be skipped, the inward wipe is skipped too. In particular, a short travel or an +extrusion starting at the current position does not execute an inward move, +retract or Z-hop. A consumed or replaced path is cleared so it cannot execute +twice. Layer and tool-change retractions can also consume the stored path. Retraction is divided into portions before, during and after wiping. The amount that can be retracted during the wipe depends on its executable length, wipe @@ -147,8 +170,10 @@ speed and the active filament's retraction speed. Fractional retraction speeds are retained in this calculation. For a 2 mm wipe at 100 mm/s and a retraction speed of 25.5 mm/s, the wipe can retract 0.51 mm. With a total retraction of 0.8 mm and both before/after percentages set to zero, the remaining 0.29 mm is retracted -before wiping. This split applies to regular deferred wipes, including fallback; -an accepted inward wipe executes separately without retraction. +before wiping. This split applies to regular and inward wipes whenever normal +travel planning or an explicit layer/tool-change retraction calls for a retract. +A travel that needs no retraction does not execute either wipe geometry, +irrespective of the configured retraction percentages. ## Implementation and verification @@ -163,6 +188,11 @@ an accepted inward wipe executes separately without retraction. across path subdivisions. - [FFF tests](../../tests/fff_print/test_wipe.cpp) cover emitted trajectories, fallback, minimum-travel retraction and Z-hop rules, and export invalidation. + Inward-wipe checks cover before/during/after retraction splits, including 100% + before or after wiping, with both E modes and Wipe on loop. Short travels + skip the wipe, retraction and Z-hop for every split. A threshold between the + original travel length and the distance from an inward wipe's endpoint also + verifies that selecting the inward path cannot create a retraction. With Wipe inward disabled, they check the loop move's direction and magnitude for Classic and Arachne, the subsequent wipe's start and length, and fractional retraction splitting in absolute and relative E modes. diff --git a/localization/i18n/OrcaSlicer.pot b/localization/i18n/OrcaSlicer.pot index a9e1a583f8..db974cb34a 100644 --- a/localization/i18n/OrcaSlicer.pot +++ b/localization/i18n/OrcaSlicer.pot @@ -17747,11 +17747,11 @@ msgid "Wipe inward" msgstr "" msgid "" -"Applies only to external walls, including hole boundaries. Moves the hot nozzle toward printed inner walls during wiping to reduce reheating of freshly printed plastic and seam marks.\n" +"Applies only to external walls, including hole boundaries. Moves the hot nozzle toward the inner walls during wiping to reduce reheating of freshly printed plastic and seam marks.\n" "\n" "Especially useful at layer heights below 0.1 mm, where wipe marks are more visible.\n" "\n" -"Uses the regular wipe if no adjacent inner wall is already printed (single-wall areas or Outer/Inner wall order), or if no supported inward path can be found, for example at tight corners or seam gaps." +"Uses the regular wipe where the outer wall has no adjacent inner wall, such as in single-wall areas, or if no supported inward path can be found, for example at tight corners or seam gaps." msgstr "" msgid "Wipe inward distance" @@ -17761,7 +17761,9 @@ msgstr "" msgid "" "The distance the wipe path is shifted away from the external perimeter, specified in millimeters or as a percentage of the actual outer-wall extrusion width.\n" "\n" -"For example, 50% shifts the path by half of the outer-wall width. The effective offset is limited by both the actual outer-wall width and the available spacing to the adjacent wall, so values above 100% or an equivalent absolute distance have no additional effect. Set to 0 to disable the offset." +"For example, 50% shifts the path by half of the outer-wall width. The effective offset is limited by both the actual outer-wall width and the available spacing to the adjacent wall, so values above 100% or an equivalent absolute distance have no additional effect. Set to 0 to disable the offset.\n" +"\n" +"With Outer/Inner or Inner/Outer/Inner wall order, the offset is limited to 50% of the actual outer-wall width because the adjacent inner wall is printed after the outer wall. This also applies to equivalent distances specified in millimeters." msgstr "" msgid "Wipe before external loop" @@ -21378,7 +21380,7 @@ msgid "Klipper version => 0.9.0" msgstr "" msgid "" -"RepRap firmware version => 3.4.0\n" +"RepRapFirmware version => 3.4.0\n" "Check your firmware documentation for supported shaper types." msgstr "" @@ -21394,7 +21396,7 @@ msgstr "" msgid "Frequency settings" msgstr "" -msgid "RepRap firmware uses the same frequency range for both axes." +msgid "RepRapFirmware uses the same frequency range for both axes." msgstr "" msgid "Damp: " @@ -21428,7 +21430,7 @@ msgstr "" msgid "Damp (Start / End): " msgstr "" -msgid "RepRap firmware uses the same frequency for both axes." +msgid "RepRapFirmware uses the same frequency for both axes." msgstr "" msgid "Note: Use previously calculated frequencies." diff --git a/localization/i18n/ca/OrcaSlicer_ca.po b/localization/i18n/ca/OrcaSlicer_ca.po index 7d54824430..07014aec2e 100644 --- a/localization/i18n/ca/OrcaSlicer_ca.po +++ b/localization/i18n/ca/OrcaSlicer_ca.po @@ -20410,17 +20410,17 @@ msgstr "Netejar cap a dins" # AI Translated msgid "" -"Applies only to external walls, including hole boundaries. Moves the hot nozzle toward printed inner walls during wiping to reduce reheating of freshly printed plastic and seam marks.\n" +"Applies only to external walls, including hole boundaries. Moves the hot nozzle toward the inner walls during wiping to reduce reheating of freshly printed plastic and seam marks.\n" "\n" "Especially useful at layer heights below 0.1 mm, where wipe marks are more visible.\n" "\n" -"Uses the regular wipe if no adjacent inner wall is already printed (single-wall areas or Outer/Inner wall order), or if no supported inward path can be found, for example at tight corners or seam gaps." +"Uses the regular wipe where the outer wall has no adjacent inner wall, such as in single-wall areas, or if no supported inward path can be found, for example at tight corners or seam gaps." msgstr "" -"Només s'aplica als perímetres exteriors, inclosos els contorns dels forats. Durant la neteja mou el broquet calent cap als perímetres interiors ja impresos per reduir el reescalfament del plàstic acabat d'imprimir i les marques de costura.\n" +"Només s'aplica als perímetres exteriors, inclosos els contorns dels forats. Durant la neteja mou el broquet calent cap als perímetres interiors per reduir el reescalfament del plàstic acabat d'imprimir i les marques de costura.\n" "\n" "És especialment útil amb alçades de capa per sota de 0,1 mm, on les marques de neteja es veuen més.\n" "\n" -"Fa servir la neteja normal si no hi ha cap perímetre interior contigu ja imprès (zones d'un sol perímetre o ordre de perímetres Exterior/Interior) o si no es troba cap trajectòria cap a dins amb suport, per exemple a cantonades tancades o a buits de la costura." +"Fa servir la neteja normal on el perímetre exterior no té cap perímetre interior contigu, com ara a les zones d'un sol perímetre, o si no es troba cap trajectòria cap a dins amb suport, per exemple a cantonades tancades o a buits de la costura." # AI Translated msgid "Wipe inward distance" @@ -20431,11 +20431,15 @@ msgstr "Distància de neteja cap a dins" msgid "" "The distance the wipe path is shifted away from the external perimeter, specified in millimeters or as a percentage of the actual outer-wall extrusion width.\n" "\n" -"For example, 50% shifts the path by half of the outer-wall width. The effective offset is limited by both the actual outer-wall width and the available spacing to the adjacent wall, so values above 100% or an equivalent absolute distance have no additional effect. Set to 0 to disable the offset." +"For example, 50% shifts the path by half of the outer-wall width. The effective offset is limited by both the actual outer-wall width and the available spacing to the adjacent wall, so values above 100% or an equivalent absolute distance have no additional effect. Set to 0 to disable the offset.\n" +"\n" +"With Outer/Inner or Inner/Outer/Inner wall order, the offset is limited to 50% of the actual outer-wall width because the adjacent inner wall is printed after the outer wall. This also applies to equivalent distances specified in millimeters." msgstr "" "Distància que es desplaça la trajectòria de neteja allunyant-se del perímetre exterior, indicada en mil·límetres o com a percentatge de l'amplada d'extrusió real del perímetre exterior.\n" "\n" -"Per exemple, 50% desplaça la trajectòria la meitat de l'amplada del perímetre exterior. El desplaçament efectiu està limitat tant per l'amplada real del perímetre exterior com per l'espai disponible fins al perímetre contigu, de manera que els valors per sobre de 100% o una distància absoluta equivalent no tenen cap efecte addicional. Poseu-hi 0 per desactivar el desplaçament." +"Per exemple, 50% desplaça la trajectòria la meitat de l'amplada del perímetre exterior. El desplaçament efectiu està limitat tant per l'amplada real del perímetre exterior com per l'espai disponible fins al perímetre contigu, de manera que els valors per sobre de 100% o una distància absoluta equivalent no tenen cap efecte addicional. Poseu-hi 0 per desactivar el desplaçament.\n" +"\n" +"Amb l'ordre de perímetres Exterior/Interior o Interior/Exterior/Interior, el desplaçament es limita al 50% de l'amplada real del perímetre exterior, perquè el perímetre interior contigu s'imprimeix després del perímetre exterior. Això també s'aplica a les distàncies equivalents indicades en mil·límetres." msgid "Wipe before external loop" msgstr "Netejar abans del bucle extern" @@ -24756,10 +24760,10 @@ msgid "Klipper version => 0.9.0" msgstr "Versió Klipper => 0.9.0" msgid "" -"RepRap firmware version => 3.4.0\n" +"RepRapFirmware version => 3.4.0\n" "Check your firmware documentation for supported shaper types." msgstr "" -"Versió firmware RepRap => 3.4.0\n" +"Versió RepRapFirmware => 3.4.0\n" "Consulteu la documentació del firmware per als tipus de shaper compatibles." msgid "Frequency (Start / End): " @@ -24776,8 +24780,8 @@ msgstr "Inici / Final Y: " msgid "Frequency settings" msgstr "Configuració de freqüència" -msgid "RepRap firmware uses the same frequency range for both axes." -msgstr "El firmware RepRap utilitza el mateix rang de freqüència per a ambdós eixos." +msgid "RepRapFirmware uses the same frequency range for both axes." +msgstr "El RepRapFirmware utilitza el mateix rang de freqüència per a ambdós eixos." msgid "Damp: " msgstr "Amortiment: " @@ -24816,8 +24820,8 @@ msgstr "Freqüència X / Y: " msgid "Damp (Start / End): " msgstr "Esmorteïment (inici / final): " -msgid "RepRap firmware uses the same frequency for both axes." -msgstr "El firmware RepRap utilitza la mateixa freqüència per a ambdós eixos." +msgid "RepRapFirmware uses the same frequency for both axes." +msgstr "El RepRapFirmware utilitza la mateixa freqüència per a ambdós eixos." msgid "Note: Use previously calculated frequencies." msgstr "Nota: utilitzeu les freqüències calculades anteriorment." diff --git a/localization/i18n/cs/OrcaSlicer_cs.po b/localization/i18n/cs/OrcaSlicer_cs.po index 97980ea903..fbba20fdcc 100644 --- a/localization/i18n/cs/OrcaSlicer_cs.po +++ b/localization/i18n/cs/OrcaSlicer_cs.po @@ -20407,17 +20407,17 @@ msgstr "Očištění dovnitř" # AI Translated msgid "" -"Applies only to external walls, including hole boundaries. Moves the hot nozzle toward printed inner walls during wiping to reduce reheating of freshly printed plastic and seam marks.\n" +"Applies only to external walls, including hole boundaries. Moves the hot nozzle toward the inner walls during wiping to reduce reheating of freshly printed plastic and seam marks.\n" "\n" "Especially useful at layer heights below 0.1 mm, where wipe marks are more visible.\n" "\n" -"Uses the regular wipe if no adjacent inner wall is already printed (single-wall areas or Outer/Inner wall order), or if no supported inward path can be found, for example at tight corners or seam gaps." +"Uses the regular wipe where the outer wall has no adjacent inner wall, such as in single-wall areas, or if no supported inward path can be found, for example at tight corners or seam gaps." msgstr "" -"Platí pouze pro vnější stěny včetně obrysů otvorů. Během očištění posouvá horkou trysku směrem k již vytištěným vnitřním stěnám, aby se omezilo opětovné zahřívání čerstvě vytištěného plastu a stopy po švu.\n" +"Platí pouze pro vnější stěny včetně obrysů otvorů. Během očištění posouvá horkou trysku směrem k vnitřním stěnám, aby se omezilo opětovné zahřívání čerstvě vytištěného plastu a stopy po švu.\n" "\n" "Obzvláště užitečné při výškách vrstvy pod 0,1 mm, kde jsou stopy po očištění výraznější.\n" "\n" -"Použije běžné očištění, pokud není žádná sousední vnitřní stěna již vytištěná (oblasti s jedinou stěnou nebo pořadí stěn Vnější/Vnitřní) nebo pokud nelze najít podepřenou dráhu dovnitř, například v ostrých rozích nebo v mezerách švu." +"Použije běžné očištění tam, kde vnější stěna nemá sousední vnitřní stěnu, jako v oblastech s jedinou stěnou, nebo pokud nelze najít podepřenou dráhu dovnitř, například v ostrých rozích nebo v mezerách švu." # AI Translated msgid "Wipe inward distance" @@ -20428,11 +20428,15 @@ msgstr "Vzdálenost očištění dovnitř" msgid "" "The distance the wipe path is shifted away from the external perimeter, specified in millimeters or as a percentage of the actual outer-wall extrusion width.\n" "\n" -"For example, 50% shifts the path by half of the outer-wall width. The effective offset is limited by both the actual outer-wall width and the available spacing to the adjacent wall, so values above 100% or an equivalent absolute distance have no additional effect. Set to 0 to disable the offset." +"For example, 50% shifts the path by half of the outer-wall width. The effective offset is limited by both the actual outer-wall width and the available spacing to the adjacent wall, so values above 100% or an equivalent absolute distance have no additional effect. Set to 0 to disable the offset.\n" +"\n" +"With Outer/Inner or Inner/Outer/Inner wall order, the offset is limited to 50% of the actual outer-wall width because the adjacent inner wall is printed after the outer wall. This also applies to equivalent distances specified in millimeters." msgstr "" "Vzdálenost, o kterou se dráha očištění posune od vnějšího obvodu, uvedená v milimetrech nebo jako procento skutečné šířky extruze vnější stěny.\n" "\n" -"Například 50% posune dráhu o polovinu šířky vnější stěny. Účinný posun je omezen jak skutečnou šířkou vnější stěny, tak dostupnou mezerou k sousední stěně, takže hodnoty nad 100% nebo odpovídající absolutní vzdálenost už nemají další účinek. Nastavením na 0 posun vypnete." +"Například 50% posune dráhu o polovinu šířky vnější stěny. Účinný posun je omezen jak skutečnou šířkou vnější stěny, tak dostupnou mezerou k sousední stěně, takže hodnoty nad 100% nebo odpovídající absolutní vzdálenost už nemají další účinek. Nastavením na 0 posun vypnete.\n" +"\n" +"Při pořadí stěn Vnější/Vnitřní nebo Vnitřní/vnější/vnitřní je posun omezen na 50% skutečné šířky vnější stěny, protože sousední vnitřní stěna se tiskne až po vnější stěně. Platí to i pro odpovídající vzdálenosti zadané v milimetrech." msgid "Wipe before external loop" msgstr "Očištění před vnějším okruhem" @@ -24747,7 +24751,7 @@ msgid "Klipper version => 0.9.0" msgstr "Verze Klipper => 0.9.0" msgid "" -"RepRap firmware version => 3.4.0\n" +"RepRapFirmware version => 3.4.0\n" "Check your firmware documentation for supported shaper types." msgstr "" "Verze firmwaru RepRap => 3.4.0\n" @@ -24767,8 +24771,8 @@ msgstr "Y Začátek / Konec: " msgid "Frequency settings" msgstr "Nastavení frekvence" -msgid "RepRap firmware uses the same frequency range for both axes." -msgstr "Firmware RepRap používá stejný rozsah frekvence pro obě osy." +msgid "RepRapFirmware uses the same frequency range for both axes." +msgstr "RepRapFirmware používá stejný rozsah frekvence pro obě osy." msgid "Damp: " msgstr "Tlumení: " @@ -24807,8 +24811,8 @@ msgstr "Frekvence X / Y: " msgid "Damp (Start / End): " msgstr "Tlumení (Začátek / Konec): " -msgid "RepRap firmware uses the same frequency for both axes." -msgstr "Firmware RepRap používá stejnou frekvenci pro obě osy." +msgid "RepRapFirmware uses the same frequency for both axes." +msgstr "RepRapFirmware používá stejnou frekvenci pro obě osy." msgid "Note: Use previously calculated frequencies." msgstr "Poznámka: Použijte dříve vypočítané frekvence." diff --git a/localization/i18n/de/OrcaSlicer_de.po b/localization/i18n/de/OrcaSlicer_de.po index a67ae3610d..fe3e200e29 100644 --- a/localization/i18n/de/OrcaSlicer_de.po +++ b/localization/i18n/de/OrcaSlicer_de.po @@ -20058,17 +20058,17 @@ msgstr "Reinigen nach innen" # AI Translated msgid "" -"Applies only to external walls, including hole boundaries. Moves the hot nozzle toward printed inner walls during wiping to reduce reheating of freshly printed plastic and seam marks.\n" +"Applies only to external walls, including hole boundaries. Moves the hot nozzle toward the inner walls during wiping to reduce reheating of freshly printed plastic and seam marks.\n" "\n" "Especially useful at layer heights below 0.1 mm, where wipe marks are more visible.\n" "\n" -"Uses the regular wipe if no adjacent inner wall is already printed (single-wall areas or Outer/Inner wall order), or if no supported inward path can be found, for example at tight corners or seam gaps." +"Uses the regular wipe where the outer wall has no adjacent inner wall, such as in single-wall areas, or if no supported inward path can be found, for example at tight corners or seam gaps." msgstr "" -"Gilt nur für Außenwände, einschließlich Lochkonturen. Bewegt die heiße Düse beim Reinigen in Richtung bereits gedruckter innerer Wände, um das erneute Aufschmelzen frisch gedruckten Kunststoffs und Nahtmarkierungen zu verringern.\n" +"Gilt nur für Außenwände, einschließlich Lochkonturen. Bewegt die heiße Düse beim Reinigen in Richtung der inneren Wände, um das erneute Aufschmelzen frisch gedruckten Kunststoffs und Nahtmarkierungen zu verringern.\n" "\n" "Besonders nützlich bei Schichthöhen unter 0,1 mm, wo Reinigungsspuren deutlicher sichtbar sind.\n" "\n" -"Verwendet die normale Reinigung, wenn keine angrenzende innere Wand bereits gedruckt ist (Bereiche mit nur einer Wand oder die Wandreihenfolge Außen/Innen) oder wenn kein gestützter Weg nach innen gefunden werden kann, zum Beispiel an engen Ecken oder Nahtlücken." +"Verwendet die normale Reinigung, wo die Außenwand keine angrenzende innere Wand hat, etwa in Bereichen mit nur einer Wand, oder wenn kein gestützter Weg nach innen gefunden werden kann, zum Beispiel an engen Ecken oder Nahtlücken." # AI Translated msgid "Wipe inward distance" @@ -20079,11 +20079,15 @@ msgstr "Abstand für Reinigen nach innen" msgid "" "The distance the wipe path is shifted away from the external perimeter, specified in millimeters or as a percentage of the actual outer-wall extrusion width.\n" "\n" -"For example, 50% shifts the path by half of the outer-wall width. The effective offset is limited by both the actual outer-wall width and the available spacing to the adjacent wall, so values above 100% or an equivalent absolute distance have no additional effect. Set to 0 to disable the offset." +"For example, 50% shifts the path by half of the outer-wall width. The effective offset is limited by both the actual outer-wall width and the available spacing to the adjacent wall, so values above 100% or an equivalent absolute distance have no additional effect. Set to 0 to disable the offset.\n" +"\n" +"With Outer/Inner or Inner/Outer/Inner wall order, the offset is limited to 50% of the actual outer-wall width because the adjacent inner wall is printed after the outer wall. This also applies to equivalent distances specified in millimeters." msgstr "" "Der Abstand, um den der Reinigungsweg vom Außenperimeter weg verschoben wird, angegeben in Millimetern oder als Prozentsatz der tatsächlichen Extrusionsbreite der Außenwand.\n" "\n" -"Zum Beispiel verschiebt 50% den Weg um die halbe Außenwandbreite. Der wirksame Versatz wird sowohl durch die tatsächliche Außenwandbreite als auch durch den verfügbaren Abstand zur benachbarten Wand begrenzt, sodass Werte über 100% oder ein entsprechender absoluter Abstand keine zusätzliche Wirkung haben. Auf 0 setzen, um den Versatz zu deaktivieren." +"Zum Beispiel verschiebt 50% den Weg um die halbe Außenwandbreite. Der wirksame Versatz wird sowohl durch die tatsächliche Außenwandbreite als auch durch den verfügbaren Abstand zur benachbarten Wand begrenzt, sodass Werte über 100% oder ein entsprechender absoluter Abstand keine zusätzliche Wirkung haben. Auf 0 setzen, um den Versatz zu deaktivieren.\n" +"\n" +"Bei der Wandreihenfolge Außen/Innen oder Innen/Außen/Innen ist der Versatz auf 50% der tatsächlichen Außenwandbreite begrenzt, da die angrenzende innere Wand nach der Außenwand gedruckt wird. Dies gilt auch für entsprechende Abstände in Millimetern." msgid "Wipe before external loop" msgstr "Wischbewegung vor äußerer Schleife" @@ -24362,10 +24366,10 @@ msgid "Klipper version => 0.9.0" msgstr "Klipper Version => 0.9.0" msgid "" -"RepRap firmware version => 3.4.0\n" +"RepRapFirmware version => 3.4.0\n" "Check your firmware documentation for supported shaper types." msgstr "" -"RepRap-Firmware Version => 3.4.0\n" +"RepRapFirmware Version => 3.4.0\n" "Überprüfen Sie die Dokumentation Ihrer Firmware auf unterstützte Shaper-Typen." msgid "Frequency (Start / End): " @@ -24382,8 +24386,8 @@ msgstr "Y Start / Ende: " msgid "Frequency settings" msgstr "Frequenz Einstellungen" -msgid "RepRap firmware uses the same frequency range for both axes." -msgstr "RepRap-Firmware verwendet denselben Frequenzbereich für beide Achsen." +msgid "RepRapFirmware uses the same frequency range for both axes." +msgstr "RepRapFirmware verwendet denselben Frequenzbereich für beide Achsen." msgid "Damp: " msgstr "Dämpfung: " @@ -24422,8 +24426,8 @@ msgstr "Frequenz X / Y: " msgid "Damp (Start / End): " msgstr "Dämpfung (Start / Ende): " -msgid "RepRap firmware uses the same frequency for both axes." -msgstr "RepRap-Firmware verwendet dieselbe Frequenz für beide Achsen." +msgid "RepRapFirmware uses the same frequency for both axes." +msgstr "RepRapFirmware verwendet dieselbe Frequenz für beide Achsen." msgid "Note: Use previously calculated frequencies." msgstr "Hinweis: Verwenden Sie zuvor berechnete Frequenzen." diff --git a/localization/i18n/en/OrcaSlicer_en.po b/localization/i18n/en/OrcaSlicer_en.po index c4c7ecfe12..39df523c71 100644 --- a/localization/i18n/en/OrcaSlicer_en.po +++ b/localization/i18n/en/OrcaSlicer_en.po @@ -17743,11 +17743,11 @@ msgid "Wipe inward" msgstr "" msgid "" -"Applies only to external walls, including hole boundaries. Moves the hot nozzle toward printed inner walls during wiping to reduce reheating of freshly printed plastic and seam marks.\n" +"Applies only to external walls, including hole boundaries. Moves the hot nozzle toward the inner walls during wiping to reduce reheating of freshly printed plastic and seam marks.\n" "\n" "Especially useful at layer heights below 0.1 mm, where wipe marks are more visible.\n" "\n" -"Uses the regular wipe if no adjacent inner wall is already printed (single-wall areas or Outer/Inner wall order), or if no supported inward path can be found, for example at tight corners or seam gaps." +"Uses the regular wipe where the outer wall has no adjacent inner wall, such as in single-wall areas, or if no supported inward path can be found, for example at tight corners or seam gaps." msgstr "" msgid "Wipe inward distance" @@ -17757,7 +17757,9 @@ msgstr "" msgid "" "The distance the wipe path is shifted away from the external perimeter, specified in millimeters or as a percentage of the actual outer-wall extrusion width.\n" "\n" -"For example, 50% shifts the path by half of the outer-wall width. The effective offset is limited by both the actual outer-wall width and the available spacing to the adjacent wall, so values above 100% or an equivalent absolute distance have no additional effect. Set to 0 to disable the offset." +"For example, 50% shifts the path by half of the outer-wall width. The effective offset is limited by both the actual outer-wall width and the available spacing to the adjacent wall, so values above 100% or an equivalent absolute distance have no additional effect. Set to 0 to disable the offset.\n" +"\n" +"With Outer/Inner or Inner/Outer/Inner wall order, the offset is limited to 50% of the actual outer-wall width because the adjacent inner wall is printed after the outer wall. This also applies to equivalent distances specified in millimeters." msgstr "" msgid "Wipe before external loop" @@ -21374,7 +21376,7 @@ msgid "Klipper version => 0.9.0" msgstr "" msgid "" -"RepRap firmware version => 3.4.0\n" +"RepRapFirmware version => 3.4.0\n" "Check your firmware documentation for supported shaper types." msgstr "" @@ -21390,7 +21392,7 @@ msgstr "" msgid "Frequency settings" msgstr "" -msgid "RepRap firmware uses the same frequency range for both axes." +msgid "RepRapFirmware uses the same frequency range for both axes." msgstr "" msgid "Damp: " @@ -21424,7 +21426,7 @@ msgstr "" msgid "Damp (Start / End): " msgstr "" -msgid "RepRap firmware uses the same frequency for both axes." +msgid "RepRapFirmware uses the same frequency for both axes." msgstr "" msgid "Note: Use previously calculated frequencies." diff --git a/localization/i18n/es/OrcaSlicer_es.po b/localization/i18n/es/OrcaSlicer_es.po index 73218cc50e..735c0620a7 100644 --- a/localization/i18n/es/OrcaSlicer_es.po +++ b/localization/i18n/es/OrcaSlicer_es.po @@ -19646,17 +19646,17 @@ msgstr "Purgado hacia dentro" # AI Translated msgid "" -"Applies only to external walls, including hole boundaries. Moves the hot nozzle toward printed inner walls during wiping to reduce reheating of freshly printed plastic and seam marks.\n" +"Applies only to external walls, including hole boundaries. Moves the hot nozzle toward the inner walls during wiping to reduce reheating of freshly printed plastic and seam marks.\n" "\n" "Especially useful at layer heights below 0.1 mm, where wipe marks are more visible.\n" "\n" -"Uses the regular wipe if no adjacent inner wall is already printed (single-wall areas or Outer/Inner wall order), or if no supported inward path can be found, for example at tight corners or seam gaps." +"Uses the regular wipe where the outer wall has no adjacent inner wall, such as in single-wall areas, or if no supported inward path can be found, for example at tight corners or seam gaps." msgstr "" -"Se aplica solo a los perímetros externos, incluidos los contornos de los agujeros. Durante el purgado mueve la boquilla caliente hacia los perímetros internos ya impresos para reducir el recalentamiento del plástico recién depositado y las marcas de costura.\n" +"Se aplica solo a los perímetros externos, incluidos los contornos de los agujeros. Durante el purgado mueve la boquilla caliente hacia los perímetros internos para reducir el recalentamiento del plástico recién depositado y las marcas de costura.\n" "\n" "Es especialmente útil con alturas de capa por debajo de 0,1 mm, donde las marcas de purgado se ven más.\n" "\n" -"Usa el purgado normal si no hay ningún perímetro interno contiguo ya impreso (zonas de un solo perímetro u orden de perímetros Exterior/Interior) o si no se encuentra ninguna trayectoria hacia dentro con apoyo, por ejemplo en esquinas cerradas o huecos de costura." +"Usa el purgado normal donde el perímetro externo no tiene ningún perímetro interno contiguo, como en zonas de un solo perímetro, o si no se encuentra ninguna trayectoria hacia dentro con apoyo, por ejemplo en esquinas cerradas o huecos de costura." # AI Translated msgid "Wipe inward distance" @@ -19667,11 +19667,15 @@ msgstr "Distancia de purgado hacia dentro" msgid "" "The distance the wipe path is shifted away from the external perimeter, specified in millimeters or as a percentage of the actual outer-wall extrusion width.\n" "\n" -"For example, 50% shifts the path by half of the outer-wall width. The effective offset is limited by both the actual outer-wall width and the available spacing to the adjacent wall, so values above 100% or an equivalent absolute distance have no additional effect. Set to 0 to disable the offset." +"For example, 50% shifts the path by half of the outer-wall width. The effective offset is limited by both the actual outer-wall width and the available spacing to the adjacent wall, so values above 100% or an equivalent absolute distance have no additional effect. Set to 0 to disable the offset.\n" +"\n" +"With Outer/Inner or Inner/Outer/Inner wall order, the offset is limited to 50% of the actual outer-wall width because the adjacent inner wall is printed after the outer wall. This also applies to equivalent distances specified in millimeters." msgstr "" "Distancia que se desplaza la trayectoria de purgado alejándose del perímetro externo, indicada en milímetros o como porcentaje del ancho de extrusión real del perímetro externo.\n" "\n" -"Por ejemplo, 50% desplaza la trayectoria la mitad del ancho del perímetro externo. El desplazamiento efectivo está limitado tanto por el ancho real del perímetro externo como por el espacio disponible hasta el perímetro contiguo, por lo que valores por encima de 100% o una distancia absoluta equivalente no tienen ningún efecto adicional. Ponga 0 para desactivar el desplazamiento." +"Por ejemplo, 50% desplaza la trayectoria la mitad del ancho del perímetro externo. El desplazamiento efectivo está limitado tanto por el ancho real del perímetro externo como por el espacio disponible hasta el perímetro contiguo, por lo que valores por encima de 100% o una distancia absoluta equivalente no tienen ningún efecto adicional. Ponga 0 para desactivar el desplazamiento.\n" +"\n" +"Con el orden de perímetros Exterior/Interior o Interior/Exterior/Interior, el desplazamiento se limita al 50% del ancho real del perímetro externo, porque el perímetro interno contiguo se imprime después del perímetro externo. Esto también se aplica a las distancias equivalentes indicadas en milímetros." msgid "Wipe before external loop" msgstr "Purgado antes del bucle externo" @@ -23922,10 +23926,10 @@ msgid "Klipper version => 0.9.0" msgstr "Versión de Klipper => 0.9.0" msgid "" -"RepRap firmware version => 3.4.0\n" +"RepRapFirmware version => 3.4.0\n" "Check your firmware documentation for supported shaper types." msgstr "" -"RepRap firmware version => 3.4.0\n" +"RepRapFirmware version => 3.4.0\n" "Consulte la documentación del firmware para conocer los tipos de shaper compatibles." msgid "Frequency (Start / End): " @@ -23942,8 +23946,8 @@ msgstr "Y Inicio / Fin: " msgid "Frequency settings" msgstr "Ajustes de frecuencia" -msgid "RepRap firmware uses the same frequency range for both axes." -msgstr "El firmware RepRap utiliza el mismo rango de frecuencia para ambos ejes." +msgid "RepRapFirmware uses the same frequency range for both axes." +msgstr "El RepRapFirmware utiliza el mismo rango de frecuencia para ambos ejes." msgid "Damp: " msgstr "Amortiguación: " @@ -23982,8 +23986,8 @@ msgstr "Frecuencia X / Y: " msgid "Damp (Start / End): " msgstr "Amortiguación (Inicio / Fin): " -msgid "RepRap firmware uses the same frequency for both axes." -msgstr "El firmware RepRap utiliza la misma frecuencia para ambos ejes." +msgid "RepRapFirmware uses the same frequency for both axes." +msgstr "El RepRapFirmware utiliza la misma frecuencia para ambos ejes." msgid "Note: Use previously calculated frequencies." msgstr "Nota: Utilice las frecuencias calculadas previamente." diff --git a/localization/i18n/eu/OrcaSlicer_eu.po b/localization/i18n/eu/OrcaSlicer_eu.po index 76abdac722..6dee1070aa 100644 --- a/localization/i18n/eu/OrcaSlicer_eu.po +++ b/localization/i18n/eu/OrcaSlicer_eu.po @@ -19853,17 +19853,17 @@ msgstr "Garbitu barrurantz" # AI Translated msgid "" -"Applies only to external walls, including hole boundaries. Moves the hot nozzle toward printed inner walls during wiping to reduce reheating of freshly printed plastic and seam marks.\n" +"Applies only to external walls, including hole boundaries. Moves the hot nozzle toward the inner walls during wiping to reduce reheating of freshly printed plastic and seam marks.\n" "\n" "Especially useful at layer heights below 0.1 mm, where wipe marks are more visible.\n" "\n" -"Uses the regular wipe if no adjacent inner wall is already printed (single-wall areas or Outer/Inner wall order), or if no supported inward path can be found, for example at tight corners or seam gaps." +"Uses the regular wipe where the outer wall has no adjacent inner wall, such as in single-wall areas, or if no supported inward path can be found, for example at tight corners or seam gaps." msgstr "" -"Kanpoko hormei soilik aplikatzen zaie, zuloen mugak barne. Garbitzean pita beroa jada inprimatutako barruko hormetarantz mugitzen du, inprimatu berri den plastikoa berriro berotzea eta jostura-markak murrizteko.\n" +"Kanpoko hormei soilik aplikatzen zaie, zuloen mugak barne. Garbitzean pita beroa barruko hormetarantz mugitzen du, inprimatu berri den plastikoa berriro berotzea eta jostura-markak murrizteko.\n" "\n" "Bereziki erabilgarria da 0,1 mm-tik beherako geruza-altueretan, non garbiketa-markak nabarmenago ikusten diren.\n" "\n" -"Garbiketa arrunta erabiltzen du ondoko barruko hormarik jada inprimatuta ez badago (horma bakarreko eremuak edo Kanpokoa/Barrukoa hormen ordena) edo euskarria duen barrurako biderik aurkitzen ez bada, adibidez izkina estuetan edo josturako hutsuneetan." +"Garbiketa arrunta erabiltzen du kanpoko hormak ondoan barruko hormarik ez duen lekuetan, hala nola horma bakarreko eremuetan, edo euskarria duen barrurako biderik aurkitzen ez bada, adibidez izkina estuetan edo josturako hutsuneetan." # AI Translated msgid "Wipe inward distance" @@ -19874,11 +19874,15 @@ msgstr "Barrurako garbiketa-distantzia" msgid "" "The distance the wipe path is shifted away from the external perimeter, specified in millimeters or as a percentage of the actual outer-wall extrusion width.\n" "\n" -"For example, 50% shifts the path by half of the outer-wall width. The effective offset is limited by both the actual outer-wall width and the available spacing to the adjacent wall, so values above 100% or an equivalent absolute distance have no additional effect. Set to 0 to disable the offset." +"For example, 50% shifts the path by half of the outer-wall width. The effective offset is limited by both the actual outer-wall width and the available spacing to the adjacent wall, so values above 100% or an equivalent absolute distance have no additional effect. Set to 0 to disable the offset.\n" +"\n" +"With Outer/Inner or Inner/Outer/Inner wall order, the offset is limited to 50% of the actual outer-wall width because the adjacent inner wall is printed after the outer wall. This also applies to equivalent distances specified in millimeters." msgstr "" "Garbiketa-ibilbidea kanpoko perimetrotik zenbat desplazatzen den, milimetrotan edo kanpoko hormaren benetako estrusio-zabaleraren ehuneko gisa adierazita.\n" "\n" -"Adibidez, 50% ibilbideak kanpoko hormaren zabaleraren erdia desplazatzen du. Desplazamendu eraginkorra mugatuta dago bai kanpoko hormaren benetako zabaleragatik bai ondoko hormarainoko tarte erabilgarriagatik; beraz, 100% baino handiagoko balioek edo baliokidea den distantzia absolutu batek ez dute eragin gehigarririk. Ezarri 0 desplazamendua desgaitzeko." +"Adibidez, 50% ibilbideak kanpoko hormaren zabaleraren erdia desplazatzen du. Desplazamendu eraginkorra mugatuta dago bai kanpoko hormaren benetako zabaleragatik bai ondoko hormarainoko tarte erabilgarriagatik; beraz, 100% baino handiagoko balioek edo baliokidea den distantzia absolutu batek ez dute eragin gehigarririk. Ezarri 0 desplazamendua desgaitzeko.\n" +"\n" +"Kanpokoa/Barrukoa edo Barrukoa/Kanpokoa/Barrukoa hormen ordenarekin, desplazamendua gehienez kanpoko hormaren benetako zabaleraren 50% izan daiteke, ondoko barruko horma kanpoko hormaren ondoren inprimatzen delako. Hori milimetrotan adierazitako distantzia baliokideei ere aplikatzen zaie." msgid "Wipe before external loop" msgstr "Garbitu kanpoko begizta baino lehen" @@ -24141,10 +24145,10 @@ msgid "Klipper version => 0.9.0" msgstr "Klipper bertsioa => 0.9.0" msgid "" -"RepRap firmware version => 3.4.0\n" +"RepRapFirmware version => 3.4.0\n" "Check your firmware documentation for supported shaper types." msgstr "" -"RepRap firmwarearen bertsioa => 3.4.0\n" +"RepRapFirmware bertsioa => 3.4.0\n" "Begiratu zure firmwarearen dokumentazioa onartutako moldatzaile motak ezagutzeko." msgid "Frequency (Start / End): " @@ -24161,8 +24165,8 @@ msgstr "Y hasiera / amaiera: " msgid "Frequency settings" msgstr "Maiztasun-ezarpenak" -msgid "RepRap firmware uses the same frequency range for both axes." -msgstr "RepRap firmwareak maiztasun-tarte bera erabiltzen du bi ardatzetarako." +msgid "RepRapFirmware uses the same frequency range for both axes." +msgstr "RepRapFirmware maiztasun-tarte bera erabiltzen du bi ardatzetarako." msgid "Damp: " msgstr "Moteltzea: " @@ -24201,8 +24205,8 @@ msgstr "Maiztasuna X / Y: " msgid "Damp (Start / End): " msgstr "Moteltzea (hasiera / amaiera): " -msgid "RepRap firmware uses the same frequency for both axes." -msgstr "RepRap firmwareak maiztasun bera erabiltzen du bi ardatzetarako." +msgid "RepRapFirmware uses the same frequency for both axes." +msgstr "RepRapFirmware maiztasun bera erabiltzen du bi ardatzetarako." msgid "Note: Use previously calculated frequencies." msgstr "Oharra: erabili aurrez kalkulatutako maiztasunak." diff --git a/localization/i18n/fr/OrcaSlicer_fr.po b/localization/i18n/fr/OrcaSlicer_fr.po index 3b5f3cb53e..90b7bfc7ce 100644 --- a/localization/i18n/fr/OrcaSlicer_fr.po +++ b/localization/i18n/fr/OrcaSlicer_fr.po @@ -19839,17 +19839,17 @@ msgstr "Essuyage vers l'intérieur" # AI Translated msgid "" -"Applies only to external walls, including hole boundaries. Moves the hot nozzle toward printed inner walls during wiping to reduce reheating of freshly printed plastic and seam marks.\n" +"Applies only to external walls, including hole boundaries. Moves the hot nozzle toward the inner walls during wiping to reduce reheating of freshly printed plastic and seam marks.\n" "\n" "Especially useful at layer heights below 0.1 mm, where wipe marks are more visible.\n" "\n" -"Uses the regular wipe if no adjacent inner wall is already printed (single-wall areas or Outer/Inner wall order), or if no supported inward path can be found, for example at tight corners or seam gaps." +"Uses the regular wipe where the outer wall has no adjacent inner wall, such as in single-wall areas, or if no supported inward path can be found, for example at tight corners or seam gaps." msgstr "" -"S'applique uniquement aux parois extérieures, contours des trous compris. Déplace la buse chaude vers les parois intérieures déjà imprimées pendant l'essuyage, afin de limiter le réchauffement du plastique fraîchement déposé et les marques de couture.\n" +"S'applique uniquement aux parois extérieures, contours des trous compris. Déplace la buse chaude vers les parois intérieures pendant l'essuyage, afin de limiter le réchauffement du plastique fraîchement déposé et les marques de couture.\n" "\n" "Particulièrement utile pour des hauteurs de couche inférieures à 0,1 mm, où les marques d'essuyage sont plus visibles.\n" "\n" -"Utilise l'essuyage normal si aucune paroi intérieure adjacente n'est déjà imprimée (zones à paroi unique ou ordre des parois Extérieur/Intérieur), ou si aucun chemin vers l'intérieur soutenu n'est trouvé, par exemple dans les angles serrés ou aux interruptions de couture." +"Utilise l'essuyage normal là où la paroi extérieure n'a pas de paroi intérieure adjacente, comme dans les zones à paroi unique, ou si aucun chemin vers l'intérieur soutenu n'est trouvé, par exemple dans les angles serrés ou aux interruptions de couture." # AI Translated msgid "Wipe inward distance" @@ -19860,11 +19860,15 @@ msgstr "Distance d'essuyage vers l'intérieur" msgid "" "The distance the wipe path is shifted away from the external perimeter, specified in millimeters or as a percentage of the actual outer-wall extrusion width.\n" "\n" -"For example, 50% shifts the path by half of the outer-wall width. The effective offset is limited by both the actual outer-wall width and the available spacing to the adjacent wall, so values above 100% or an equivalent absolute distance have no additional effect. Set to 0 to disable the offset." +"For example, 50% shifts the path by half of the outer-wall width. The effective offset is limited by both the actual outer-wall width and the available spacing to the adjacent wall, so values above 100% or an equivalent absolute distance have no additional effect. Set to 0 to disable the offset.\n" +"\n" +"With Outer/Inner or Inner/Outer/Inner wall order, the offset is limited to 50% of the actual outer-wall width because the adjacent inner wall is printed after the outer wall. This also applies to equivalent distances specified in millimeters." msgstr "" "Distance dont le chemin d'essuyage est décalé par rapport au périmètre extérieur, exprimée en millimètres ou en pourcentage de la largeur d'extrusion réelle de la paroi extérieure.\n" "\n" -"Par exemple, 50% décale le chemin de la moitié de la largeur de la paroi extérieure. Le décalage effectif est limité à la fois par la largeur réelle de la paroi extérieure et par l'espace disponible jusqu'à la paroi adjacente : les valeurs supérieures à 100% ou une distance absolue équivalente n'ont donc aucun effet supplémentaire. Mettez 0 pour désactiver le décalage." +"Par exemple, 50% décale le chemin de la moitié de la largeur de la paroi extérieure. Le décalage effectif est limité à la fois par la largeur réelle de la paroi extérieure et par l'espace disponible jusqu'à la paroi adjacente : les valeurs supérieures à 100% ou une distance absolue équivalente n'ont donc aucun effet supplémentaire. Mettez 0 pour désactiver le décalage.\n" +"\n" +"Avec l'ordre des parois Extérieur/Intérieur ou Intérieur/Extérieur/Intérieur, le décalage est limité à 50% de la largeur réelle de la paroi extérieure, car la paroi intérieure adjacente est imprimée après la paroi extérieure. Cela s'applique aussi aux distances équivalentes exprimées en millimètres." msgid "Wipe before external loop" msgstr "Essuyer avant la boucle externe" @@ -24132,10 +24136,10 @@ msgid "Klipper version => 0.9.0" msgstr "Version Klipper => 0.9.0" msgid "" -"RepRap firmware version => 3.4.0\n" +"RepRapFirmware version => 3.4.0\n" "Check your firmware documentation for supported shaper types." msgstr "" -"RepRap firmware version => 3.4.0\n" +"RepRapFirmware version => 3.4.0\n" "Consultez la documentation de votre firmware pour les types de compensateur pris en charge." msgid "Frequency (Start / End): " @@ -24152,8 +24156,8 @@ msgstr "Y Début / Fin : " msgid "Frequency settings" msgstr "Paramètres de fréquence" -msgid "RepRap firmware uses the same frequency range for both axes." -msgstr "Le firmware RepRap utilise la même plage de fréquence pour les deux axes." +msgid "RepRapFirmware uses the same frequency range for both axes." +msgstr "Le RepRapFirmware utilise la même plage de fréquence pour les deux axes." msgid "Damp: " msgstr "Amortissement : " @@ -24192,8 +24196,8 @@ msgstr "Fréquence X / Y : " msgid "Damp (Start / End): " msgstr "Amortissement (début / fin) : " -msgid "RepRap firmware uses the same frequency for both axes." -msgstr "Le firmware RepRap utilise la même fréquence pour les deux axes." +msgid "RepRapFirmware uses the same frequency for both axes." +msgstr "Le RepRapFirmware utilise la même fréquence pour les deux axes." msgid "Note: Use previously calculated frequencies." msgstr "Note : Utiliser les fréquences précédemment calculées." diff --git a/localization/i18n/hu/OrcaSlicer_hu.po b/localization/i18n/hu/OrcaSlicer_hu.po index 71bd4e658c..8bd9d9a9a5 100644 --- a/localization/i18n/hu/OrcaSlicer_hu.po +++ b/localization/i18n/hu/OrcaSlicer_hu.po @@ -20275,17 +20275,17 @@ msgstr "Törlés befelé" # AI Translated msgid "" -"Applies only to external walls, including hole boundaries. Moves the hot nozzle toward printed inner walls during wiping to reduce reheating of freshly printed plastic and seam marks.\n" +"Applies only to external walls, including hole boundaries. Moves the hot nozzle toward the inner walls during wiping to reduce reheating of freshly printed plastic and seam marks.\n" "\n" "Especially useful at layer heights below 0.1 mm, where wipe marks are more visible.\n" "\n" -"Uses the regular wipe if no adjacent inner wall is already printed (single-wall areas or Outer/Inner wall order), or if no supported inward path can be found, for example at tight corners or seam gaps." +"Uses the regular wipe where the outer wall has no adjacent inner wall, such as in single-wall areas, or if no supported inward path can be found, for example at tight corners or seam gaps." msgstr "" -"Csak a külső falakra vonatkozik, beleértve a furatok kontúrjait is. Törlés közben a forró fúvókát a már kinyomtatott belső falak felé mozgatja, hogy csökkentse a frissen nyomtatott műanyag újramelegedését és a varratnyomokat.\n" +"Csak a külső falakra vonatkozik, beleértve a furatok kontúrjait is. Törlés közben a forró fúvókát a belső falak felé mozgatja, hogy csökkentse a frissen nyomtatott műanyag újramelegedését és a varratnyomokat.\n" "\n" "Különösen hasznos 0,1 mm alatti rétegmagasságnál, ahol a törlésnyomok jobban látszanak.\n" "\n" -"A szokásos törlést használja, ha nincs még kinyomtatott szomszédos belső fal (egyfalú területek vagy Külső/Belső falsorrend), illetve ha nem található alátámasztott befelé vezető útvonal, például szűk sarkoknál vagy varrathézagoknál." +"A szokásos törlést használja ott, ahol a külső falnak nincs szomszédos belső fala, mint az egyfalú területeken, illetve ha nem található alátámasztott befelé vezető útvonal, például szűk sarkoknál vagy varrathézagoknál." # AI Translated msgid "Wipe inward distance" @@ -20296,11 +20296,15 @@ msgstr "Törlés befelé távolsága" msgid "" "The distance the wipe path is shifted away from the external perimeter, specified in millimeters or as a percentage of the actual outer-wall extrusion width.\n" "\n" -"For example, 50% shifts the path by half of the outer-wall width. The effective offset is limited by both the actual outer-wall width and the available spacing to the adjacent wall, so values above 100% or an equivalent absolute distance have no additional effect. Set to 0 to disable the offset." +"For example, 50% shifts the path by half of the outer-wall width. The effective offset is limited by both the actual outer-wall width and the available spacing to the adjacent wall, so values above 100% or an equivalent absolute distance have no additional effect. Set to 0 to disable the offset.\n" +"\n" +"With Outer/Inner or Inner/Outer/Inner wall order, the offset is limited to 50% of the actual outer-wall width because the adjacent inner wall is printed after the outer wall. This also applies to equivalent distances specified in millimeters." msgstr "" "Az a távolság, amennyivel a törlési útvonal eltolódik a külső kerülettől, milliméterben vagy a külső fal tényleges extrudálási szélességének százalékában megadva.\n" "\n" -"Például az 50% a külső fal szélességének felével tolja el az útvonalat. A tényleges eltolást korlátozza a külső fal tényleges szélessége és a szomszédos falig rendelkezésre álló hely is, ezért a 100% feletti értékeknek vagy az ezzel egyenértékű abszolút távolságnak nincs további hatása. Az eltolás kikapcsolásához állítsd 0-ra." +"Például az 50% a külső fal szélességének felével tolja el az útvonalat. A tényleges eltolást korlátozza a külső fal tényleges szélessége és a szomszédos falig rendelkezésre álló hely is, ezért a 100% feletti értékeknek vagy az ezzel egyenértékű abszolút távolságnak nincs további hatása. Az eltolás kikapcsolásához állítsd 0-ra.\n" +"\n" +"Külső/Belső vagy Belső/Külső/Belső falsorrend esetén az eltolás legfeljebb a külső fal tényleges szélességének 50%-a lehet, mert a szomszédos belső fal a külső fal után nyomtatódik. Ez a milliméterben megadott egyenértékű távolságokra is vonatkozik." msgid "Wipe before external loop" msgstr "Törlés a külső hurok előtt" @@ -24606,10 +24610,10 @@ msgid "Klipper version => 0.9.0" msgstr "Klipper verzió => 0.9.0" msgid "" -"RepRap firmware version => 3.4.0\n" +"RepRapFirmware version => 3.4.0\n" "Check your firmware documentation for supported shaper types." msgstr "" -"RepRap firmware-verzió => 3.4.0\n" +"RepRapFirmware-verzió => 3.4.0\n" "Ellenőrizd a firmware dokumentációját a támogatott rezgéskompenzátor-típusokhoz." msgid "Frequency (Start / End): " @@ -24626,8 +24630,8 @@ msgstr "Y Kezdés / Vég: " msgid "Frequency settings" msgstr "Frekvenciabeállítások" -msgid "RepRap firmware uses the same frequency range for both axes." -msgstr "A RepRap firmware mindkét tengelyhez ugyanazt a frekvenciatartományt használja." +msgid "RepRapFirmware uses the same frequency range for both axes." +msgstr "A RepRapFirmware mindkét tengelyhez ugyanazt a frekvenciatartományt használja." msgid "Damp: " msgstr "Csillapítás: " @@ -24666,8 +24670,8 @@ msgstr "Frekvencia X / Y: " msgid "Damp (Start / End): " msgstr "Csillapítás (kezdés / vég): " -msgid "RepRap firmware uses the same frequency for both axes." -msgstr "A RepRap firmware mindkét tengelyhez ugyanazt a frekvenciát használja." +msgid "RepRapFirmware uses the same frequency for both axes." +msgstr "A RepRapFirmware mindkét tengelyhez ugyanazt a frekvenciát használja." msgid "Note: Use previously calculated frequencies." msgstr "Megjegyzés: Használd a korábban kiszámított frekvenciákat." diff --git a/localization/i18n/it/OrcaSlicer_it.po b/localization/i18n/it/OrcaSlicer_it.po index f623ed0de7..3c5f9ec0a2 100644 --- a/localization/i18n/it/OrcaSlicer_it.po +++ b/localization/i18n/it/OrcaSlicer_it.po @@ -20163,17 +20163,17 @@ msgstr "Spurgo verso l'interno" # AI Translated msgid "" -"Applies only to external walls, including hole boundaries. Moves the hot nozzle toward printed inner walls during wiping to reduce reheating of freshly printed plastic and seam marks.\n" +"Applies only to external walls, including hole boundaries. Moves the hot nozzle toward the inner walls during wiping to reduce reheating of freshly printed plastic and seam marks.\n" "\n" "Especially useful at layer heights below 0.1 mm, where wipe marks are more visible.\n" "\n" -"Uses the regular wipe if no adjacent inner wall is already printed (single-wall areas or Outer/Inner wall order), or if no supported inward path can be found, for example at tight corners or seam gaps." +"Uses the regular wipe where the outer wall has no adjacent inner wall, such as in single-wall areas, or if no supported inward path can be found, for example at tight corners or seam gaps." msgstr "" -"Si applica solo alle pareti esterne, inclusi i contorni dei fori. Durante lo spurgo sposta l'ugello caldo verso le pareti interne già stampate, per ridurre il riscaldamento della plastica appena depositata e i segni di cucitura.\n" +"Si applica solo alle pareti esterne, inclusi i contorni dei fori. Durante lo spurgo sposta l'ugello caldo verso le pareti interne, per ridurre il riscaldamento della plastica appena depositata e i segni di cucitura.\n" "\n" "Particolarmente utile con altezze strato inferiori a 0,1 mm, dove i segni di spurgo sono più visibili.\n" "\n" -"Usa lo spurgo normale se nessuna parete interna adiacente è già stata stampata (zone a parete singola oppure ordine delle pareti Esterna/Interna) o se non si trova un percorso verso l'interno che sia supportato, ad esempio in angoli stretti o in corrispondenza di interruzioni della cucitura." +"Usa lo spurgo normale dove la parete esterna non ha una parete interna adiacente, come nelle zone a parete singola, o se non si trova un percorso verso l'interno che sia supportato, ad esempio in angoli stretti o in corrispondenza di interruzioni della cucitura." # AI Translated msgid "Wipe inward distance" @@ -20184,11 +20184,15 @@ msgstr "Distanza di spurgo verso l'interno" msgid "" "The distance the wipe path is shifted away from the external perimeter, specified in millimeters or as a percentage of the actual outer-wall extrusion width.\n" "\n" -"For example, 50% shifts the path by half of the outer-wall width. The effective offset is limited by both the actual outer-wall width and the available spacing to the adjacent wall, so values above 100% or an equivalent absolute distance have no additional effect. Set to 0 to disable the offset." +"For example, 50% shifts the path by half of the outer-wall width. The effective offset is limited by both the actual outer-wall width and the available spacing to the adjacent wall, so values above 100% or an equivalent absolute distance have no additional effect. Set to 0 to disable the offset.\n" +"\n" +"With Outer/Inner or Inner/Outer/Inner wall order, the offset is limited to 50% of the actual outer-wall width because the adjacent inner wall is printed after the outer wall. This also applies to equivalent distances specified in millimeters." msgstr "" "Distanza di cui il percorso di spurgo viene spostato rispetto al perimetro esterno, espressa in millimetri o in percentuale della larghezza di estrusione effettiva della parete esterna.\n" "\n" -"Ad esempio, 50% sposta il percorso di metà della larghezza della parete esterna. Lo spostamento effettivo è limitato sia dalla larghezza effettiva della parete esterna sia dallo spazio disponibile fino alla parete adiacente, perciò valori superiori a 100% o una distanza assoluta equivalente non hanno alcun effetto aggiuntivo. Imposta 0 per disattivare lo spostamento." +"Ad esempio, 50% sposta il percorso di metà della larghezza della parete esterna. Lo spostamento effettivo è limitato sia dalla larghezza effettiva della parete esterna sia dallo spazio disponibile fino alla parete adiacente, perciò valori superiori a 100% o una distanza assoluta equivalente non hanno alcun effetto aggiuntivo. Imposta 0 per disattivare lo spostamento.\n" +"\n" +"Con l'ordine delle pareti Esterna/Interna o Interna/Esterna/Interna, lo spostamento è limitato al 50% della larghezza effettiva della parete esterna, perché la parete interna adiacente viene stampata dopo la parete esterna. Questo vale anche per le distanze equivalenti espresse in millimetri." msgid "Wipe before external loop" msgstr "Spurgo prima del perimetro esterno" @@ -24472,10 +24476,10 @@ msgid "Klipper version => 0.9.0" msgstr "Versione Klipper => 0.9.0" msgid "" -"RepRap firmware version => 3.4.0\n" +"RepRapFirmware version => 3.4.0\n" "Check your firmware documentation for supported shaper types." msgstr "" -"Versione firmware RepRap => 3.4.0\n" +"Versione RepRapFirmware => 3.4.0\n" "Controllare la documentazione del firmware per i tipi di shaper supportati." msgid "Frequency (Start / End): " @@ -24492,8 +24496,8 @@ msgstr "Y Inizio / Fine: " msgid "Frequency settings" msgstr "Impostazioni frequenza" -msgid "RepRap firmware uses the same frequency range for both axes." -msgstr "Il firmware RepRap utilizza lo stesso intervallo di frequenza per entrambi gli assi." +msgid "RepRapFirmware uses the same frequency range for both axes." +msgstr "Il RepRapFirmware utilizza lo stesso intervallo di frequenza per entrambi gli assi." msgid "Damp: " msgstr "Smorzamento: " @@ -24532,8 +24536,8 @@ msgstr "Frequenza X / Y: " msgid "Damp (Start / End): " msgstr "Smorzamento (Inizio / Fine): " -msgid "RepRap firmware uses the same frequency for both axes." -msgstr "Il firmware RepRap utilizza la stessa frequenza per entrambi gli assi." +msgid "RepRapFirmware uses the same frequency for both axes." +msgstr "Il RepRapFirmware utilizza la stessa frequenza per entrambi gli assi." msgid "Note: Use previously calculated frequencies." msgstr "Nota: usa le frequenze calcolate in precedenza." diff --git a/localization/i18n/ja/OrcaSlicer_ja.po b/localization/i18n/ja/OrcaSlicer_ja.po index 12ee4cfb61..99fe434d1f 100644 --- a/localization/i18n/ja/OrcaSlicer_ja.po +++ b/localization/i18n/ja/OrcaSlicer_ja.po @@ -21163,17 +21163,17 @@ msgstr "内側へ拭き上げ" # AI Translated msgid "" -"Applies only to external walls, including hole boundaries. Moves the hot nozzle toward printed inner walls during wiping to reduce reheating of freshly printed plastic and seam marks.\n" +"Applies only to external walls, including hole boundaries. Moves the hot nozzle toward the inner walls during wiping to reduce reheating of freshly printed plastic and seam marks.\n" "\n" "Especially useful at layer heights below 0.1 mm, where wipe marks are more visible.\n" "\n" -"Uses the regular wipe if no adjacent inner wall is already printed (single-wall areas or Outer/Inner wall order), or if no supported inward path can be found, for example at tight corners or seam gaps." +"Uses the regular wipe where the outer wall has no adjacent inner wall, such as in single-wall areas, or if no supported inward path can be found, for example at tight corners or seam gaps." msgstr "" -"穴の輪郭を含む外壁にのみ適用されます。拭き上げ中に高温のノズルを造形済みの内壁へ向かって動かし、造形したばかりの樹脂の再加熱と継ぎ目の跡を抑えます。\n" +"穴の輪郭を含む外壁にのみ適用されます。拭き上げ中に高温のノズルを内壁へ向かって動かし、造形したばかりの樹脂の再加熱と継ぎ目の跡を抑えます。\n" "\n" "拭き上げの跡が目立ちやすい積層ピッチ0.1 mm未満で特に有効です。\n" "\n" -"隣接する内壁がまだ造形されていない場合(壁が1本のみの領域や、壁の順序が外側/内側の場合)、または細かい角や継ぎ目の隙間などで支えのある内向きの経路が見つからない場合は、通常の拭き上げを使用します。" +"壁が1本のみの領域など、外壁に隣接する内壁がない場所や、細かい角や継ぎ目の隙間などで支えのある内向きの経路が見つからない場合は、通常の拭き上げを使用します。" # AI Translated msgid "Wipe inward distance" @@ -21184,11 +21184,15 @@ msgstr "内側への拭き上げ距離" msgid "" "The distance the wipe path is shifted away from the external perimeter, specified in millimeters or as a percentage of the actual outer-wall extrusion width.\n" "\n" -"For example, 50% shifts the path by half of the outer-wall width. The effective offset is limited by both the actual outer-wall width and the available spacing to the adjacent wall, so values above 100% or an equivalent absolute distance have no additional effect. Set to 0 to disable the offset." +"For example, 50% shifts the path by half of the outer-wall width. The effective offset is limited by both the actual outer-wall width and the available spacing to the adjacent wall, so values above 100% or an equivalent absolute distance have no additional effect. Set to 0 to disable the offset.\n" +"\n" +"With Outer/Inner or Inner/Outer/Inner wall order, the offset is limited to 50% of the actual outer-wall width because the adjacent inner wall is printed after the outer wall. This also applies to equivalent distances specified in millimeters." msgstr "" "拭き上げ経路を外周から離す距離で、ミリメートルまたは実際の外壁の押出線幅に対する割合で指定します。\n" "\n" -"例えば50%では、経路を外壁幅の半分だけずらします。実効オフセットは実際の外壁幅と隣接する壁までの利用可能な間隔の両方で制限されるため、100%を超える値や同等の絶対距離を指定しても追加の効果はありません。0に設定するとオフセットは無効になります。" +"例えば50%では、経路を外壁幅の半分だけずらします。実効オフセットは実際の外壁幅と隣接する壁までの利用可能な間隔の両方で制限されるため、100%を超える値や同等の絶対距離を指定しても追加の効果はありません。0に設定するとオフセットは無効になります。\n" +"\n" +"壁の順序が外側/内側または内側/外側/内側の場合、隣接する内壁は外壁の後に造形されるため、オフセットは実際の外壁幅の50%までに制限されます。ミリメートルで指定した同等の距離にも適用されます。" # AI Translated msgid "Wipe before external loop" @@ -25828,7 +25832,7 @@ msgstr "Klipperバージョン => 0.9.0" # AI Translated msgid "" -"RepRap firmware version => 3.4.0\n" +"RepRapFirmware version => 3.4.0\n" "Check your firmware documentation for supported shaper types." msgstr "" "RepRapファームウェアバージョン => 3.4.0\n" @@ -25849,7 +25853,7 @@ msgid "Frequency settings" msgstr "周波数設定" # AI Translated -msgid "RepRap firmware uses the same frequency range for both axes." +msgid "RepRapFirmware uses the same frequency range for both axes." msgstr "RepRapファームウェアは両軸に同じ周波数範囲を使用します。" # AI Translated @@ -25898,7 +25902,7 @@ msgid "Damp (Start / End): " msgstr "減衰 (開始/終了): " # AI Translated -msgid "RepRap firmware uses the same frequency for both axes." +msgid "RepRapFirmware uses the same frequency for both axes." msgstr "RepRapファームウェアは両軸に同じ周波数を使用します。" # AI Translated diff --git a/localization/i18n/ko/OrcaSlicer_ko.po b/localization/i18n/ko/OrcaSlicer_ko.po index e352c926ce..3cca49fe27 100644 --- a/localization/i18n/ko/OrcaSlicer_ko.po +++ b/localization/i18n/ko/OrcaSlicer_ko.po @@ -20566,17 +20566,17 @@ msgstr "안쪽으로 노즐 청소" # AI Translated msgid "" -"Applies only to external walls, including hole boundaries. Moves the hot nozzle toward printed inner walls during wiping to reduce reheating of freshly printed plastic and seam marks.\n" +"Applies only to external walls, including hole boundaries. Moves the hot nozzle toward the inner walls during wiping to reduce reheating of freshly printed plastic and seam marks.\n" "\n" "Especially useful at layer heights below 0.1 mm, where wipe marks are more visible.\n" "\n" -"Uses the regular wipe if no adjacent inner wall is already printed (single-wall areas or Outer/Inner wall order), or if no supported inward path can be found, for example at tight corners or seam gaps." +"Uses the regular wipe where the outer wall has no adjacent inner wall, such as in single-wall areas, or if no supported inward path can be found, for example at tight corners or seam gaps." msgstr "" -"구멍 경계를 포함한 외벽에만 적용됩니다. 노즐 청소 중 뜨거운 노즐을 이미 출력된 내벽 쪽으로 이동시켜, 갓 출력된 플라스틱의 재가열과 재봉선 자국을 줄입니다.\n" +"구멍 경계를 포함한 외벽에만 적용됩니다. 노즐 청소 중 뜨거운 노즐을 내벽 쪽으로 이동시켜, 갓 출력된 플라스틱의 재가열과 재봉선 자국을 줄입니다.\n" "\n" "청소 자국이 더 잘 보이는 0.1 mm 미만의 레이어 높이에서 특히 유용합니다.\n" "\n" -"인접한 내벽이 아직 출력되지 않았거나(벽이 하나뿐인 영역 또는 외벽/내벽 순서), 좁은 모서리나 재봉선 간격 등에서 지지되는 안쪽 경로를 찾을 수 없는 경우에는 일반 노즐 청소를 사용합니다." +"벽이 하나뿐인 영역처럼 외벽에 인접한 내벽이 없는 곳이나, 좁은 모서리나 재봉선 간격 등에서 지지되는 안쪽 경로를 찾을 수 없는 경우에는 일반 노즐 청소를 사용합니다." # AI Translated msgid "Wipe inward distance" @@ -20587,11 +20587,15 @@ msgstr "안쪽 노즐 청소 거리" msgid "" "The distance the wipe path is shifted away from the external perimeter, specified in millimeters or as a percentage of the actual outer-wall extrusion width.\n" "\n" -"For example, 50% shifts the path by half of the outer-wall width. The effective offset is limited by both the actual outer-wall width and the available spacing to the adjacent wall, so values above 100% or an equivalent absolute distance have no additional effect. Set to 0 to disable the offset." +"For example, 50% shifts the path by half of the outer-wall width. The effective offset is limited by both the actual outer-wall width and the available spacing to the adjacent wall, so values above 100% or an equivalent absolute distance have no additional effect. Set to 0 to disable the offset.\n" +"\n" +"With Outer/Inner or Inner/Outer/Inner wall order, the offset is limited to 50% of the actual outer-wall width because the adjacent inner wall is printed after the outer wall. This also applies to equivalent distances specified in millimeters." msgstr "" "노즐 청소 경로를 외곽 둘레에서 밀어내는 거리로, 밀리미터 또는 실제 외벽 압출 너비에 대한 백분율로 지정합니다.\n" "\n" -"예를 들어 50%는 경로를 외벽 너비의 절반만큼 이동시킵니다. 실제 오프셋은 실제 외벽 너비와 인접한 벽까지의 여유 간격 모두에 의해 제한되므로, 100%를 넘는 값이나 그에 상응하는 절대 거리를 지정해도 추가 효과가 없습니다. 오프셋을 끄려면 0으로 설정하세요." +"예를 들어 50%는 경로를 외벽 너비의 절반만큼 이동시킵니다. 실제 오프셋은 실제 외벽 너비와 인접한 벽까지의 여유 간격 모두에 의해 제한되므로, 100%를 넘는 값이나 그에 상응하는 절대 거리를 지정해도 추가 효과가 없습니다. 오프셋을 끄려면 0으로 설정하세요.\n" +"\n" +"벽 출력 순서가 외벽/내벽 또는 내벽/외벽/내벽이면 인접한 내벽이 외벽보다 나중에 출력되므로, 오프셋은 실제 외벽 너비의 50%로 제한됩니다. 밀리미터로 지정한 상응하는 거리에도 적용됩니다." msgid "Wipe before external loop" msgstr "외부 루프 전 닦아내기" @@ -24962,7 +24966,7 @@ msgstr "Klipper 버전 => 0.9.0" # AI Translated msgid "" -"RepRap firmware version => 3.4.0\n" +"RepRapFirmware version => 3.4.0\n" "Check your firmware documentation for supported shaper types." msgstr "" "RepRap 펌웨어 버전 => 3.4.0\n" @@ -24985,7 +24989,7 @@ msgid "Frequency settings" msgstr "주파수 설정" # AI Translated -msgid "RepRap firmware uses the same frequency range for both axes." +msgid "RepRapFirmware uses the same frequency range for both axes." msgstr "RepRap 펌웨어는 두 축에 동일한 주파수 범위를 사용합니다." # AI Translated @@ -25033,7 +25037,7 @@ msgid "Damp (Start / End): " msgstr "감쇠 (시작 / 종료): " # AI Translated -msgid "RepRap firmware uses the same frequency for both axes." +msgid "RepRapFirmware uses the same frequency for both axes." msgstr "RepRap 펌웨어는 두 축에 동일한 주파수를 사용합니다." # AI Translated diff --git a/localization/i18n/lt/OrcaSlicer_lt.po b/localization/i18n/lt/OrcaSlicer_lt.po index c8ff4b577f..21cbca8a3a 100644 --- a/localization/i18n/lt/OrcaSlicer_lt.po +++ b/localization/i18n/lt/OrcaSlicer_lt.po @@ -20191,17 +20191,17 @@ msgstr "Valymas į vidų" # AI Translated msgid "" -"Applies only to external walls, including hole boundaries. Moves the hot nozzle toward printed inner walls during wiping to reduce reheating of freshly printed plastic and seam marks.\n" +"Applies only to external walls, including hole boundaries. Moves the hot nozzle toward the inner walls during wiping to reduce reheating of freshly printed plastic and seam marks.\n" "\n" "Especially useful at layer heights below 0.1 mm, where wipe marks are more visible.\n" "\n" -"Uses the regular wipe if no adjacent inner wall is already printed (single-wall areas or Outer/Inner wall order), or if no supported inward path can be found, for example at tight corners or seam gaps." +"Uses the regular wipe where the outer wall has no adjacent inner wall, such as in single-wall areas, or if no supported inward path can be found, for example at tight corners or seam gaps." msgstr "" -"Taikoma tik išorinėms sienelėms, įskaitant skylių kontūrus. Valymo metu karštą purkštuką patraukia link jau atspausdintų vidinių sienelių, kad sumažintų ką tik atspausdinto plastiko pakartotinį įkaitimą ir siūlės žymes.\n" +"Taikoma tik išorinėms sienelėms, įskaitant skylių kontūrus. Valymo metu karštą purkštuką patraukia link vidinių sienelių, kad sumažintų ką tik atspausdinto plastiko pakartotinį įkaitimą ir siūlės žymes.\n" "\n" "Ypač naudinga esant mažesniam nei 0,1 mm sluoksnio aukščiui, kai valymo žymės labiau matomos.\n" "\n" -"Naudoja įprastą valymą, jei nėra jau atspausdintos gretimos vidinės sienelės (vienos sienelės sritys arba sienelių eiliškumas Išorinis / vidinis) arba jei nepavyksta rasti atremto kelio į vidų, pavyzdžiui, ankštuose kampuose ar siūlės tarpuose." +"Naudoja įprastą valymą ten, kur išorinė sienelė neturi gretimos vidinės sienelės, kaip vienos sienelės srityse, arba jei nepavyksta rasti atremto kelio į vidų, pavyzdžiui, ankštuose kampuose ar siūlės tarpuose." # AI Translated msgid "Wipe inward distance" @@ -20212,11 +20212,15 @@ msgstr "Valymo į vidų atstumas" msgid "" "The distance the wipe path is shifted away from the external perimeter, specified in millimeters or as a percentage of the actual outer-wall extrusion width.\n" "\n" -"For example, 50% shifts the path by half of the outer-wall width. The effective offset is limited by both the actual outer-wall width and the available spacing to the adjacent wall, so values above 100% or an equivalent absolute distance have no additional effect. Set to 0 to disable the offset." +"For example, 50% shifts the path by half of the outer-wall width. The effective offset is limited by both the actual outer-wall width and the available spacing to the adjacent wall, so values above 100% or an equivalent absolute distance have no additional effect. Set to 0 to disable the offset.\n" +"\n" +"With Outer/Inner or Inner/Outer/Inner wall order, the offset is limited to 50% of the actual outer-wall width because the adjacent inner wall is printed after the outer wall. This also applies to equivalent distances specified in millimeters." msgstr "" "Atstumas, kuriuo valymo kelias pastumiamas nuo išorinio kontūro, nurodomas milimetrais arba procentais nuo faktinio išorinės sienelės išspaudimo pločio.\n" "\n" -"Pavyzdžiui, 50% pastumia kelią per pusę išorinės sienelės pločio. Faktinį poslinkį riboja tiek tikrasis išorinės sienelės plotis, tiek laisvas tarpas iki gretimos sienelės, todėl didesnės nei 100% reikšmės ar joms lygiavertis absoliutus atstumas papildomo poveikio neturi. Nustatykite 0, kad poslinkis būtų išjungtas." +"Pavyzdžiui, 50% pastumia kelią per pusę išorinės sienelės pločio. Faktinį poslinkį riboja tiek tikrasis išorinės sienelės plotis, tiek laisvas tarpas iki gretimos sienelės, todėl didesnės nei 100% reikšmės ar joms lygiavertis absoliutus atstumas papildomo poveikio neturi. Nustatykite 0, kad poslinkis būtų išjungtas.\n" +"\n" +"Kai sienelių eiliškumas yra Išorinis / vidinis arba Vidinis / išorinis / vidinis, poslinkis ribojamas iki 50% faktinio išorinės sienelės pločio, nes gretima vidinė sienelė spausdinama po išorinės sienelės. Tai taikoma ir lygiaverčiams atstumams, nurodytiems milimetrais." msgid "Wipe before external loop" msgstr "Valymas prieš išorinį kontūrą" @@ -24524,7 +24528,7 @@ msgid "Klipper version => 0.9.0" msgstr "Klipper versija => 0.9.0 (Klipper)" msgid "" -"RepRap firmware version => 3.4.0\n" +"RepRapFirmware version => 3.4.0\n" "Check your firmware documentation for supported shaper types." msgstr "" "RepRap programinės aparatinės įrangos versija => 3.4.0\n" @@ -24544,7 +24548,7 @@ msgstr "Y pradžia / pabaiga: " msgid "Frequency settings" msgstr "Dažnio nustatymai" -msgid "RepRap firmware uses the same frequency range for both axes." +msgid "RepRapFirmware uses the same frequency range for both axes." msgstr "RepRap programinė aparatinė įranga naudoja tą patį dažnių diapazoną abiem ašims." msgid "Damp: " @@ -24584,7 +24588,7 @@ msgstr "Dažnis X / Y: " msgid "Damp (Start / End): " msgstr "Slopinimas (pradžia / pabaiga): " -msgid "RepRap firmware uses the same frequency for both axes." +msgid "RepRapFirmware uses the same frequency for both axes." msgstr "RepRap programinė aparatinė įranga naudoja tą patį dažnį abiem ašims." msgid "Note: Use previously calculated frequencies." diff --git a/localization/i18n/nl/OrcaSlicer_nl.po b/localization/i18n/nl/OrcaSlicer_nl.po index 21c0b9b543..5f8aeaf2a0 100644 --- a/localization/i18n/nl/OrcaSlicer_nl.po +++ b/localization/i18n/nl/OrcaSlicer_nl.po @@ -21758,17 +21758,17 @@ msgstr "Naar binnen vegen" # AI Translated msgid "" -"Applies only to external walls, including hole boundaries. Moves the hot nozzle toward printed inner walls during wiping to reduce reheating of freshly printed plastic and seam marks.\n" +"Applies only to external walls, including hole boundaries. Moves the hot nozzle toward the inner walls during wiping to reduce reheating of freshly printed plastic and seam marks.\n" "\n" "Especially useful at layer heights below 0.1 mm, where wipe marks are more visible.\n" "\n" -"Uses the regular wipe if no adjacent inner wall is already printed (single-wall areas or Outer/Inner wall order), or if no supported inward path can be found, for example at tight corners or seam gaps." +"Uses the regular wipe where the outer wall has no adjacent inner wall, such as in single-wall areas, or if no supported inward path can be found, for example at tight corners or seam gaps." msgstr "" -"Geldt alleen voor buitenwanden, inclusief gatcontouren. Beweegt het hete mondstuk tijdens het vegen naar reeds geprinte binnenwanden, om het opnieuw opwarmen van vers geprint plastic en naadsporen te beperken.\n" +"Geldt alleen voor buitenwanden, inclusief gatcontouren. Beweegt het hete mondstuk tijdens het vegen naar de binnenwanden, om het opnieuw opwarmen van vers geprint plastic en naadsporen te beperken.\n" "\n" "Vooral nuttig bij laaghoogtes onder 0,1 mm, waar veegsporen beter zichtbaar zijn.\n" "\n" -"Gebruikt het gewone vegen als er nog geen aangrenzende binnenwand geprint is (gebieden met één wand of de wandvolgorde Buiten/Binnen), of als er geen ondersteund pad naar binnen gevonden kan worden, bijvoorbeeld bij krappe hoeken of onderbrekingen in de naad." +"Gebruikt het gewone vegen waar de buitenwand geen aangrenzende binnenwand heeft, zoals in gebieden met één wand, of als er geen ondersteund pad naar binnen gevonden kan worden, bijvoorbeeld bij krappe hoeken of onderbrekingen in de naad." # AI Translated msgid "Wipe inward distance" @@ -21779,11 +21779,15 @@ msgstr "Afstand voor naar binnen vegen" msgid "" "The distance the wipe path is shifted away from the external perimeter, specified in millimeters or as a percentage of the actual outer-wall extrusion width.\n" "\n" -"For example, 50% shifts the path by half of the outer-wall width. The effective offset is limited by both the actual outer-wall width and the available spacing to the adjacent wall, so values above 100% or an equivalent absolute distance have no additional effect. Set to 0 to disable the offset." +"For example, 50% shifts the path by half of the outer-wall width. The effective offset is limited by both the actual outer-wall width and the available spacing to the adjacent wall, so values above 100% or an equivalent absolute distance have no additional effect. Set to 0 to disable the offset.\n" +"\n" +"With Outer/Inner or Inner/Outer/Inner wall order, the offset is limited to 50% of the actual outer-wall width because the adjacent inner wall is printed after the outer wall. This also applies to equivalent distances specified in millimeters." msgstr "" "De afstand waarover het veegpad van de buitenste omtrek af wordt verschoven, opgegeven in millimeters of als percentage van de werkelijke extrusiebreedte van de buitenwand.\n" "\n" -"Bijvoorbeeld: 50% verschuift het pad over de helft van de breedte van de buitenwand. De effectieve verschuiving wordt begrensd door zowel de werkelijke breedte van de buitenwand als de beschikbare ruimte tot de aangrenzende wand, dus waarden boven 100% of een gelijkwaardige absolute afstand hebben geen extra effect. Stel in op 0 om de verschuiving uit te schakelen." +"Bijvoorbeeld: 50% verschuift het pad over de helft van de breedte van de buitenwand. De effectieve verschuiving wordt begrensd door zowel de werkelijke breedte van de buitenwand als de beschikbare ruimte tot de aangrenzende wand, dus waarden boven 100% of een gelijkwaardige absolute afstand hebben geen extra effect. Stel in op 0 om de verschuiving uit te schakelen.\n" +"\n" +"Bij de wandvolgorde Buiten/Binnen of Binnen/Buiten/Binnen is de verschuiving beperkt tot 50% van de werkelijke breedte van de buitenwand, omdat de aangrenzende binnenwand na de buitenwand wordt geprint. Dit geldt ook voor gelijkwaardige afstanden in millimeters." # AI Translated msgid "Wipe before external loop" @@ -26444,10 +26448,10 @@ msgstr "Klipper-versie => 0.9.0" # AI Translated msgid "" -"RepRap firmware version => 3.4.0\n" +"RepRapFirmware version => 3.4.0\n" "Check your firmware documentation for supported shaper types." msgstr "" -"RepRap-firmwareversie => 3.4.0\n" +"RepRapFirmware-versie => 3.4.0\n" "Raadpleeg de documentatie van uw firmware voor de ondersteunde shapertypes." # AI Translated @@ -26467,8 +26471,8 @@ msgid "Frequency settings" msgstr "Frequentie-instellingen" # AI Translated -msgid "RepRap firmware uses the same frequency range for both axes." -msgstr "RepRap-firmware gebruikt hetzelfde frequentiebereik voor beide assen." +msgid "RepRapFirmware uses the same frequency range for both axes." +msgstr "RepRapFirmware gebruikt hetzelfde frequentiebereik voor beide assen." # AI Translated msgid "Damp: " @@ -26515,8 +26519,8 @@ msgid "Damp (Start / End): " msgstr "Demping (Start / Einde): " # AI Translated -msgid "RepRap firmware uses the same frequency for both axes." -msgstr "RepRap-firmware gebruikt dezelfde frequentie voor beide assen." +msgid "RepRapFirmware uses the same frequency for both axes." +msgstr "RepRapFirmware gebruikt dezelfde frequentie voor beide assen." # AI Translated msgid "Note: Use previously calculated frequencies." diff --git a/localization/i18n/pl/OrcaSlicer_pl.po b/localization/i18n/pl/OrcaSlicer_pl.po index 415b937287..e363695681 100644 --- a/localization/i18n/pl/OrcaSlicer_pl.po +++ b/localization/i18n/pl/OrcaSlicer_pl.po @@ -20633,17 +20633,17 @@ msgstr "Wycieranie do wewnątrz" # AI Translated msgid "" -"Applies only to external walls, including hole boundaries. Moves the hot nozzle toward printed inner walls during wiping to reduce reheating of freshly printed plastic and seam marks.\n" +"Applies only to external walls, including hole boundaries. Moves the hot nozzle toward the inner walls during wiping to reduce reheating of freshly printed plastic and seam marks.\n" "\n" "Especially useful at layer heights below 0.1 mm, where wipe marks are more visible.\n" "\n" -"Uses the regular wipe if no adjacent inner wall is already printed (single-wall areas or Outer/Inner wall order), or if no supported inward path can be found, for example at tight corners or seam gaps." +"Uses the regular wipe where the outer wall has no adjacent inner wall, such as in single-wall areas, or if no supported inward path can be found, for example at tight corners or seam gaps." msgstr "" -"Dotyczy wyłącznie ścian zewnętrznych, w tym obrysów otworów. Podczas wycierania przesuwa gorącą dyszę w stronę wydrukowanych już ścian wewnętrznych, aby ograniczyć ponowne nagrzewanie świeżo wydrukowanego tworzywa i ślady szwu.\n" +"Dotyczy wyłącznie ścian zewnętrznych, w tym obrysów otworów. Podczas wycierania przesuwa gorącą dyszę w stronę ścian wewnętrznych, aby ograniczyć ponowne nagrzewanie świeżo wydrukowanego tworzywa i ślady szwu.\n" "\n" "Szczególnie przydatne przy wysokościach warstwy poniżej 0,1 mm, gdzie ślady wycierania są bardziej widoczne.\n" "\n" -"Używa zwykłego wycierania, jeśli żadna sąsiednia ściana wewnętrzna nie została jeszcze wydrukowana (obszary o pojedynczej ścianie lub kolejność ścian Zewnętrzna/wewnętrzna) albo jeśli nie można znaleźć podpartej ścieżki do wewnątrz, na przykład w ciasnych narożnikach lub przerwach szwu." +"Używa zwykłego wycierania tam, gdzie ściana zewnętrzna nie ma sąsiedniej ściany wewnętrznej, jak w obszarach o pojedynczej ścianie, albo jeśli nie można znaleźć podpartej ścieżki do wewnątrz, na przykład w ciasnych narożnikach lub przerwach szwu." # AI Translated msgid "Wipe inward distance" @@ -20654,11 +20654,15 @@ msgstr "Odległość wycierania do wewnątrz" msgid "" "The distance the wipe path is shifted away from the external perimeter, specified in millimeters or as a percentage of the actual outer-wall extrusion width.\n" "\n" -"For example, 50% shifts the path by half of the outer-wall width. The effective offset is limited by both the actual outer-wall width and the available spacing to the adjacent wall, so values above 100% or an equivalent absolute distance have no additional effect. Set to 0 to disable the offset." +"For example, 50% shifts the path by half of the outer-wall width. The effective offset is limited by both the actual outer-wall width and the available spacing to the adjacent wall, so values above 100% or an equivalent absolute distance have no additional effect. Set to 0 to disable the offset.\n" +"\n" +"With Outer/Inner or Inner/Outer/Inner wall order, the offset is limited to 50% of the actual outer-wall width because the adjacent inner wall is printed after the outer wall. This also applies to equivalent distances specified in millimeters." msgstr "" "Odległość, o jaką ścieżka wycierania zostaje przesunięta od zewnętrznego obrysu, podana w milimetrach lub jako procent rzeczywistej szerokości ekstruzji zewnętrznej ściany.\n" "\n" -"Na przykład 50% przesuwa ścieżkę o połowę szerokości zewnętrznej ściany. Skuteczne przesunięcie jest ograniczone zarówno rzeczywistą szerokością zewnętrznej ściany, jak i dostępnym odstępem do sąsiedniej ściany, więc wartości powyżej 100% lub równoważna odległość bezwzględna nie dają dodatkowego efektu. Ustaw 0, aby wyłączyć przesunięcie." +"Na przykład 50% przesuwa ścieżkę o połowę szerokości zewnętrznej ściany. Skuteczne przesunięcie jest ograniczone zarówno rzeczywistą szerokością zewnętrznej ściany, jak i dostępnym odstępem do sąsiedniej ściany, więc wartości powyżej 100% lub równoważna odległość bezwzględna nie dają dodatkowego efektu. Ustaw 0, aby wyłączyć przesunięcie.\n" +"\n" +"Przy kolejności ścian Zewnętrzna/wewnętrzna lub Wewnętrzna/zewnętrzna/wewnętrzna przesunięcie jest ograniczone do 50% rzeczywistej szerokości zewnętrznej ściany, ponieważ sąsiednia ściana wewnętrzna jest drukowana po ścianie zewnętrznej. Dotyczy to również równoważnych odległości podanych w milimetrach." msgid "Wipe before external loop" msgstr "Wycieranie przed zewnętrzną pętlą" @@ -25009,10 +25013,10 @@ msgstr "Klipper w wersji => 0.9.0" # AI Translated msgid "" -"RepRap firmware version => 3.4.0\n" +"RepRapFirmware version => 3.4.0\n" "Check your firmware documentation for supported shaper types." msgstr "" -"RepRap firmware w wersji => 3.4.0\n" +"RepRapFirmware w wersji => 3.4.0\n" "Sprawdź w dokumentacji oprogramowania sprzętowego, które typy kształtowników są obsługiwane." # AI Translated @@ -25032,8 +25036,8 @@ msgid "Frequency settings" msgstr "Ustawienia częstotliwości" # AI Translated -msgid "RepRap firmware uses the same frequency range for both axes." -msgstr "RepRap firmware używa tego samego zakresu częstotliwości dla obu osi." +msgid "RepRapFirmware uses the same frequency range for both axes." +msgstr "RepRapFirmware używa tego samego zakresu częstotliwości dla obu osi." # AI Translated msgid "Damp: " @@ -25080,8 +25084,8 @@ msgid "Damp (Start / End): " msgstr "Tłumienie (początek / koniec): " # AI Translated -msgid "RepRap firmware uses the same frequency for both axes." -msgstr "RepRap firmware używa tej samej częstotliwości dla obu osi." +msgid "RepRapFirmware uses the same frequency for both axes." +msgstr "RepRapFirmware używa tej samej częstotliwości dla obu osi." # AI Translated msgid "Note: Use previously calculated frequencies." diff --git a/localization/i18n/pt_BR/OrcaSlicer_pt_BR.po b/localization/i18n/pt_BR/OrcaSlicer_pt_BR.po index 52de79396c..d6b6769c81 100644 --- a/localization/i18n/pt_BR/OrcaSlicer_pt_BR.po +++ b/localization/i18n/pt_BR/OrcaSlicer_pt_BR.po @@ -19091,17 +19091,17 @@ msgstr "Limpeza para dentro" # AI Translated msgid "" -"Applies only to external walls, including hole boundaries. Moves the hot nozzle toward printed inner walls during wiping to reduce reheating of freshly printed plastic and seam marks.\n" +"Applies only to external walls, including hole boundaries. Moves the hot nozzle toward the inner walls during wiping to reduce reheating of freshly printed plastic and seam marks.\n" "\n" "Especially useful at layer heights below 0.1 mm, where wipe marks are more visible.\n" "\n" -"Uses the regular wipe if no adjacent inner wall is already printed (single-wall areas or Outer/Inner wall order), or if no supported inward path can be found, for example at tight corners or seam gaps." +"Uses the regular wipe where the outer wall has no adjacent inner wall, such as in single-wall areas, or if no supported inward path can be found, for example at tight corners or seam gaps." msgstr "" -"Aplica-se apenas às paredes externas, incluindo os contornos dos furos. Durante a limpeza, move o bico quente em direção às paredes internas já impressas, para reduzir o reaquecimento do plástico recém-depositado e as marcas de costura.\n" +"Aplica-se apenas às paredes externas, incluindo os contornos dos furos. Durante a limpeza, move o bico quente em direção às paredes internas, para reduzir o reaquecimento do plástico recém-depositado e as marcas de costura.\n" "\n" "Especialmente útil em alturas de camada abaixo de 0,1 mm, nas quais as marcas de limpeza ficam mais visíveis.\n" "\n" -"Usa a limpeza normal se nenhuma parede interna adjacente já tiver sido impressa (áreas de parede única ou ordem de paredes Exterior/Interior) ou se nenhum caminho apoiado para dentro puder ser encontrado, por exemplo em cantos fechados ou em falhas da costura." +"Usa a limpeza normal onde a parede externa não tem nenhuma parede interna adjacente, como em áreas de parede única, ou se nenhum caminho apoiado para dentro puder ser encontrado, por exemplo em cantos fechados ou em falhas da costura." msgid "Wipe inward distance" msgstr "Distância de limpeza para dentro" @@ -19111,11 +19111,15 @@ msgstr "Distância de limpeza para dentro" msgid "" "The distance the wipe path is shifted away from the external perimeter, specified in millimeters or as a percentage of the actual outer-wall extrusion width.\n" "\n" -"For example, 50% shifts the path by half of the outer-wall width. The effective offset is limited by both the actual outer-wall width and the available spacing to the adjacent wall, so values above 100% or an equivalent absolute distance have no additional effect. Set to 0 to disable the offset." +"For example, 50% shifts the path by half of the outer-wall width. The effective offset is limited by both the actual outer-wall width and the available spacing to the adjacent wall, so values above 100% or an equivalent absolute distance have no additional effect. Set to 0 to disable the offset.\n" +"\n" +"With Outer/Inner or Inner/Outer/Inner wall order, the offset is limited to 50% of the actual outer-wall width because the adjacent inner wall is printed after the outer wall. This also applies to equivalent distances specified in millimeters." msgstr "" "Distância pela qual o caminho de limpeza é deslocado para longe do perímetro externo, indicada em milímetros ou como porcentagem da largura de extrusão real da parede externa.\n" "\n" -"Por exemplo, 50% desloca o caminho pela metade da largura da parede externa. O deslocamento efetivo é limitado tanto pela largura real da parede externa quanto pelo espaço disponível até a parede adjacente, de modo que valores acima de 100% ou uma distância absoluta equivalente não têm efeito adicional. Defina 0 para desativar o deslocamento." +"Por exemplo, 50% desloca o caminho pela metade da largura da parede externa. O deslocamento efetivo é limitado tanto pela largura real da parede externa quanto pelo espaço disponível até a parede adjacente, de modo que valores acima de 100% ou uma distância absoluta equivalente não têm efeito adicional. Defina 0 para desativar o deslocamento.\n" +"\n" +"Com a ordem de paredes Exterior/Interior ou Interior/Exterior/Interior, o deslocamento é limitado a 50% da largura real da parede externa, porque a parede interna adjacente é impressa depois da parede externa. Isso também se aplica a distâncias equivalentes indicadas em milímetros." msgid "Wipe before external loop" msgstr "Limpeza antes da volta externa" @@ -23278,10 +23282,10 @@ msgid "Klipper version => 0.9.0" msgstr "Versão do Klipper => 0.9.0" msgid "" -"RepRap firmware version => 3.4.0\n" +"RepRapFirmware version => 3.4.0\n" "Check your firmware documentation for supported shaper types." msgstr "" -"Versão do firmware RepRap => 3.4.0\n" +"Versão do RepRapFirmware => 3.4.0\n" "Consulte a documentação do firmware para verificar os tipos de modeladores suportados." msgid "Frequency (Start / End): " @@ -23298,8 +23302,8 @@ msgstr "Y Inicial / Final: " msgid "Frequency settings" msgstr "Configurações de frequência" -msgid "RepRap firmware uses the same frequency range for both axes." -msgstr "O firmware RepRap usa a mesma faixa de frequência para ambos os eixos." +msgid "RepRapFirmware uses the same frequency range for both axes." +msgstr "O RepRapFirmware usa a mesma faixa de frequência para ambos os eixos." msgid "Damp: " msgstr "Amortecimento: " @@ -23338,8 +23342,8 @@ msgstr "Frequência X / Y: " msgid "Damp (Start / End): " msgstr "Amortecimento (Inicial / Final): " -msgid "RepRap firmware uses the same frequency for both axes." -msgstr "O firmware RepRap usa a mesma frequência para ambos os eixos." +msgid "RepRapFirmware uses the same frequency for both axes." +msgstr "O RepRapFirmware usa a mesma frequência para ambos os eixos." msgid "Note: Use previously calculated frequencies." msgstr "Nota: Use frequências previamente calculadas." diff --git a/localization/i18n/ru/OrcaSlicer_ru.po b/localization/i18n/ru/OrcaSlicer_ru.po index f765c38c85..ffc1e3e4ce 100644 --- a/localization/i18n/ru/OrcaSlicer_ru.po +++ b/localization/i18n/ru/OrcaSlicer_ru.po @@ -19851,17 +19851,17 @@ msgstr "Очистка внутрь" # AI Translated msgid "" -"Applies only to external walls, including hole boundaries. Moves the hot nozzle toward printed inner walls during wiping to reduce reheating of freshly printed plastic and seam marks.\n" +"Applies only to external walls, including hole boundaries. Moves the hot nozzle toward the inner walls during wiping to reduce reheating of freshly printed plastic and seam marks.\n" "\n" "Especially useful at layer heights below 0.1 mm, where wipe marks are more visible.\n" "\n" -"Uses the regular wipe if no adjacent inner wall is already printed (single-wall areas or Outer/Inner wall order), or if no supported inward path can be found, for example at tight corners or seam gaps." +"Uses the regular wipe where the outer wall has no adjacent inner wall, such as in single-wall areas, or if no supported inward path can be found, for example at tight corners or seam gaps." msgstr "" -"Применяется только к внешним периметрам, включая контуры отверстий. Во время очистки перемещает горячее сопло к уже напечатанным внутренним периметрам, чтобы уменьшить повторный нагрев только что напечатанного пластика и следы шва.\n" +"Применяется только к внешним периметрам, включая контуры отверстий. Во время очистки перемещает горячее сопло к внутренним периметрам, чтобы уменьшить повторный нагрев только что напечатанного пластика и следы шва.\n" "\n" "Особенно полезно при высоте слоя менее 0,1 мм, где следы очистки заметнее.\n" "\n" -"Использует обычную очистку, если рядом нет уже напечатанного внутреннего периметра (области с одним периметром или порядок периметров «Снаружи внутрь») либо если не удаётся найти опирающийся путь внутрь, например в тесных углах или разрывах шва." +"Использует обычную очистку там, где у внешнего периметра нет соседнего внутреннего периметра, как в областях с одним периметром, либо если не удаётся найти опирающийся путь внутрь, например в тесных углах или разрывах шва." # AI Translated msgid "Wipe inward distance" @@ -19872,11 +19872,15 @@ msgstr "Расстояние очистки внутрь" msgid "" "The distance the wipe path is shifted away from the external perimeter, specified in millimeters or as a percentage of the actual outer-wall extrusion width.\n" "\n" -"For example, 50% shifts the path by half of the outer-wall width. The effective offset is limited by both the actual outer-wall width and the available spacing to the adjacent wall, so values above 100% or an equivalent absolute distance have no additional effect. Set to 0 to disable the offset." +"For example, 50% shifts the path by half of the outer-wall width. The effective offset is limited by both the actual outer-wall width and the available spacing to the adjacent wall, so values above 100% or an equivalent absolute distance have no additional effect. Set to 0 to disable the offset.\n" +"\n" +"With Outer/Inner or Inner/Outer/Inner wall order, the offset is limited to 50% of the actual outer-wall width because the adjacent inner wall is printed after the outer wall. This also applies to equivalent distances specified in millimeters." msgstr "" "Расстояние, на которое путь очистки смещается от внешнего периметра, задаётся в миллиметрах или в процентах от фактической ширины линии внешнего периметра.\n" "\n" -"Например, 50% смещает путь на половину ширины внешнего периметра. Фактическое смещение ограничено как реальной шириной внешнего периметра, так и доступным промежутком до соседнего периметра, поэтому значения выше 100% или эквивалентное абсолютное расстояние не дают дополнительного эффекта. Задайте 0, чтобы отключить смещение." +"Например, 50% смещает путь на половину ширины внешнего периметра. Фактическое смещение ограничено как реальной шириной внешнего периметра, так и доступным промежутком до соседнего периметра, поэтому значения выше 100% или эквивалентное абсолютное расстояние не дают дополнительного эффекта. Задайте 0, чтобы отключить смещение.\n" +"\n" +"При порядке печати периметров «Снаружи внутрь» или «Навстречу» смещение ограничено 50% фактической ширины внешнего периметра, потому что соседний внутренний периметр печатается после внешнего. Это относится и к эквивалентным расстояниям, заданным в миллиметрах." # Подворот начала линии на шве, упреждающая подача перед внешним периметром, # заглубление подачи ..., смещённая подача @@ -24189,7 +24193,7 @@ msgid "Klipper version => 0.9.0" msgstr "Требуется Klipper 0.9.0 или новее." msgid "" -"RepRap firmware version => 3.4.0\n" +"RepRapFirmware version => 3.4.0\n" "Check your firmware documentation for supported shaper types." msgstr "" "Требуется RepRap 3.4.0 или новее.\n" @@ -24210,7 +24214,7 @@ msgstr "Y, начало / конец: " msgid "Frequency settings" msgstr "Настройка частоты" -msgid "RepRap firmware uses the same frequency range for both axes." +msgid "RepRapFirmware uses the same frequency range for both axes." msgstr "Прошивка RepRap использует общий диапазон частот для обеих осей." msgid "Damp: " @@ -24250,7 +24254,7 @@ msgstr "Частота X / Y: " msgid "Damp (Start / End): " msgstr "Затухание (начало / конец): " -msgid "RepRap firmware uses the same frequency for both axes." +msgid "RepRapFirmware uses the same frequency for both axes." msgstr "Прошивка RepRap использует общую частоту для обеих осей." msgid "Note: Use previously calculated frequencies." diff --git a/localization/i18n/sv/OrcaSlicer_sv.po b/localization/i18n/sv/OrcaSlicer_sv.po index e6b1d655d4..aa8ac83991 100644 --- a/localization/i18n/sv/OrcaSlicer_sv.po +++ b/localization/i18n/sv/OrcaSlicer_sv.po @@ -21990,17 +21990,17 @@ msgstr "Torka inåt" # AI Translated msgid "" -"Applies only to external walls, including hole boundaries. Moves the hot nozzle toward printed inner walls during wiping to reduce reheating of freshly printed plastic and seam marks.\n" +"Applies only to external walls, including hole boundaries. Moves the hot nozzle toward the inner walls during wiping to reduce reheating of freshly printed plastic and seam marks.\n" "\n" "Especially useful at layer heights below 0.1 mm, where wipe marks are more visible.\n" "\n" -"Uses the regular wipe if no adjacent inner wall is already printed (single-wall areas or Outer/Inner wall order), or if no supported inward path can be found, for example at tight corners or seam gaps." +"Uses the regular wipe where the outer wall has no adjacent inner wall, such as in single-wall areas, or if no supported inward path can be found, for example at tight corners or seam gaps." msgstr "" -"Gäller endast yttre väggar, inklusive hålkonturer. Flyttar den heta nozzeln mot redan utskrivna inre väggar under avtorkningen, för att minska återuppvärmningen av nyss utskriven plast och sömmärken.\n" +"Gäller endast yttre väggar, inklusive hålkonturer. Flyttar den heta nozzeln mot de inre väggarna under avtorkningen, för att minska återuppvärmningen av nyss utskriven plast och sömmärken.\n" "\n" "Särskilt användbart vid lagerhöjder under 0,1 mm, där avtorkningsmärken syns tydligare.\n" "\n" -"Använder vanlig avtorkning om ingen angränsande inre vägg redan är utskriven (områden med en enda vägg eller väggordningen Yttre/Inre), eller om ingen understödd väg inåt kan hittas, till exempel i trånga hörn eller vid sömglapp." +"Använder vanlig avtorkning där den yttre väggen saknar angränsande inre vägg, som i områden med en enda vägg, eller om ingen understödd väg inåt kan hittas, till exempel i trånga hörn eller vid sömglapp." # AI Translated msgid "Wipe inward distance" @@ -22011,11 +22011,15 @@ msgstr "Avstånd för torka inåt" msgid "" "The distance the wipe path is shifted away from the external perimeter, specified in millimeters or as a percentage of the actual outer-wall extrusion width.\n" "\n" -"For example, 50% shifts the path by half of the outer-wall width. The effective offset is limited by both the actual outer-wall width and the available spacing to the adjacent wall, so values above 100% or an equivalent absolute distance have no additional effect. Set to 0 to disable the offset." +"For example, 50% shifts the path by half of the outer-wall width. The effective offset is limited by both the actual outer-wall width and the available spacing to the adjacent wall, so values above 100% or an equivalent absolute distance have no additional effect. Set to 0 to disable the offset.\n" +"\n" +"With Outer/Inner or Inner/Outer/Inner wall order, the offset is limited to 50% of the actual outer-wall width because the adjacent inner wall is printed after the outer wall. This also applies to equivalent distances specified in millimeters." msgstr "" "Avståndet som avtorkningsvägen förskjuts bort från den yttre perimetern, angivet i millimeter eller som procent av den yttre väggens faktiska extruderingsbredd.\n" "\n" -"Till exempel förskjuter 50% vägen med halva den yttre väggens bredd. Den verkliga förskjutningen begränsas både av den yttre väggens faktiska bredd och av det tillgängliga utrymmet till den angränsande väggen, så värden över 100% eller ett motsvarande absolut avstånd har ingen ytterligare effekt. Ange 0 för att stänga av förskjutningen." +"Till exempel förskjuter 50% vägen med halva den yttre väggens bredd. Den verkliga förskjutningen begränsas både av den yttre väggens faktiska bredd och av det tillgängliga utrymmet till den angränsande väggen, så värden över 100% eller ett motsvarande absolut avstånd har ingen ytterligare effekt. Ange 0 för att stänga av förskjutningen.\n" +"\n" +"Med väggordningen Yttre/Inre eller Inre/Yttre/Inre begränsas förskjutningen till 50% av den yttre väggens faktiska bredd, eftersom den angränsande inre väggen skrivs ut efter den yttre väggen. Detta gäller även motsvarande avstånd angivna i millimeter." # AI Translated msgid "Wipe before external loop" @@ -26621,10 +26625,10 @@ msgstr "Klipper-version => 0.9.0" # AI Translated msgid "" -"RepRap firmware version => 3.4.0\n" +"RepRapFirmware version => 3.4.0\n" "Check your firmware documentation for supported shaper types." msgstr "" -"RepRap firmware-version => 3.4.0\n" +"RepRapFirmware-version => 3.4.0\n" "Kontrollera dokumentationen för din fasta programvara för att se vilka shaper-typer som stöds." # AI Translated @@ -26644,8 +26648,8 @@ msgid "Frequency settings" msgstr "Frekvensinställningar" # AI Translated -msgid "RepRap firmware uses the same frequency range for both axes." -msgstr "RepRap firmware använder samma frekvensintervall för båda axlarna." +msgid "RepRapFirmware uses the same frequency range for both axes." +msgstr "RepRapFirmware använder samma frekvensintervall för båda axlarna." # AI Translated msgid "Damp: " @@ -26692,8 +26696,8 @@ msgid "Damp (Start / End): " msgstr "Dämpning (start / slut): " # AI Translated -msgid "RepRap firmware uses the same frequency for both axes." -msgstr "RepRap firmware använder samma frekvens för båda axlarna." +msgid "RepRapFirmware uses the same frequency for both axes." +msgstr "RepRapFirmware använder samma frekvens för båda axlarna." # AI Translated msgid "Note: Use previously calculated frequencies." diff --git a/localization/i18n/th/OrcaSlicer_th.po b/localization/i18n/th/OrcaSlicer_th.po index 757f1b0059..41b05a9452 100644 --- a/localization/i18n/th/OrcaSlicer_th.po +++ b/localization/i18n/th/OrcaSlicer_th.po @@ -20243,17 +20243,17 @@ msgstr "เช็ดเข้าด้านใน" # AI Translated msgid "" -"Applies only to external walls, including hole boundaries. Moves the hot nozzle toward printed inner walls during wiping to reduce reheating of freshly printed plastic and seam marks.\n" +"Applies only to external walls, including hole boundaries. Moves the hot nozzle toward the inner walls during wiping to reduce reheating of freshly printed plastic and seam marks.\n" "\n" "Especially useful at layer heights below 0.1 mm, where wipe marks are more visible.\n" "\n" -"Uses the regular wipe if no adjacent inner wall is already printed (single-wall areas or Outer/Inner wall order), or if no supported inward path can be found, for example at tight corners or seam gaps." +"Uses the regular wipe where the outer wall has no adjacent inner wall, such as in single-wall areas, or if no supported inward path can be found, for example at tight corners or seam gaps." msgstr "" -"ใช้กับผนังด้านนอกเท่านั้น รวมถึงขอบรู โดยจะขยับหัวฉีดที่ร้อนเข้าหาผนังด้านในที่พิมพ์ไปแล้วระหว่างการเช็ด เพื่อลดการให้ความร้อนซ้ำแก่พลาสติกที่เพิ่งพิมพ์และลดรอยตะเข็บ\n" +"ใช้กับผนังด้านนอกเท่านั้น รวมถึงขอบรู โดยจะขยับหัวฉีดที่ร้อนเข้าหาผนังด้านในระหว่างการเช็ด เพื่อลดการให้ความร้อนซ้ำแก่พลาสติกที่เพิ่งพิมพ์และลดรอยตะเข็บ\n" "\n" "มีประโยชน์เป็นพิเศษที่ความสูงเลเยอร์ต่ำกว่า 0.1 มม. ซึ่งรอยเช็ดจะเห็นได้ชัดกว่า\n" "\n" -"จะใช้การเช็ดแบบปกติหากยังไม่มีผนังด้านในที่อยู่ติดกันถูกพิมพ์ (พื้นที่ผนังเดี่ยว หรือลำดับผนังแบบด้านนอก/ด้านใน) หรือหากหาเส้นทางเข้าด้านในที่มีส่วนรองรับไม่ได้ เช่น ที่มุมแคบหรือช่องว่างของรอยตะเข็บ" +"จะใช้การเช็ดแบบปกติในบริเวณที่ผนังด้านนอกไม่มีผนังด้านในอยู่ติดกัน เช่น พื้นที่ผนังเดี่ยว หรือหากหาเส้นทางเข้าด้านในที่มีส่วนรองรับไม่ได้ เช่น ที่มุมแคบหรือช่องว่างของรอยตะเข็บ" # AI Translated msgid "Wipe inward distance" @@ -20264,11 +20264,15 @@ msgstr "ระยะเช็ดเข้าด้านใน" msgid "" "The distance the wipe path is shifted away from the external perimeter, specified in millimeters or as a percentage of the actual outer-wall extrusion width.\n" "\n" -"For example, 50% shifts the path by half of the outer-wall width. The effective offset is limited by both the actual outer-wall width and the available spacing to the adjacent wall, so values above 100% or an equivalent absolute distance have no additional effect. Set to 0 to disable the offset." +"For example, 50% shifts the path by half of the outer-wall width. The effective offset is limited by both the actual outer-wall width and the available spacing to the adjacent wall, so values above 100% or an equivalent absolute distance have no additional effect. Set to 0 to disable the offset.\n" +"\n" +"With Outer/Inner or Inner/Outer/Inner wall order, the offset is limited to 50% of the actual outer-wall width because the adjacent inner wall is printed after the outer wall. This also applies to equivalent distances specified in millimeters." msgstr "" "ระยะที่เส้นทางการเช็ดถูกเลื่อนออกจากเส้นรอบรูปด้านนอก ระบุเป็นมิลลิเมตรหรือเป็นเปอร์เซ็นต์ของความกว้างการอัดขึ้นรูปจริงของผนังด้านนอก\n" "\n" -"ตัวอย่างเช่น 50% จะเลื่อนเส้นทางไปครึ่งหนึ่งของความกว้างผนังด้านนอก ระยะเลื่อนที่มีผลจริงถูกจำกัดทั้งโดยความกว้างจริงของผนังด้านนอกและโดยช่องว่างที่มีถึงผนังที่อยู่ติดกัน ดังนั้นค่าที่เกิน 100% หรือระยะสัมบูรณ์ที่เทียบเท่าจะไม่ให้ผลเพิ่มเติม ตั้งเป็น 0 เพื่อปิดการเลื่อน" +"ตัวอย่างเช่น 50% จะเลื่อนเส้นทางไปครึ่งหนึ่งของความกว้างผนังด้านนอก ระยะเลื่อนที่มีผลจริงถูกจำกัดทั้งโดยความกว้างจริงของผนังด้านนอกและโดยช่องว่างที่มีถึงผนังที่อยู่ติดกัน ดังนั้นค่าที่เกิน 100% หรือระยะสัมบูรณ์ที่เทียบเท่าจะไม่ให้ผลเพิ่มเติม ตั้งเป็น 0 เพื่อปิดการเลื่อน\n" +"\n" +"เมื่อใช้ลำดับผนังแบบด้านนอก/ด้านใน หรือภายใน/ภายนอก/ภายใน ระยะเลื่อนจะถูกจำกัดไว้ที่ 50% ของความกว้างจริงของผนังด้านนอก เนื่องจากผนังด้านในที่อยู่ติดกันจะถูกพิมพ์หลังผนังด้านนอก ข้อจำกัดนี้ใช้กับระยะที่เทียบเท่าซึ่งระบุเป็นมิลลิเมตรด้วย" msgid "Wipe before external loop" msgstr "เช็ดก่อนวนรอบภายนอก" @@ -24600,7 +24604,7 @@ msgid "Klipper version => 0.9.0" msgstr "คลิปเปอร์เวอร์ชัน => 0.9.0" msgid "" -"RepRap firmware version => 3.4.0\n" +"RepRapFirmware version => 3.4.0\n" "Check your firmware documentation for supported shaper types." msgstr "" "เฟิร์มแวร์ RepRap เวอร์ชัน => 3.4.0\n" @@ -24620,7 +24624,7 @@ msgstr "Y เริ่ม / สิ้นสุด: " msgid "Frequency settings" msgstr "การตั้งค่าความถี่" -msgid "RepRap firmware uses the same frequency range for both axes." +msgid "RepRapFirmware uses the same frequency range for both axes." msgstr "เฟิร์มแวร์ RepRap ใช้ช่วงความถี่เดียวกันสำหรับทั้งสองแกน" msgid "Damp: " @@ -24661,7 +24665,7 @@ msgstr "ความถี่ X / Y: " msgid "Damp (Start / End): " msgstr "การหน่วง (เริ่ม / สิ้นสุด): " -msgid "RepRap firmware uses the same frequency for both axes." +msgid "RepRapFirmware uses the same frequency for both axes." msgstr "เฟิร์มแวร์ RepRap ใช้ความถี่เดียวกันสำหรับทั้งสองแกน" msgid "Note: Use previously calculated frequencies." diff --git a/localization/i18n/tr/OrcaSlicer_tr.po b/localization/i18n/tr/OrcaSlicer_tr.po index d2fe9fe953..cec6678c44 100644 --- a/localization/i18n/tr/OrcaSlicer_tr.po +++ b/localization/i18n/tr/OrcaSlicer_tr.po @@ -20130,17 +20130,17 @@ msgstr "İçeri temizleme" # AI Translated msgid "" -"Applies only to external walls, including hole boundaries. Moves the hot nozzle toward printed inner walls during wiping to reduce reheating of freshly printed plastic and seam marks.\n" +"Applies only to external walls, including hole boundaries. Moves the hot nozzle toward the inner walls during wiping to reduce reheating of freshly printed plastic and seam marks.\n" "\n" "Especially useful at layer heights below 0.1 mm, where wipe marks are more visible.\n" "\n" -"Uses the regular wipe if no adjacent inner wall is already printed (single-wall areas or Outer/Inner wall order), or if no supported inward path can be found, for example at tight corners or seam gaps." +"Uses the regular wipe where the outer wall has no adjacent inner wall, such as in single-wall areas, or if no supported inward path can be found, for example at tight corners or seam gaps." msgstr "" -"Yalnızca delik sınırları dahil olmak üzere dış duvarlara uygulanır. Temizleme sırasında sıcak nozulu yazdırılmış iç duvarlara doğru hareket ettirerek yeni yazdırılmış plastiğin yeniden ısınmasını ve dikiş izlerini azaltır.\n" +"Yalnızca delik sınırları dahil olmak üzere dış duvarlara uygulanır. Temizleme sırasında sıcak nozulu iç duvarlara doğru hareket ettirerek yeni yazdırılmış plastiğin yeniden ısınmasını ve dikiş izlerini azaltır.\n" "\n" "Özellikle temizleme izlerinin daha belirgin olduğu 0,1 mm'nin altındaki katman yüksekliklerinde yararlıdır.\n" "\n" -"Yazdırılmış bitişik bir iç duvar yoksa (tek duvarlı alanlar veya Dış/İç duvar sırası) ya da örneğin dar köşelerde veya dikiş boşluklarında desteklenen bir içeri yol bulunamazsa normal temizlemeyi kullanır." +"Tek duvarlı alanlar gibi dış duvarın bitişiğinde iç duvar bulunmayan yerlerde ya da örneğin dar köşelerde veya dikiş boşluklarında desteklenen bir içeri yol bulunamazsa normal temizlemeyi kullanır." # AI Translated msgid "Wipe inward distance" @@ -20151,11 +20151,15 @@ msgstr "İçeri temizleme mesafesi" msgid "" "The distance the wipe path is shifted away from the external perimeter, specified in millimeters or as a percentage of the actual outer-wall extrusion width.\n" "\n" -"For example, 50% shifts the path by half of the outer-wall width. The effective offset is limited by both the actual outer-wall width and the available spacing to the adjacent wall, so values above 100% or an equivalent absolute distance have no additional effect. Set to 0 to disable the offset." +"For example, 50% shifts the path by half of the outer-wall width. The effective offset is limited by both the actual outer-wall width and the available spacing to the adjacent wall, so values above 100% or an equivalent absolute distance have no additional effect. Set to 0 to disable the offset.\n" +"\n" +"With Outer/Inner or Inner/Outer/Inner wall order, the offset is limited to 50% of the actual outer-wall width because the adjacent inner wall is printed after the outer wall. This also applies to equivalent distances specified in millimeters." msgstr "" "Temizleme yolunun dış çevreden uzağa kaydırıldığı mesafe; milimetre cinsinden veya dış duvarın gerçek ekstrüzyon genişliğinin yüzdesi olarak belirtilir.\n" "\n" -"Örneğin 50%, yolu dış duvar genişliğinin yarısı kadar kaydırır. Etkin kaydırma, hem dış duvarın gerçek genişliğiyle hem de bitişik duvara olan mevcut boşlukla sınırlıdır; bu nedenle 100% üzerindeki değerlerin veya buna denk bir mutlak mesafenin ek bir etkisi olmaz. Kaydırmayı devre dışı bırakmak için 0 girin." +"Örneğin 50%, yolu dış duvar genişliğinin yarısı kadar kaydırır. Etkin kaydırma, hem dış duvarın gerçek genişliğiyle hem de bitişik duvara olan mevcut boşlukla sınırlıdır; bu nedenle 100% üzerindeki değerlerin veya buna denk bir mutlak mesafenin ek bir etkisi olmaz. Kaydırmayı devre dışı bırakmak için 0 girin.\n" +"\n" +"Dış/İç veya İç/Dış/İç duvar sırasında bitişik iç duvar dış duvardan sonra yazdırıldığı için kaydırma, dış duvarın gerçek genişliğinin 50%'si ile sınırlanır. Bu, milimetre cinsinden belirtilen eşdeğer mesafeler için de geçerlidir." msgid "Wipe before external loop" msgstr "Harici döngüden önce silin" @@ -24507,7 +24511,7 @@ msgid "Klipper version => 0.9.0" msgstr "Klipper sürümü => 0.9.0" msgid "" -"RepRap firmware version => 3.4.0\n" +"RepRapFirmware version => 3.4.0\n" "Check your firmware documentation for supported shaper types." msgstr "" "RepRap ürün yazılımı sürümü => 3.4.0\n" @@ -24527,7 +24531,7 @@ msgstr "Y Başlangıç / Bitiş: " msgid "Frequency settings" msgstr "Frekans ayarları" -msgid "RepRap firmware uses the same frequency range for both axes." +msgid "RepRapFirmware uses the same frequency range for both axes." msgstr "RepRap ürün yazılımı her iki eksen için aynı frekans aralığını kullanır." # AI Translated @@ -24568,7 +24572,7 @@ msgstr "Frekans X / Y: " msgid "Damp (Start / End): " msgstr "Sönümleme (Başlangıç / Bitiş): " -msgid "RepRap firmware uses the same frequency for both axes." +msgid "RepRapFirmware uses the same frequency for both axes." msgstr "RepRap ürün yazılımı her iki eksen için de aynı frekansı kullanır." msgid "Note: Use previously calculated frequencies." diff --git a/localization/i18n/uk/OrcaSlicer_uk.po b/localization/i18n/uk/OrcaSlicer_uk.po index cf586fa1c6..e9ded06ab5 100644 --- a/localization/i18n/uk/OrcaSlicer_uk.po +++ b/localization/i18n/uk/OrcaSlicer_uk.po @@ -20601,17 +20601,17 @@ msgstr "Протирання всередину" # AI Translated msgid "" -"Applies only to external walls, including hole boundaries. Moves the hot nozzle toward printed inner walls during wiping to reduce reheating of freshly printed plastic and seam marks.\n" +"Applies only to external walls, including hole boundaries. Moves the hot nozzle toward the inner walls during wiping to reduce reheating of freshly printed plastic and seam marks.\n" "\n" "Especially useful at layer heights below 0.1 mm, where wipe marks are more visible.\n" "\n" -"Uses the regular wipe if no adjacent inner wall is already printed (single-wall areas or Outer/Inner wall order), or if no supported inward path can be found, for example at tight corners or seam gaps." +"Uses the regular wipe where the outer wall has no adjacent inner wall, such as in single-wall areas, or if no supported inward path can be found, for example at tight corners or seam gaps." msgstr "" -"Застосовується лише до зовнішніх стінок, зокрема до контурів отворів. Під час протирання переміщує гаряче сопло до вже надрукованих внутрішніх стінок, щоб зменшити повторне нагрівання щойно надрукованого пластику та сліди шва.\n" +"Застосовується лише до зовнішніх стінок, зокрема до контурів отворів. Під час протирання переміщує гаряче сопло до внутрішніх стінок, щоб зменшити повторне нагрівання щойно надрукованого пластику та сліди шва.\n" "\n" "Особливо корисно за висоти шару менше 0,1 мм, де сліди протирання помітніші.\n" "\n" -"Використовує звичайне протирання, якщо поруч немає вже надрукованої внутрішньої стінки (ділянки з однією стінкою або порядок стінок Зовнішня/Внутрішня) або якщо не вдається знайти опертий шлях усередину, наприклад у тісних кутах чи розривах шва." +"Використовує звичайне протирання там, де зовнішня стінка не має сусідньої внутрішньої стінки, як-от на ділянках з однією стінкою, або якщо не вдається знайти опертий шлях усередину, наприклад у тісних кутах чи розривах шва." # AI Translated msgid "Wipe inward distance" @@ -20622,11 +20622,15 @@ msgstr "Відстань протирання всередину" msgid "" "The distance the wipe path is shifted away from the external perimeter, specified in millimeters or as a percentage of the actual outer-wall extrusion width.\n" "\n" -"For example, 50% shifts the path by half of the outer-wall width. The effective offset is limited by both the actual outer-wall width and the available spacing to the adjacent wall, so values above 100% or an equivalent absolute distance have no additional effect. Set to 0 to disable the offset." +"For example, 50% shifts the path by half of the outer-wall width. The effective offset is limited by both the actual outer-wall width and the available spacing to the adjacent wall, so values above 100% or an equivalent absolute distance have no additional effect. Set to 0 to disable the offset.\n" +"\n" +"With Outer/Inner or Inner/Outer/Inner wall order, the offset is limited to 50% of the actual outer-wall width because the adjacent inner wall is printed after the outer wall. This also applies to equivalent distances specified in millimeters." msgstr "" "Відстань, на яку шлях протирання зміщується від зовнішнього контуру, задається в міліметрах або у відсотках від фактичної ширини екструзії зовнішньої стінки.\n" "\n" -"Наприклад, 50% зміщує шлях на половину ширини зовнішньої стінки. Фактичне зміщення обмежується як реальною шириною зовнішньої стінки, так і доступним проміжком до сусідньої стінки, тому значення понад 100% або еквівалентна абсолютна відстань не дають додаткового ефекту. Задайте 0, щоб вимкнути зміщення." +"Наприклад, 50% зміщує шлях на половину ширини зовнішньої стінки. Фактичне зміщення обмежується як реальною шириною зовнішньої стінки, так і доступним проміжком до сусідньої стінки, тому значення понад 100% або еквівалентна абсолютна відстань не дають додаткового ефекту. Задайте 0, щоб вимкнути зміщення.\n" +"\n" +"За порядку стінок Зовнішня/Внутрішня або Внутрішня/Зовнішня/Внутрішня зміщення обмежується 50% фактичної ширини зовнішньої стінки, оскільки сусідня внутрішня стінка друкується після зовнішньої. Це стосується й еквівалентних відстаней, заданих у міліметрах." msgid "Wipe before external loop" msgstr "Протирати перед зовнішнім контуром" @@ -25023,10 +25027,10 @@ msgstr "Версія Klipper => 0.9.0" # AI Translated msgid "" -"RepRap firmware version => 3.4.0\n" +"RepRapFirmware version => 3.4.0\n" "Check your firmware documentation for supported shaper types." msgstr "" -"Версія RepRap firmware => 3.4.0\n" +"Версія RepRapFirmware => 3.4.0\n" "Перевірте в документації прошивки, які типи шейперів підтримуються." msgid "Frequency (Start / End): " @@ -25044,8 +25048,8 @@ msgid "Frequency settings" msgstr "Налаштування частоти" # AI Translated -msgid "RepRap firmware uses the same frequency range for both axes." -msgstr "RepRap firmware використовує однаковий діапазон частот для обох осей." +msgid "RepRapFirmware uses the same frequency range for both axes." +msgstr "RepRapFirmware використовує однаковий діапазон частот для обох осей." # AI Translated msgid "Damp: " @@ -25090,8 +25094,8 @@ msgid "Damp (Start / End): " msgstr "Демпфування (початок / кінець): " # AI Translated -msgid "RepRap firmware uses the same frequency for both axes." -msgstr "RepRap firmware використовує однакову частоту для обох осей." +msgid "RepRapFirmware uses the same frequency for both axes." +msgstr "RepRapFirmware використовує однакову частоту для обох осей." # AI Translated msgid "Note: Use previously calculated frequencies." diff --git a/localization/i18n/vi/OrcaSlicer_vi.po b/localization/i18n/vi/OrcaSlicer_vi.po index d217422b80..2f4310404c 100644 --- a/localization/i18n/vi/OrcaSlicer_vi.po +++ b/localization/i18n/vi/OrcaSlicer_vi.po @@ -20995,17 +20995,17 @@ msgstr "Lau vào trong" # AI Translated msgid "" -"Applies only to external walls, including hole boundaries. Moves the hot nozzle toward printed inner walls during wiping to reduce reheating of freshly printed plastic and seam marks.\n" +"Applies only to external walls, including hole boundaries. Moves the hot nozzle toward the inner walls during wiping to reduce reheating of freshly printed plastic and seam marks.\n" "\n" "Especially useful at layer heights below 0.1 mm, where wipe marks are more visible.\n" "\n" -"Uses the regular wipe if no adjacent inner wall is already printed (single-wall areas or Outer/Inner wall order), or if no supported inward path can be found, for example at tight corners or seam gaps." +"Uses the regular wipe where the outer wall has no adjacent inner wall, such as in single-wall areas, or if no supported inward path can be found, for example at tight corners or seam gaps." msgstr "" -"Chỉ áp dụng cho các thành ngoài, kể cả biên của lỗ. Trong lúc lau, đầu phun nóng được đưa về phía các thành trong đã in để giảm việc nung lại phần nhựa vừa in và giảm vết đường nối.\n" +"Chỉ áp dụng cho các thành ngoài, kể cả biên của lỗ. Trong lúc lau, đầu phun nóng được đưa về phía các thành trong để giảm việc nung lại phần nhựa vừa in và giảm vết đường nối.\n" "\n" "Đặc biệt hữu ích ở chiều cao lớp dưới 0,1 mm, nơi vết lau dễ thấy hơn.\n" "\n" -"Dùng cách lau thông thường nếu chưa có thành trong liền kề nào được in (vùng chỉ có một thành hoặc thứ tự thành Ngoài/Trong), hoặc nếu không tìm được đường đi vào trong có điểm tựa, ví dụ ở các góc hẹp hay khe hở đường nối." +"Dùng cách lau thông thường ở những nơi thành ngoài không có thành trong liền kề, như vùng chỉ có một thành, hoặc nếu không tìm được đường đi vào trong có điểm tựa, ví dụ ở các góc hẹp hay khe hở đường nối." # AI Translated msgid "Wipe inward distance" @@ -21016,11 +21016,15 @@ msgstr "Khoảng cách lau vào trong" msgid "" "The distance the wipe path is shifted away from the external perimeter, specified in millimeters or as a percentage of the actual outer-wall extrusion width.\n" "\n" -"For example, 50% shifts the path by half of the outer-wall width. The effective offset is limited by both the actual outer-wall width and the available spacing to the adjacent wall, so values above 100% or an equivalent absolute distance have no additional effect. Set to 0 to disable the offset." +"For example, 50% shifts the path by half of the outer-wall width. The effective offset is limited by both the actual outer-wall width and the available spacing to the adjacent wall, so values above 100% or an equivalent absolute distance have no additional effect. Set to 0 to disable the offset.\n" +"\n" +"With Outer/Inner or Inner/Outer/Inner wall order, the offset is limited to 50% of the actual outer-wall width because the adjacent inner wall is printed after the outer wall. This also applies to equivalent distances specified in millimeters." msgstr "" "Khoảng cách mà đường lau được dịch ra xa khỏi chu vi ngoài, tính bằng milimét hoặc theo phần trăm độ rộng đùn thực tế của thành ngoài.\n" "\n" -"Ví dụ, 50% dịch đường đi một nửa độ rộng thành ngoài. Độ dịch thực tế bị giới hạn bởi cả độ rộng thật của thành ngoài lẫn khoảng trống còn lại tới thành liền kề, nên các giá trị trên 100% hoặc khoảng cách tuyệt đối tương đương sẽ không có thêm tác dụng. Đặt 0 để tắt việc dịch chuyển." +"Ví dụ, 50% dịch đường đi một nửa độ rộng thành ngoài. Độ dịch thực tế bị giới hạn bởi cả độ rộng thật của thành ngoài lẫn khoảng trống còn lại tới thành liền kề, nên các giá trị trên 100% hoặc khoảng cách tuyệt đối tương đương sẽ không có thêm tác dụng. Đặt 0 để tắt việc dịch chuyển.\n" +"\n" +"Với thứ tự thành Ngoài/Trong hoặc Trong/Ngoài/Trong, độ dịch bị giới hạn ở 50% độ rộng thực tế của thành ngoài, vì thành trong liền kề được in sau thành ngoài. Điều này cũng áp dụng cho các khoảng cách tương đương tính bằng milimét." msgid "Wipe before external loop" msgstr "Lau trước vòng ngoài" @@ -25376,10 +25380,10 @@ msgstr "Phiên bản Klipper => 0.9.0" # AI Translated msgid "" -"RepRap firmware version => 3.4.0\n" +"RepRapFirmware version => 3.4.0\n" "Check your firmware documentation for supported shaper types." msgstr "" -"Phiên bản RepRap firmware => 3.4.0\n" +"Phiên bản RepRapFirmware => 3.4.0\n" "Hãy xem tài liệu firmware của bạn để biết các loại shaper được hỗ trợ." # AI Translated @@ -25398,8 +25402,8 @@ msgid "Frequency settings" msgstr "Cài đặt tần số" # AI Translated -msgid "RepRap firmware uses the same frequency range for both axes." -msgstr "RepRap firmware dùng cùng một dải tần số cho cả hai trục." +msgid "RepRapFirmware uses the same frequency range for both axes." +msgstr "RepRapFirmware dùng cùng một dải tần số cho cả hai trục." msgid "Damp: " msgstr "Giảm chấn: " @@ -25442,8 +25446,8 @@ msgid "Damp (Start / End): " msgstr "Giảm chấn (Bắt đầu / Kết thúc): " # AI Translated -msgid "RepRap firmware uses the same frequency for both axes." -msgstr "RepRap firmware dùng cùng một tần số cho cả hai trục." +msgid "RepRapFirmware uses the same frequency for both axes." +msgstr "RepRapFirmware dùng cùng một tần số cho cả hai trục." msgid "Note: Use previously calculated frequencies." msgstr "Lưu ý: Sử dụng tần số đã tính trước đó." diff --git a/localization/i18n/zh_CN/OrcaSlicer_zh_CN.po b/localization/i18n/zh_CN/OrcaSlicer_zh_CN.po index b106470fe2..1017a025dc 100644 --- a/localization/i18n/zh_CN/OrcaSlicer_zh_CN.po +++ b/localization/i18n/zh_CN/OrcaSlicer_zh_CN.po @@ -20780,17 +20780,17 @@ msgstr "向内擦拭" # AI Translated msgid "" -"Applies only to external walls, including hole boundaries. Moves the hot nozzle toward printed inner walls during wiping to reduce reheating of freshly printed plastic and seam marks.\n" +"Applies only to external walls, including hole boundaries. Moves the hot nozzle toward the inner walls during wiping to reduce reheating of freshly printed plastic and seam marks.\n" "\n" "Especially useful at layer heights below 0.1 mm, where wipe marks are more visible.\n" "\n" -"Uses the regular wipe if no adjacent inner wall is already printed (single-wall areas or Outer/Inner wall order), or if no supported inward path can be found, for example at tight corners or seam gaps." +"Uses the regular wipe where the outer wall has no adjacent inner wall, such as in single-wall areas, or if no supported inward path can be found, for example at tight corners or seam gaps." msgstr "" -"仅适用于外墙,包括孔洞边界。擦拭时将高温喷嘴移向已打印的内墙,以减少刚打印塑料的二次受热和接缝痕迹。\n" +"仅适用于外墙,包括孔洞边界。擦拭时将高温喷嘴移向内墙,以减少刚打印塑料的二次受热和接缝痕迹。\n" "\n" "在层高低于 0.1 mm 时尤其有用,此时擦拭痕迹更明显。\n" "\n" -"若相邻内墙尚未打印(单墙区域或外墙/内墙顺序),或找不到有支撑的向内路径(例如在锐角或接缝间隙处),则使用常规擦拭。" +"若外墙没有相邻的内墙(例如单墙区域),或找不到有支撑的向内路径(例如在锐角或接缝间隙处),则使用常规擦拭。" # AI Translated msgid "Wipe inward distance" @@ -20801,11 +20801,15 @@ msgstr "向内擦拭距离" msgid "" "The distance the wipe path is shifted away from the external perimeter, specified in millimeters or as a percentage of the actual outer-wall extrusion width.\n" "\n" -"For example, 50% shifts the path by half of the outer-wall width. The effective offset is limited by both the actual outer-wall width and the available spacing to the adjacent wall, so values above 100% or an equivalent absolute distance have no additional effect. Set to 0 to disable the offset." +"For example, 50% shifts the path by half of the outer-wall width. The effective offset is limited by both the actual outer-wall width and the available spacing to the adjacent wall, so values above 100% or an equivalent absolute distance have no additional effect. Set to 0 to disable the offset.\n" +"\n" +"With Outer/Inner or Inner/Outer/Inner wall order, the offset is limited to 50% of the actual outer-wall width because the adjacent inner wall is printed after the outer wall. This also applies to equivalent distances specified in millimeters." msgstr "" "擦拭路径偏离外墙轮廓的距离,以毫米或实际外墙挤出宽度的百分比指定。\n" "\n" -"例如,50% 会将路径偏移外墙宽度的一半。实际偏移量同时受实际外墙宽度和到相邻墙的可用间距限制,因此超过 100% 的值或等效的绝对距离不会产生额外效果。设为 0 可禁用偏移。" +"例如,50% 会将路径偏移外墙宽度的一半。实际偏移量同时受实际外墙宽度和到相邻墙的可用间距限制,因此超过 100% 的值或等效的绝对距离不会产生额外效果。设为 0 可禁用偏移。\n" +"\n" +"墙顺序为外墙/内墙或内墙/外墙/内墙时,相邻内墙在外墙之后打印,因此偏移量限制为实际外墙宽度的 50%。以毫米指定的等效距离同样适用此限制。" # AI Translated msgid "Wipe before external loop" @@ -25316,7 +25320,7 @@ msgid "Klipper version => 0.9.0" msgstr "Klipper 版本 => 0.9.0" msgid "" -"RepRap firmware version => 3.4.0\n" +"RepRapFirmware version => 3.4.0\n" "Check your firmware documentation for supported shaper types." msgstr "" "RepRap 固件版本 => 3.4.0\n" @@ -25337,7 +25341,7 @@ msgstr "Y 开始 / 结束: " msgid "Frequency settings" msgstr "频率设置" -msgid "RepRap firmware uses the same frequency range for both axes." +msgid "RepRapFirmware uses the same frequency range for both axes." msgstr "RepRap 固件将对两个轴使用相同的频率范围。" msgid "Damp: " @@ -25378,7 +25382,7 @@ msgstr "频率 X / Y: " msgid "Damp (Start / End): " msgstr "阻尼(开始 / 结束): " -msgid "RepRap firmware uses the same frequency for both axes." +msgid "RepRapFirmware uses the same frequency for both axes." msgstr "RepRap 固件将对两个轴使用相同的频率。" msgid "Note: Use previously calculated frequencies." diff --git a/localization/i18n/zh_TW/OrcaSlicer_zh_TW.po b/localization/i18n/zh_TW/OrcaSlicer_zh_TW.po index 30aae50434..8b038619bc 100644 --- a/localization/i18n/zh_TW/OrcaSlicer_zh_TW.po +++ b/localization/i18n/zh_TW/OrcaSlicer_zh_TW.po @@ -21209,17 +21209,17 @@ msgstr "向內擦拭" # AI Translated msgid "" -"Applies only to external walls, including hole boundaries. Moves the hot nozzle toward printed inner walls during wiping to reduce reheating of freshly printed plastic and seam marks.\n" +"Applies only to external walls, including hole boundaries. Moves the hot nozzle toward the inner walls during wiping to reduce reheating of freshly printed plastic and seam marks.\n" "\n" "Especially useful at layer heights below 0.1 mm, where wipe marks are more visible.\n" "\n" -"Uses the regular wipe if no adjacent inner wall is already printed (single-wall areas or Outer/Inner wall order), or if no supported inward path can be found, for example at tight corners or seam gaps." +"Uses the regular wipe where the outer wall has no adjacent inner wall, such as in single-wall areas, or if no supported inward path can be found, for example at tight corners or seam gaps." msgstr "" -"僅適用於外牆,包括孔洞邊界。擦拭時將高溫噴嘴移向已列印的內牆,以減少剛列印塑膠的二次受熱與接縫痕跡。\n" +"僅適用於外牆,包括孔洞邊界。擦拭時將高溫噴嘴移向內牆,以減少剛列印塑膠的二次受熱與接縫痕跡。\n" "\n" "在層高低於 0.1 mm 時特別有用,此時擦拭痕跡更明顯。\n" "\n" -"若相鄰內牆尚未列印(單牆區域或外牆/內牆順序),或找不到有支撐的向內路徑(例如在銳角或接縫間隙處),則使用一般擦拭。" +"若外牆沒有相鄰的內牆(例如單牆區域),或找不到有支撐的向內路徑(例如在銳角或接縫間隙處),則使用一般擦拭。" # AI Translated msgid "Wipe inward distance" @@ -21230,11 +21230,15 @@ msgstr "向內擦拭距離" msgid "" "The distance the wipe path is shifted away from the external perimeter, specified in millimeters or as a percentage of the actual outer-wall extrusion width.\n" "\n" -"For example, 50% shifts the path by half of the outer-wall width. The effective offset is limited by both the actual outer-wall width and the available spacing to the adjacent wall, so values above 100% or an equivalent absolute distance have no additional effect. Set to 0 to disable the offset." +"For example, 50% shifts the path by half of the outer-wall width. The effective offset is limited by both the actual outer-wall width and the available spacing to the adjacent wall, so values above 100% or an equivalent absolute distance have no additional effect. Set to 0 to disable the offset.\n" +"\n" +"With Outer/Inner or Inner/Outer/Inner wall order, the offset is limited to 50% of the actual outer-wall width because the adjacent inner wall is printed after the outer wall. This also applies to equivalent distances specified in millimeters." msgstr "" "擦拭路徑偏離外牆的距離,以公釐或實際外牆線寬的百分比指定。\n" "\n" -"例如,50% 會將路徑偏移外牆寬度的一半。實際偏移量同時受實際外牆寬度與到相鄰牆的可用間距限制,因此超過 100% 的值或等效的絕對距離不會產生額外效果。設為 0 可停用偏移。" +"例如,50% 會將路徑偏移外牆寬度的一半。實際偏移量同時受實際外牆寬度與到相鄰牆的可用間距限制,因此超過 100% 的值或等效的絕對距離不會產生額外效果。設為 0 可停用偏移。\n" +"\n" +"牆順序為外牆/內牆或內牆/外牆/內牆時,相鄰內牆會在外牆之後列印,因此偏移量限制為實際外牆寬度的 50%。以公釐指定的等效距離同樣適用此限制。" msgid "Wipe before external loop" msgstr "外牆迴圈前的擦拭動作" @@ -25825,7 +25829,7 @@ msgid "Klipper version => 0.9.0" msgstr "Klipper 版本 => 0.9.0" msgid "" -"RepRap firmware version => 3.4.0\n" +"RepRapFirmware version => 3.4.0\n" "Check your firmware documentation for supported shaper types." msgstr "" "RepRap 韌體版本 => 3.4.0\n" @@ -25846,7 +25850,7 @@ msgstr "Y 開始 / 結束: " msgid "Frequency settings" msgstr "頻率設定" -msgid "RepRap firmware uses the same frequency range for both axes." +msgid "RepRapFirmware uses the same frequency range for both axes." msgstr "RepRap 韌體對兩個軸使用相同的頻率範圍。" msgid "Damp: " @@ -25888,7 +25892,7 @@ msgstr "頻率 X / Y: " msgid "Damp (Start / End): " msgstr "阻尼(開始 / 結束): " -msgid "RepRap firmware uses the same frequency for both axes." +msgid "RepRapFirmware uses the same frequency for both axes." msgstr "RepRap 韌體對兩個軸使用相同的頻率。" msgid "Note: Use previously calculated frequencies." diff --git a/resources/shaders/110/gouraud.fs b/resources/shaders/110/gouraud.fs index 50789327c5..7ce85f89f1 100644 --- a/resources/shaders/110/gouraud.fs +++ b/resources/shaders/110/gouraud.fs @@ -35,10 +35,6 @@ uniform vec4 uniform_color_clip_plane_1; uniform vec4 uniform_color_clip_plane_2; uniform SlopeDetection slope; -//BBS: add outline_color -uniform bool is_outline; -uniform sampler2D depth_tex; -uniform vec2 screen_size; #ifdef ENABLE_ENVIRONMENT_MAP @@ -53,8 +49,6 @@ uniform PrintVolumeDetection print_volume; uniform vec3 extruder_printable_heights; const float ONE_OVER_EPSILON = 1e4; -uniform float z_far; -uniform float z_near; // Depth-based shadow map (object-on-object and self shadows). shadow_intensity == 0 disables it. uniform sampler2D shadow_map; @@ -79,71 +73,6 @@ varying vec4 world_pos; varying float world_normal_z; varying vec3 eye_normal; -vec3 getBackfaceColor(vec3 fill) { - float brightness = 0.2126 * fill.r + 0.7152 * fill.g + 0.0722 * fill.b; - return (brightness > 0.75) ? vec3(0.11, 0.165, 0.208) : vec3(0.988, 0.988, 0.988); -} - -// Silhouette edge detection & rendering algorithem by leoneruggiero -// https://www.shadertoy.com/view/DslXz2 -#define INFLATE 1 - -float GetTolerance(float d, float k) -{ - // ------------------------------------------- - // Find a tolerance for depth that is constant - // in view space (k in view space). - // - // tol = k*ddx(ZtoDepth(z)) - // ------------------------------------------- - - float A=- (z_far+z_near)/(z_far-z_near); - float B=-2.0*z_far*z_near /(z_far-z_near); - - d = d*2.0-1.0; - - return -k*(d+A)*(d+A)/B; -} - -float DetectSilho(vec2 fragCoord, vec2 dir) -{ - // ------------------------------------------- - // x0 ___ x1----o - // :\ : - // r0 : \ : r1 - // : \ : - // o---x2 ___ x3 - // - // r0 and r1 are the differences between actual - // and expected (as if x0..3 where on the same - // plane) depth values. - // ------------------------------------------- - - float x0 = abs(texture2D(depth_tex, (fragCoord + dir*-2.0) / screen_size).r); - float x1 = abs(texture2D(depth_tex, (fragCoord + dir*-1.0) / screen_size).r); - float x2 = abs(texture2D(depth_tex, (fragCoord + dir* 0.0) / screen_size).r); - float x3 = abs(texture2D(depth_tex, (fragCoord + dir* 1.0) / screen_size).r); - - float d0 = (x1-x0); - float d1 = (x2-x3); - - float r0 = x1 + d0 - x2; - float r1 = x2 + d1 - x1; - - float tol = GetTolerance(x2, 0.04); - - return smoothstep(0.0, tol*tol, max( - r0*r1, 0.0)); - -} - -float DetectSilho(vec2 fragCoord) -{ - return max( - DetectSilho(fragCoord, vec2(1,0)), // Horizontal - DetectSilho(fragCoord, vec2(0,1)) // Vertical - ); -} - // Returns a lighting multiplier in [1 - shadow_intensity, 1]: < 1 where the fragment is // occluded from the light in the shadow map. 3x3 PCF softens the edges. float shadow_shade() @@ -225,25 +154,10 @@ void main() } float shade = shadow_shade(); - //BBS: add outline_color - if (is_outline) { - color = vec4((vec3(intensity.y) + color.rgb * intensity.x) * shade, color.a); - vec2 fragCoord = gl_FragCoord.xy; - float s = DetectSilho(fragCoord); - // Makes silhouettes thicker. - for(int i=1;i<=INFLATE; i++) - { - s = max(s, DetectSilho(fragCoord.xy + vec2(i, 0))); - s = max(s, DetectSilho(fragCoord.xy + vec2(0, i))); - } - if (s < 0.01) - discard; - gl_FragColor = vec4(mix(color.rgb, getBackfaceColor(color.rgb), s), color.a); - } #ifdef ENABLE_ENVIRONMENT_MAP - else if (use_environment_tex) + if (use_environment_tex) gl_FragColor = vec4((0.45 * texture(environment_tex, normalize(eye_normal).xy * 0.5 + 0.5).xyz + 0.8 * color.rgb * intensity.x) * shade, color.a); -#endif else +#endif gl_FragColor = vec4((vec3(intensity.y) + color.rgb * intensity.x) * shade, color.a); } \ No newline at end of file diff --git a/resources/shaders/110/gouraud.vs b/resources/shaders/110/gouraud.vs index 5ee685c070..2d7e70c1d6 100644 --- a/resources/shaders/110/gouraud.vs +++ b/resources/shaders/110/gouraud.vs @@ -31,8 +31,6 @@ uniform mat4 projection_matrix; uniform mat3 view_normal_matrix; uniform mat4 volume_world_matrix; uniform SlopeDetection slope; -uniform bool is_outline; -uniform vec2 screen_size; // Clipping plane, x = min z, y = max z. Used by the FFF and SLA previews to clip with a top / bottom plane. uniform vec2 z_range; @@ -82,15 +80,6 @@ void main() world_normal_z = slope.actived ? dot(normalize(slope.volume_world_normal_matrix * v_normal), slope.up_direction) : 0.0; gl_Position = projection_matrix * position; - if (is_outline) { - vec3 n = normalize((view_normal_matrix * v_normal).xyz); - vec2 dir = normalize(n.xy); - if (dot(dir, dir) > 0.0) { - //set outline thickness - float px = 3.0; - gl_Position.xy += dir * (px * 2.0 / screen_size) * gl_Position.w; - } - } // Fill in the scalars for fragment shader clipping. Fragments with any of these components lower than zero are discarded. clipping_planes_dots = vec3(dot(world_pos, clipping_plane), world_pos.z - z_range.x, z_range.y - world_pos.z); color_clip_plane_dot = dot(world_pos, color_clip_plane); diff --git a/resources/shaders/110/outline.fs b/resources/shaders/110/outline.fs new file mode 100644 index 0000000000..b691e2f2d8 --- /dev/null +++ b/resources/shaders/110/outline.fs @@ -0,0 +1,219 @@ +#version 110 + +const float INF = 1e9; + +uniform sampler2D mask_tex; +uniform sampler2D depth_tex; +uniform sampler2D edges_tex; +uniform vec2 tex_size; +// false draws the ring around the selection, true the lines along its inner edges. +uniform bool inner; +// The stencil keeps the ring off the samples of the selection, without it the ring stays off covered pixels. +uniform bool use_stencil; +// Widths in pixels: x at least, y at most, z the width on the model in view space units. +uniform vec3 ring_width; +uniform int ring_reach; +uniform float ring_sigma; +// Half the width of an inner line, as ring_width. +uniform vec3 line_width; +uniform int line_reach; +uniform float line_opacity; +uniform vec3 outline_color; +// The projection on view z: window depth is (x * z + y) / (z * z + w), remapped from [-1, 1]. +uniform vec4 depth_coef; +// View space size of a pixel at view depth z: x * -z + y. +uniform vec2 pixel_size_coef; + +vec4 fetch_mask(ivec2 p) +{ + return texture2D(mask_tex, (vec2(p) + 0.5) / tex_size); +} + +float fetch_depth(ivec2 p) +{ + return texture2D(depth_tex, (vec2(p) + 0.5) / tex_size).r; +} + +vec4 fetch_edges(ivec2 p) +{ + return texture2D(edges_tex, (vec2(p) + 0.5) / tex_size); +} + +bool covered(vec4 m) +{ + return m.g > 0.0; +} + +// The texel and its eight neighbors are covered. +bool inside_mask(ivec2 p) +{ + for (int y = -1; y <= 1; ++y) + for (int x = -1; x <= 1; ++x) + if (!covered(fetch_mask(p + ivec2(x, y)))) + return false; + return true; +} + +// Strength and crossing of an inner edge written by outline_edges.fs. +vec2 unpack_edge(float c) +{ + float v = floor(c * 255.0 + 0.5); + float s = floor(v / 16.0); + return vec2(s, v - s * 16.0) / 15.0; +} + +float pixel_size(float z) +{ + return dot(pixel_size_coef, vec2(-z, 1.0)); +} + +// Thicker as the camera closes in, within a range of pixels. +float width_at(vec3 width, float z) +{ + return clamp(width.z / pixel_size(z), width.x, width.y); +} + +// A smooth edge 1.2 pixels wide around width. +float edge_alpha(float width, float d) +{ + return 1.0 - smoothstep(width - 0.6, width + 0.6, d); +} + +float view_z(float depth) +{ + float ndc = depth * 2.0 - 1.0; + return (depth_coef.y - ndc * depth_coef.w) / (ndc * depth_coef.z - depth_coef.x); +} + +float window_depth(float z) +{ + return 0.5 * (depth_coef.x * z + depth_coef.y) / (depth_coef.z * z + depth_coef.w) + 0.5; +} + +// One sided, so that the slope does not span an edge. Uncovered texels keep the cleared depth of 1. +float depth_slope(float d, float before, float after) +{ + float s = INF; + if (before < 1.0) s = abs(d - before); + if (after < 1.0) s = min(s, abs(after - d)); + return s < INF ? s : 0.0; +} + +// The depth of the selection at p, moved forward by its spread over the pixel, so that it passes on every sample. +float surface_depth(ivec2 p) +{ + float d = fetch_depth(p); + float sx = depth_slope(d, fetch_depth(p - ivec2(1, 0)), fetch_depth(p + ivec2(1, 0))); + float sy = depth_slope(d, fetch_depth(p - ivec2(0, 1)), fetch_depth(p + ivec2(0, 1))); + return d - 0.5 * (sx + sy) - 1e-6; +} + +// x beyond which a standard normal has p of its mass, for p up to 0.5 (Abramowitz and Stegun 26.2.23). +float normal_tail_inverse(float p) +{ + float t = sqrt(-2.0 * log(p)); + return t - (2.515517 + t * (0.802853 + t * 0.010328)) / (1.0 + t * (1.432788 + t * (0.189269 + t * 0.001308))); +} + +void render_ring(ivec2 p) +{ + vec4 m = fetch_mask(p); + float alpha = 1.0; + float depth; + if (covered(m)) { + // Only the silhouette of the mask may hold samples off the selection. Inside, a face the mask has and the + // scene culled, say, would get no stencil bit and fill with the ring. + if (!use_stencil || inside_mask(p)) + discard; + depth = surface_depth(p); + } + else { + // The nearest covered texel from the nearest one of each row, and the gaussian coverage around p. + float best = INF; + ivec2 t = p; + float coverage = 0.0; + float weights = 0.0; + for (int j = -ring_reach; j <= ring_reach; ++j) { + vec4 e = fetch_edges(p + ivec2(0, j)); + float w = exp(-float(j * j) / (2.0 * ring_sigma * ring_sigma)); + weights += w; + coverage += w * e.a; + float v = floor(e.b * 255.0 + 0.5); + if (v > 0.0) { + float h = v - 16.0; + float d2 = h * h + float(j * j); + if (d2 < best) { + best = d2; + t = p + ivec2(int(h), j); + } + } + } + if (best >= INF) + discard; + // The coverage of a straight silhouette at dist is the normal tail beyond dist / sigma. Corners and thin + // parts fall off faster, so it is kept within half a texel of the midpoint to the nearest covered texel. + coverage /= weights; + float centers = sqrt(best) - 0.5; + float dist = coverage < 0.5 ? ring_sigma * normal_tail_inverse(max(coverage, 1e-6)) : 0.0; + dist = clamp(dist, centers - 0.5, centers + 0.5); + float z = view_z(fetch_depth(t)); + alpha = edge_alpha(width_at(ring_width, z), dist); + if (alpha <= 0.0) + discard; + m = fetch_mask(t); + // Brought forward with the distance, so that it shows over what the selection stands on. + depth = window_depth(z + 3.0 * (dist + 2.0) * pixel_size(z)); + } + gl_FragColor = vec4(outline_color, alpha); + gl_FragDepth = depth; +} + +void render_lines(ivec2 p) +{ + vec4 m = fetch_mask(p); + if (!covered(m)) + discard; + + // The nearest crossing along the row and along the column. For a straight line at distance d they lie at + // dx = d / |cos| and dy = d / |sin|, so 1 / d^2 = 1 / dx^2 + 1 / dy^2. + float dx = INF; + float sx = 0.0; + for (int i = -line_reach - 1; i <= line_reach; ++i) { + vec2 e = unpack_edge(fetch_edges(p + ivec2(i, 0)).r); + float d = abs(float(i) + e.y); + if (e.x > 0.0 && d < dx) { + dx = d; + sx = e.x; + } + } + float dy = INF; + float sy = 0.0; + for (int j = -line_reach - 1; j <= line_reach; ++j) { + vec2 e = unpack_edge(fetch_edges(p + ivec2(0, j)).g); + float d = abs(float(j) + e.y); + if (e.x > 0.0 && d < dy) { + dy = d; + sy = e.x; + } + } + if (dx >= INF && dy >= INF) + discard; + float d = (dx < INF && dy < INF) ? dx * dy * inversesqrt(max(dx * dx + dy * dy, 1e-8)) : min(dx, dy); + // A line thinner on screen than the narrowest drawn fades instead, so that a far selection is not all lines. + float z = view_z(fetch_depth(p)); + float fade = clamp(line_width.z / (pixel_size(z) * line_width.x), 0.4, 1.0); + float alpha = line_opacity * fade * max(sx, sy) * edge_alpha(width_at(line_width, z), d); + if (alpha <= 0.0) + discard; + gl_FragColor = vec4(outline_color, alpha); + gl_FragDepth = surface_depth(p); +} + +void main() +{ + ivec2 p = ivec2(gl_FragCoord.xy); + if (inner) + render_lines(p); + else + render_ring(p); +} diff --git a/resources/shaders/110/outline_edges.fs b/resources/shaders/110/outline_edges.fs new file mode 100644 index 0000000000..31fd7602e4 --- /dev/null +++ b/resources/shaders/110/outline_edges.fs @@ -0,0 +1,139 @@ +#version 110 + +// A crease fades in as the angle between its faces grows from 25 to 40 degrees. +const float CREASE_COS_START = 0.906; +const float CREASE_COS_FULL = 0.766; + +uniform sampler2D mask_tex; +uniform sampler2D depth_tex; +uniform vec2 tex_size; +uniform mat4 inv_projection_matrix; +// View space size of a pixel at view depth z: x * -z + y. +uniform vec2 pixel_size_coef; +uniform int ring_reach; +uniform float ring_sigma; + +vec2 unpack2(float c) +{ + float v = floor(c * 65535.0 + 0.5); + float hi = floor(v / 256.0); + return vec2(hi, v - hi * 256.0); +} + +vec4 fetch_mask(ivec2 p) +{ + return texture2D(mask_tex, (vec2(p) + 0.5) / tex_size); +} + +float fetch_depth(ivec2 p) +{ + return texture2D(depth_tex, (vec2(p) + 0.5) / tex_size).r; +} + +bool covered(vec4 m) +{ + return m.g > 0.0; +} + +vec3 normal_of(vec4 m) +{ + vec2 e = unpack2(m.r) / 255.0 * 2.0 - 1.0; + vec3 n = vec3(e, 1.0 - abs(e.x) - abs(e.y)); + if (n.z < 0.0) + n.xy = (1.0 - abs(n.yx)) * vec2(n.x >= 0.0 ? 1.0 : -1.0, n.y >= 0.0 ? 1.0 : -1.0); + return normalize(n); +} + +vec3 view_position(ivec2 p, float depth) +{ + vec4 v = inv_projection_matrix * vec4((vec2(p) + 0.5) / tex_size * 2.0 - 1.0, depth * 2.0 - 1.0, 1.0); + return v.xyz / v.w; +} + +// 1 for a turn between neighboring texels of about 7 to 23 degrees: neither flat nor a crease. +float gradual_turn(float cos_angle) +{ + return (1.0 - smoothstep(0.985, 0.997, cos_angle)) * smoothstep(0.88, 0.92, cos_angle); +} + +float pack_edge(float strength, float crossing) +{ + return (floor(strength * 15.0 + 0.5) * 16.0 + floor(clamp(crossing, 0.0, 1.0) * 15.0 + 0.5) + 0.25) / 255.0; +} + +// The inner edge between q and q + dir: how strong it is, and where it crosses from q (0) to q + dir (1). +float inner_edge(ivec2 q, ivec2 dir) +{ + vec4 m0 = fetch_mask(q); + vec4 m1 = fetch_mask(q + dir); + // The silhouette is drawn by the ring. + if (!covered(m0) || !covered(m1)) + return 0.0; + + vec3 n0 = normal_of(m0); + vec3 n1 = normal_of(m1); + vec4 mb = fetch_mask(q - dir); + vec4 ma = fetch_mask(q + 2 * dir); + vec3 nb = covered(mb) ? normal_of(mb) : n0; + vec3 na = covered(ma) ? normal_of(ma) : n1; + float d0 = fetch_depth(q); + float d1 = fetch_depth(q + dir); + float db = fetch_depth(q - dir); + float da = fetch_depth(q + 2 * dir); + vec3 p0 = view_position(q, d0); + vec3 p1 = view_position(q + dir, d1); + // One surface hides the other: they are pixels apart off their planes. + vec3 d = p1 - p0; + float px = dot(pixel_size_coef, vec2(-max(p0.z, p1.z), 1.0)); + float jump = smoothstep(2.0, 4.0, max(abs(dot(n0, d)), abs(dot(n1, d))) / px); + // A step: the texel after the pair lies pixels off the surface before it carried on, both ways, which a surface + // seen edge on does not. + float off = 1e9; + if (covered(mb)) + off = length(p1 - (2.0 * p0 - view_position(q - dir, db))); + if (covered(ma)) + off = min(off, length(p0 - (2.0 * p1 - view_position(q + 2 * dir, da)))); + if (off < 1e9) + jump *= smoothstep(1.0, 2.0, off / px); + // Nor a fillet, which turns a little at every texel on both sides. + jump *= 1.0 - gradual_turn(dot(nb, n0)) * gradual_turn(dot(n1, na)); + float crease = 1.0 - smoothstep(CREASE_COS_FULL, CREASE_COS_START, dot(n0, n1)); + float strength = m0.g == m1.g ? max(jump, crease) : 1.0; + if (strength <= 0.0) + return 0.0; + + // Where the depth planes of both sides meet, when each side is flat over two texels and the planes part + // clearly along dir. + float crossing = 0.5; + if (covered(mb) && covered(ma) && dot(nb, n0) > 0.999 && dot(na, n1) > 0.999) { + float a = d0 - db; + float b = da - d1; + float u = (d1 - d0 - b) / (a - b); + if (abs(a - b) > 0.1 * (abs(a) + abs(b)) && u >= 0.0 && u <= 1.0) + crossing = u; + } + return pack_edge(strength, crossing); +} + +void main() +{ + ivec2 q = ivec2(gl_FragCoord.xy); + + // For the ring around the selection: the nearest covered texel along the row, offset by 16, and the + // coverage of the row under a gaussian, whose sum over the column sets the silhouette between texels. + float nearest = 0.0; + float coverage = 0.0; + float weights = 0.0; + for (int k = -ring_reach; k <= ring_reach; ++k) { + float w = exp(-float(k * k) / (2.0 * ring_sigma * ring_sigma)); + weights += w; + if (covered(fetch_mask(q + ivec2(k, 0)))) { + coverage += w; + if (nearest == 0.0 || abs(float(k)) < abs(nearest - 16.0)) + nearest = float(16 + k); + } + } + + gl_FragColor = vec4(inner_edge(q, ivec2(1, 0)), inner_edge(q, ivec2(0, 1)), + nearest > 0.0 ? (nearest + 0.25) / 255.0 : 0.0, coverage / weights); +} diff --git a/resources/shaders/110/outline_mask.fs b/resources/shaders/110/outline_mask.fs new file mode 100644 index 0000000000..58755b8136 --- /dev/null +++ b/resources/shaders/110/outline_mask.fs @@ -0,0 +1,37 @@ +#version 110 + +const vec3 ZERO = vec3(0.0, 0.0, 0.0); + +// 1 to 65535, told apart between neighboring volumes. +uniform float part_id; + +varying vec3 clipping_planes_dots; +varying vec3 eye_normal; +varying vec3 to_camera; + +// Two bytes in one channel of the 16 bit target, offset so that a truncating conversion keeps them. +float pack2(float hi, float lo) +{ + return (hi * 256.0 + lo + 0.25) / 65535.0; +} + +vec2 oct_encode(vec3 n) +{ + n /= abs(n.x) + abs(n.y) + abs(n.z); + vec2 e = n.z >= 0.0 ? n.xy : (1.0 - abs(n.yx)) * vec2(n.x >= 0.0 ? 1.0 : -1.0, n.y >= 0.0 ? 1.0 : -1.0); + return floor((e * 0.5 + 0.5) * 255.0 + 0.5); +} + +void main() +{ + if (any(lessThan(clipping_planes_dots, ZERO))) + discard; + + // Back faces show through cuts, so every surface is compared by its side facing the camera. + vec3 n = normalize(eye_normal); + if (dot(n, to_camera) < 0.0) + n = -n; + vec2 e = oct_encode(n); + // Without gl_VertexID there are no barycentrics to tell where the triangle ends. + gl_FragColor = vec4(pack2(e.x, e.y), (part_id + 0.25) / 65535.0, 0.0, 0.0); +} diff --git a/resources/shaders/110/outline_mask.vs b/resources/shaders/110/outline_mask.vs new file mode 100644 index 0000000000..a09d2ed882 --- /dev/null +++ b/resources/shaders/110/outline_mask.vs @@ -0,0 +1,30 @@ +#version 110 + +uniform mat4 view_model_matrix; +uniform mat4 projection_matrix; +uniform mat3 view_normal_matrix; +uniform mat4 volume_world_matrix; + +// Clipping plane, x = min z, y = max z. Used by the FFF and SLA previews to clip with a top / bottom plane. +uniform vec2 z_range; +// Clipping plane - general orientation. Used by the SLA gizmo. +uniform vec4 clipping_plane; + +attribute vec3 v_position; +attribute vec3 v_normal; + +varying vec3 clipping_planes_dots; +varying vec3 eye_normal; +varying vec3 to_camera; + +void main() +{ + vec4 world_pos = volume_world_matrix * vec4(v_position, 1.0); + clipping_planes_dots = vec3(dot(world_pos, clipping_plane), world_pos.z - z_range.x, z_range.y - world_pos.z); + + vec4 position = view_model_matrix * vec4(v_position, 1.0); + eye_normal = view_normal_matrix * v_normal; + // projection_matrix[3][3] is 1 only for an orthographic camera, whose view rays all run along -z. + to_camera = mix(-position.xyz, vec3(0.0, 0.0, 1.0), projection_matrix[3][3]); + gl_Position = projection_matrix * position; +} diff --git a/resources/shaders/110/phong.fs b/resources/shaders/110/phong.fs index 7d1e7bfe8c..fd8c5575ec 100644 --- a/resources/shaders/110/phong.fs +++ b/resources/shaders/110/phong.fs @@ -50,10 +50,6 @@ uniform vec4 uniform_color_clip_plane_1; uniform vec4 uniform_color_clip_plane_2; uniform SlopeDetection slope; -//BBS: add outline_color -uniform bool is_outline; -uniform sampler2D depth_tex; -uniform vec2 screen_size; #ifdef ENABLE_ENVIRONMENT_MAP uniform sampler2D environment_tex; @@ -62,8 +58,6 @@ uniform vec2 screen_size; uniform PrintVolumeDetection print_volume; -uniform float z_far; -uniform float z_near; uniform bool enable_ssao; // 1 = the Design tab's studio lighting (studio_shade below); 0 = the two-light model above, which // every other canvas keeps. world_up_eye is world +Z in eye space, for the hemisphere ambient. @@ -88,51 +82,6 @@ varying float world_normal_z; varying vec3 eye_normal; varying vec3 eye_position; -vec3 getBackfaceColor(vec3 fill) { - float brightness = 0.2126 * fill.r + 0.7152 * fill.g + 0.0722 * fill.b; - return (brightness > 0.75) ? vec3(0.11, 0.165, 0.208) : vec3(0.988, 0.988, 0.988); -} - -// Silhouette edge detection & rendering algorithm by leoneruggiero -// https://www.shadertoy.com/view/DslXz2 -#define INFLATE 1 - -float GetTolerance(float d, float k) -{ - float A = -(z_far+z_near)/(z_far-z_near); - float B = -2.0*z_far*z_near /(z_far-z_near); - - d = d*2.0-1.0; - - return -k*(d+A)*(d+A)/B; -} - -float DetectSilho(vec2 fragCoord, vec2 dir) -{ - float x0 = abs(texture2D(depth_tex, (fragCoord + dir*-2.0) / screen_size).r); - float x1 = abs(texture2D(depth_tex, (fragCoord + dir*-1.0) / screen_size).r); - float x2 = abs(texture2D(depth_tex, (fragCoord + dir* 0.0) / screen_size).r); - float x3 = abs(texture2D(depth_tex, (fragCoord + dir* 1.0) / screen_size).r); - - float d0 = (x1-x0); - float d1 = (x2-x3); - - float r0 = x1 + d0 - x2; - float r1 = x2 + d1 - x1; - - float tol = GetTolerance(x2, 0.04); - - return smoothstep(0.0, tol*tol, max( - r0*r1, 0.0)); -} - -float DetectSilho(vec2 fragCoord) -{ - return max( - DetectSilho(fragCoord, vec2(1,0)), - DetectSilho(fragCoord, vec2(0,1)) - ); -} - float compute_ssao_factor(vec3 normal, vec3 view_dir, vec3 eye_pos) { vec3 normal_dx = dFdx(normal); @@ -295,24 +244,10 @@ void main() vec3 lit = (lighting_model == 1) ? studio_shade(color.rgb, normal, view_dir) : (vec3(specular) + window_reflection + color.rgb * diffuse) * PHONG_BRIGHTNESS; - if (is_outline) { - vec3 shaded_rgb = lit * shade; - vec4 shaded_color = vec4(clamp(shaded_rgb, vec3(0.0), vec3(1.0)), color.a); - vec2 fragCoord = gl_FragCoord.xy; - float s = DetectSilho(fragCoord); - for(int i=1;i<=INFLATE; i++) - { - s = max(s, DetectSilho(fragCoord.xy + vec2(i, 0))); - s = max(s, DetectSilho(fragCoord.xy + vec2(0, i))); - } - if (s < 0.01) - discard; - gl_FragColor = vec4(mix(shaded_color.rgb, getBackfaceColor(shaded_color.rgb), s), shaded_color.a); - } #ifdef ENABLE_ENVIRONMENT_MAP - else if (use_environment_tex) + if (use_environment_tex) gl_FragColor = vec4(clamp((0.45 * texture2D(environment_tex, normalize(eye_normal).xy * 0.5 + 0.5).xyz + window_reflection + 0.8 * color.rgb * diffuse) * PHONG_BRIGHTNESS * shade, vec3(0.0), vec3(1.0)), color.a); -#endif else +#endif gl_FragColor = vec4(clamp(lit * shade, vec3(0.0), vec3(1.0)), color.a); } \ No newline at end of file diff --git a/resources/shaders/110/phong.vs b/resources/shaders/110/phong.vs index d857147c28..320971afaa 100644 --- a/resources/shaders/110/phong.vs +++ b/resources/shaders/110/phong.vs @@ -15,8 +15,6 @@ uniform mat4 projection_matrix; uniform mat3 view_normal_matrix; uniform mat4 volume_world_matrix; uniform SlopeDetection slope; -uniform bool is_outline; -uniform vec2 screen_size; // Clipping plane, x = min z, y = max z. Used by the FFF and SLA previews to clip with a top / bottom plane. uniform vec2 z_range; @@ -51,15 +49,6 @@ void main() world_normal_z = slope.actived ? dot(normalize(slope.volume_world_normal_matrix * v_normal), slope.up_direction) : 0.0; gl_Position = projection_matrix * position; - if (is_outline) { - vec3 n = normalize((view_normal_matrix * v_normal).xyz); - vec2 dir = normalize(n.xy); - if (dot(dir, dir) > 0.0) { - //set outline thickness - float px = 3.0; - gl_Position.xy += dir * (px * 2.0 / screen_size) * gl_Position.w; - } - } // Fill in the scalars for fragment shader clipping. Fragments with any of these components lower than zero are discarded. clipping_planes_dots = vec3(dot(world_pos, clipping_plane), world_pos.z - z_range.x, z_range.y - world_pos.z); color_clip_plane_dot = dot(world_pos, color_clip_plane); diff --git a/resources/shaders/110/ssao.fs b/resources/shaders/110/ssao.fs index db266daba1..e2871d8ede 100644 --- a/resources/shaders/110/ssao.fs +++ b/resources/shaders/110/ssao.fs @@ -9,7 +9,6 @@ uniform sampler2D color_texture; uniform sampler2D depth_texture; uniform vec2 inv_tex_size; uniform float z_far; -uniform bool is_outline; // The pass has no normal target to read, so the surface normal is reconstructed from the depth // buffer. inv_projection_matrix unprojects a pixel back into view space and up_view is world +Z // expressed in view space, which is what tells a top surface from a wall. @@ -43,10 +42,6 @@ vec3 view_normal(vec2 uv, vec3 p) void main() { - if (is_outline) { - gl_FragColor = vec4(texture2D(color_texture, tex_coord).rgb, 1.0); - return; - } vec3 base = texture2D(color_texture, tex_coord).rgb; // Nothing was drawn here: occluding the background would only darken the gradient, and its diff --git a/resources/shaders/140/gouraud.fs b/resources/shaders/140/gouraud.fs index 0c9011d634..2a259fe04a 100644 --- a/resources/shaders/140/gouraud.fs +++ b/resources/shaders/140/gouraud.fs @@ -1,7 +1,4 @@ #version 140 -// Multisample depth texture for the anti-aliased outline (see 3DScene.cpp render_with_outline). -// Optional on the GLSL 140 path: if unavailable, fallback to a non-multisample depth texture. -#extension GL_ARB_texture_multisample : enable const vec3 ZERO = vec3(0.0, 0.0, 0.0); //BBS: add grey and orange @@ -38,21 +35,10 @@ uniform vec4 uniform_color_clip_plane_1; uniform vec4 uniform_color_clip_plane_2; uniform SlopeDetection slope; -//BBS: add outline_color -uniform bool is_outline; // ORCA: a part of a translucent filament, drawn as its print would show in premultiplied color, see // GLVolumeCollection::render(). It catches a highlight only with translucent_gloss, in realistic view. uniform bool translucent_filament; uniform bool translucent_gloss; -// The outline is a per-fragment discard mask, which the framebuffer MSAA cannot smooth, so the -// silhouette is resolved per sample from a multisample copy of the outlined model's depth buffer. -#ifdef GL_ARB_texture_multisample -uniform sampler2DMS depth_tex; -uniform int msaa_samples; // samples in depth_tex, 1 when MSAA is off -#else -uniform sampler2D depth_tex; -#endif -uniform vec2 screen_size; #ifdef ENABLE_ENVIRONMENT_MAP uniform sampler2D environment_tex; @@ -66,8 +52,6 @@ uniform PrintVolumeDetection print_volume; uniform vec3 extruder_printable_heights; const float ONE_OVER_EPSILON = 1e4; -uniform float z_far; -uniform float z_near; // Depth-based shadow map (object-on-object and self shadows). shadow_intensity == 0 disables it. uniform sampler2D shadow_map; @@ -92,113 +76,6 @@ in vec4 world_pos; in float world_normal_z; in vec3 eye_normal; -vec3 getBackfaceColor(vec3 fill) { - float brightness = 0.2126 * fill.r + 0.7152 * fill.g + 0.0722 * fill.b; - return (brightness > 0.75) ? vec3(0.11, 0.165, 0.208) : vec3(0.988, 0.988, 0.988); -} - -// Silhouette edge detection & rendering algorithem by leoneruggiero -// https://www.shadertoy.com/view/DslXz2 -#define INFLATE 1 - -float GetTolerance(float d, float k) -{ - // ------------------------------------------- - // Find a tolerance for depth that is constant - // in view space (k in view space). - // - // tol = k*ddx(ZtoDepth(z)) - // ------------------------------------------- - - float A=- (z_far+z_near)/(z_far-z_near); - float B=-2.0*z_far*z_near /(z_far-z_near); - - d = d*2.0-1.0; - - return -k*(d+A)*(d+A)/B; -} - -// Depth of sample s at integer pixel coord. -#ifdef GL_ARB_texture_multisample -float FetchDepth(ivec2 coord, int s) -{ - // texelFetch has no wrap mode, so clamp to the edge texel (sampler2D used CLAMP_TO_EDGE). - ivec2 sz = textureSize(depth_tex); - return abs(texelFetch(depth_tex, clamp(coord, ivec2(0), sz - 1), s).r); -} -#else -float FetchDepth(ivec2 coord, int s) -{ - return abs(texture(depth_tex, (vec2(coord) + 0.5) / screen_size).r); -} -#endif - -float DetectSilho(ivec2 coord, ivec2 dir, int s) -{ - // ------------------------------------------- - // x0 ___ x1----o - // :\ : - // r0 : \ : r1 - // : \ : - // o---x2 ___ x3 - // - // r0 and r1 are the differences between actual - // and expected (as if x0..3 where on the same - // plane) depth values. - // ------------------------------------------- - float x0 = FetchDepth(coord + dir*-2, s); - float x1 = FetchDepth(coord + dir*-1, s); - float x2 = FetchDepth(coord, s); - float x3 = FetchDepth(coord + dir* 1, s); - - float d0 = (x1-x0); - float d1 = (x2-x3); - - float r0 = x1 + d0 - x2; - float r1 = x2 + d1 - x1; - - float tol = GetTolerance(x2, 0.04); - - return smoothstep(0.0, tol*tol, max( - r0*r1, 0.0)); -} - -float DetectSilho(ivec2 coord, int s) -{ - return max( - DetectSilho(coord, ivec2(1,0), s), // Horizontal - DetectSilho(coord, ivec2(0,1), s) // Vertical - ); -} - -// Full response of one sample. Reduce the max() per sample and average only afterwards: -// max(mean) <= mean(max), and averaging first hollows out diagonal and curved lines. -float DetectSilhoSample(ivec2 coord, int s) -{ - float v = DetectSilho(coord, s); - // Makes silhouettes thicker. - for (int i = 1; i <= INFLATE; ++i) - { - v = max(v, DetectSilho(coord + ivec2(i, 0), s)); - v = max(v, DetectSilho(coord + ivec2(0, i), s)); - } - return v; -} - -// Average the per-sample coverage into the sub-pixel anti-aliasing of the line. -float DetectSilho(vec2 fragCoord) -{ - ivec2 coord = ivec2(fragCoord); -#ifdef GL_ARB_texture_multisample - int n = max(msaa_samples, 1); -#else - const int n = 1; -#endif - float acc = 0.0; - for (int s = 0; s < n; ++s) - acc += DetectSilhoSample(coord, s); - return acc / float(n); -} - // Returns a lighting multiplier in [1 - shadow_intensity, 1]: < 1 where the fragment is // occluded from the light in the shadow map. 3x3 PCF softens the edges. float shadow_shade() @@ -290,21 +167,12 @@ void main() } float shade = shadow_shade(); - //BBS: add outline_color - if (is_outline) { - color = vec4((vec3(intensity.y) + color.rgb * intensity.x) * shade, color.a); - float s = DetectSilho(gl_FragCoord.xy); - if (s < 0.01) - discard; - out_color = vec4(mix(color.rgb, getBackfaceColor(color.rgb), s), color.a); - if (translucent_filament) - out_color.rgb *= out_color.a; - } #ifdef ENABLE_ENVIRONMENT_MAP - else if (use_environment_tex) + if (use_environment_tex) out_color = vec4((0.45 * texture(environment_tex, normalize(eye_normal).xy * 0.5 + 0.5).xyz + 0.8 * color.rgb * intensity.x) * shade, color.a); + else #endif - else if (translucent_filament) + if (translucent_filament) out_color = translucent_filament_color(color.rgb * intensity.x * shade, color.a, translucent_gloss ? vec3(intensity.y * shade) : ZERO, abs(normalize(eye_normal).z)); else diff --git a/resources/shaders/140/gouraud.vs b/resources/shaders/140/gouraud.vs index 7f753a3059..5777a64102 100644 --- a/resources/shaders/140/gouraud.vs +++ b/resources/shaders/140/gouraud.vs @@ -31,8 +31,6 @@ uniform mat4 projection_matrix; uniform mat3 view_normal_matrix; uniform mat4 volume_world_matrix; uniform SlopeDetection slope; -uniform bool is_outline; -uniform vec2 screen_size; // Clipping plane, x = min z, y = max z. Used by the FFF and SLA previews to clip with a top / bottom plane. uniform vec2 z_range; @@ -82,15 +80,6 @@ void main() world_normal_z = slope.actived ? dot(normalize(slope.volume_world_normal_matrix * v_normal), slope.up_direction) : 0.0; gl_Position = projection_matrix * position; - if (is_outline) { - vec3 n = normalize((view_normal_matrix * v_normal).xyz); - vec2 dir = normalize(n.xy); - if (dot(dir, dir) > 0.0) { - //set outline thickness - float px = 3.0; - gl_Position.xy += dir * (px * 2.0 / screen_size) * gl_Position.w; - } - } // Fill in the scalars for fragment shader clipping. Fragments with any of these components lower than zero are discarded. clipping_planes_dots = vec3(dot(world_pos, clipping_plane), world_pos.z - z_range.x, z_range.y - world_pos.z); color_clip_plane_dot = dot(world_pos, color_clip_plane); diff --git a/resources/shaders/140/outline.fs b/resources/shaders/140/outline.fs new file mode 100644 index 0000000000..338de9f4db --- /dev/null +++ b/resources/shaders/140/outline.fs @@ -0,0 +1,223 @@ +#version 140 + +const float INF = 1e9; + +uniform sampler2D mask_tex; +uniform sampler2D depth_tex; +uniform sampler2D edges_tex; +// false draws the ring around the selection, true the lines along its inner edges. +uniform bool inner; +// The stencil keeps the ring off the samples of the selection, without it the ring stays off covered pixels. +uniform bool use_stencil; +// Widths in pixels: x at least, y at most, z the width on the model in view space units. +uniform vec3 ring_width; +uniform int ring_reach; +uniform float ring_sigma; +// Half the width of an inner line, as ring_width. +uniform vec3 line_width; +uniform int line_reach; +uniform float line_opacity; +uniform vec3 outline_color; +// The projection on view z: window depth is (x * z + y) / (z * z + w), remapped from [-1, 1]. +uniform vec4 depth_coef; +// View space size of a pixel at view depth z: x * -z + y. +uniform vec2 pixel_size_coef; + +out vec4 out_color; + +ivec2 tex_size; + +vec4 fetch_mask(ivec2 p) +{ + return texelFetch(mask_tex, clamp(p, ivec2(0), tex_size - 1), 0); +} + +float fetch_depth(ivec2 p) +{ + return texelFetch(depth_tex, clamp(p, ivec2(0), tex_size - 1), 0).r; +} + +vec4 fetch_edges(ivec2 p) +{ + return texelFetch(edges_tex, clamp(p, ivec2(0), tex_size - 1), 0); +} + +bool covered(vec4 m) +{ + return m.g > 0.0; +} + +// The texel and its eight neighbors are covered. +bool inside_mask(ivec2 p) +{ + for (int y = -1; y <= 1; ++y) + for (int x = -1; x <= 1; ++x) + if (!covered(fetch_mask(p + ivec2(x, y)))) + return false; + return true; +} + +// Strength and crossing of an inner edge written by outline_edges.fs. +vec2 unpack_edge(float c) +{ + float v = floor(c * 255.0 + 0.5); + float s = floor(v / 16.0); + return vec2(s, v - s * 16.0) / 15.0; +} + +float pixel_size(float z) +{ + return dot(pixel_size_coef, vec2(-z, 1.0)); +} + +// Thicker as the camera closes in, within a range of pixels. +float width_at(vec3 width, float z) +{ + return clamp(width.z / pixel_size(z), width.x, width.y); +} + +// A smooth edge 1.2 pixels wide around width. +float edge_alpha(float width, float d) +{ + return 1.0 - smoothstep(width - 0.6, width + 0.6, d); +} + +float view_z(float depth) +{ + float ndc = depth * 2.0 - 1.0; + return (depth_coef.y - ndc * depth_coef.w) / (ndc * depth_coef.z - depth_coef.x); +} + +float window_depth(float z) +{ + return 0.5 * (depth_coef.x * z + depth_coef.y) / (depth_coef.z * z + depth_coef.w) + 0.5; +} + +// One sided, so that the slope does not span an edge. Uncovered texels keep the cleared depth of 1. +float depth_slope(float d, float before, float after) +{ + float s = INF; + if (before < 1.0) s = abs(d - before); + if (after < 1.0) s = min(s, abs(after - d)); + return s < INF ? s : 0.0; +} + +// The depth of the selection at p, moved forward by its spread over the pixel, so that it passes on every sample. +float surface_depth(ivec2 p) +{ + float d = fetch_depth(p); + float sx = depth_slope(d, fetch_depth(p - ivec2(1, 0)), fetch_depth(p + ivec2(1, 0))); + float sy = depth_slope(d, fetch_depth(p - ivec2(0, 1)), fetch_depth(p + ivec2(0, 1))); + return d - 0.5 * (sx + sy) - 1e-6; +} + +// x beyond which a standard normal has p of its mass, for p up to 0.5 (Abramowitz and Stegun 26.2.23). +float normal_tail_inverse(float p) +{ + float t = sqrt(-2.0 * log(p)); + return t - (2.515517 + t * (0.802853 + t * 0.010328)) / (1.0 + t * (1.432788 + t * (0.189269 + t * 0.001308))); +} + +void render_ring(ivec2 p) +{ + vec4 m = fetch_mask(p); + float alpha = 1.0; + float depth; + if (covered(m)) { + // Only the silhouette of the mask may hold samples off the selection. Inside, a face the mask has and the + // scene culled, say, would get no stencil bit and fill with the ring. + if (!use_stencil || inside_mask(p)) + discard; + depth = surface_depth(p); + } + else { + // The nearest covered texel from the nearest one of each row, and the gaussian coverage around p. + float best = INF; + ivec2 t = p; + float coverage = 0.0; + float weights = 0.0; + for (int j = -ring_reach; j <= ring_reach; ++j) { + vec4 e = fetch_edges(p + ivec2(0, j)); + float w = exp(-float(j * j) / (2.0 * ring_sigma * ring_sigma)); + weights += w; + coverage += w * e.a; + float v = floor(e.b * 255.0 + 0.5); + if (v > 0.0) { + float h = v - 16.0; + float d2 = h * h + float(j * j); + if (d2 < best) { + best = d2; + t = p + ivec2(int(h), j); + } + } + } + if (best >= INF) + discard; + m = fetch_mask(t); + // The coverage of a straight silhouette at dist is the normal tail beyond dist / sigma. Corners and thin + // parts fall off faster, so it is kept within half a texel of the midpoint to the nearest covered texel. + coverage /= weights; + float centers = sqrt(best) - 0.5; + float dist = coverage < 0.5 ? ring_sigma * normal_tail_inverse(max(coverage, 1e-6)) : 0.0; + dist = clamp(dist, centers - 0.5, centers + 0.5); + float z = view_z(fetch_depth(t)); + alpha = edge_alpha(width_at(ring_width, z), dist); + if (alpha <= 0.0) + discard; + // Brought forward with the distance, so that it shows over what the selection stands on. + depth = window_depth(z + 3.0 * (dist + 2.0) * pixel_size(z)); + } + out_color = vec4(outline_color, alpha); + gl_FragDepth = depth; +} + +void render_lines(ivec2 p) +{ + vec4 m = fetch_mask(p); + if (!covered(m)) + discard; + + // The nearest crossing along the row and along the column. For a straight line at distance d they lie at + // dx = d / |cos| and dy = d / |sin|, so 1 / d^2 = 1 / dx^2 + 1 / dy^2. + float dx = INF; + float sx = 0.0; + for (int i = -line_reach - 1; i <= line_reach; ++i) { + vec2 e = unpack_edge(fetch_edges(p + ivec2(i, 0)).r); + float d = abs(float(i) + e.y); + if (e.x > 0.0 && d < dx) { + dx = d; + sx = e.x; + } + } + float dy = INF; + float sy = 0.0; + for (int j = -line_reach - 1; j <= line_reach; ++j) { + vec2 e = unpack_edge(fetch_edges(p + ivec2(0, j)).g); + float d = abs(float(j) + e.y); + if (e.x > 0.0 && d < dy) { + dy = d; + sy = e.x; + } + } + if (dx >= INF && dy >= INF) + discard; + float d = (dx < INF && dy < INF) ? dx * dy * inversesqrt(max(dx * dx + dy * dy, 1e-8)) : min(dx, dy); + // A line thinner on screen than the narrowest drawn fades instead, so that a far selection is not all lines. + float z = view_z(fetch_depth(p)); + float fade = clamp(line_width.z / (pixel_size(z) * line_width.x), 0.4, 1.0); + float alpha = line_opacity * fade * max(sx, sy) * edge_alpha(width_at(line_width, z), d); + if (alpha <= 0.0) + discard; + out_color = vec4(outline_color, alpha); + gl_FragDepth = surface_depth(p); +} + +void main() +{ + tex_size = textureSize(mask_tex, 0); + ivec2 p = ivec2(gl_FragCoord.xy); + if (inner) + render_lines(p); + else + render_ring(p); +} diff --git a/resources/shaders/140/outline_edges.fs b/resources/shaders/140/outline_edges.fs new file mode 100644 index 0000000000..c93f321eb3 --- /dev/null +++ b/resources/shaders/140/outline_edges.fs @@ -0,0 +1,209 @@ +#version 140 + +// Farthest triangle edge distance stored by outline_mask.fs, in pixels. +const float EXIT_REACH = 4.0; +// A crease fades in as the angle between its faces grows from 25 to 40 degrees. +const float CREASE_COS_START = 0.906; +const float CREASE_COS_FULL = 0.766; + +uniform sampler2D mask_tex; +uniform sampler2D depth_tex; +uniform mat4 inv_projection_matrix; +// View space size of a pixel at view depth z: x * -z + y. +uniform vec2 pixel_size_coef; +uniform int ring_reach; +uniform float ring_sigma; + +out vec4 out_color; + +ivec2 tex_size; + +vec2 unpack2(float c) +{ + float v = floor(c * 65535.0 + 0.5); + float hi = floor(v / 256.0); + return vec2(hi, v - hi * 256.0); +} + +vec4 fetch_mask(ivec2 p) +{ + return texelFetch(mask_tex, clamp(p, ivec2(0), tex_size - 1), 0); +} + +float fetch_depth(ivec2 p) +{ + return texelFetch(depth_tex, clamp(p, ivec2(0), tex_size - 1), 0).r; +} + +bool covered(vec4 m) +{ + return m.g > 0.0; +} + +vec3 normal_of(vec4 m) +{ + vec2 e = unpack2(m.r) / 255.0 * 2.0 - 1.0; + vec3 n = vec3(e, 1.0 - abs(e.x) - abs(e.y)); + if (n.z < 0.0) + n.xy = (1.0 - abs(n.yx)) * vec2(n.x >= 0.0 ? 1.0 : -1.0, n.y >= 0.0 ? 1.0 : -1.0); + return normalize(n); +} + +// Pixels to the edge of the triangle under the texel along an axis direction. +float exit_along(vec4 m, ivec2 dir) +{ + vec2 e = unpack2(dir.x != 0 ? m.b : m.a) / 255.0 * EXIT_REACH; + return dir.x + dir.y > 0 ? e.x : e.y; +} + +vec3 view_position(ivec2 p, float depth) +{ + vec4 v = inv_projection_matrix * vec4((vec2(p) + 0.5) / vec2(tex_size) * 2.0 - 1.0, depth * 2.0 - 1.0, 1.0); + return v.xyz / v.w; +} + +// Under a pixel along both axes: the normal of such a sliver may be far off its surface. +bool tiny_triangle(vec4 m) +{ + vec4 e = vec4(unpack2(m.b), unpack2(m.a)) / 255.0 * EXIT_REACH; + return e.x + e.y < 1.0 && e.z + e.w < 1.0; +} + +// The normal of the texel, or of one beside it when the texel lies on a tiny triangle. +vec3 surface_normal(vec4 m, vec4 l, vec4 r) +{ + if (tiny_triangle(m)) { + if (covered(l) && !tiny_triangle(l)) + return normal_of(l); + if (covered(r) && !tiny_triangle(r)) + return normal_of(r); + } + return normal_of(m); +} + +// One surface hides the other: d, between them, is pixels long off their planes. +float jump_strength(vec3 n0, vec3 n1, vec3 d, float px) +{ + float gap = max(abs(dot(n0, d)), abs(dot(n1, d))); + return smoothstep(2.0, 4.0, gap / px); +} + +// 1 for a turn between neighboring texels of about 7 to 23 degrees: neither flat nor a crease. +float gradual_turn(float cos_angle) +{ + return (1.0 - smoothstep(0.985, 0.997, cos_angle)) * smoothstep(0.88, 0.92, cos_angle); +} + +float pack_edge(float strength, float crossing) +{ + return (floor(strength * 15.0 + 0.5) * 16.0 + floor(clamp(crossing, 0.0, 1.0) * 15.0 + 0.5) + 0.25) / 255.0; +} + +// The inner edge between q and q + dir: how strong it is, and where it crosses from q (0) to q + dir (1). +float inner_edge(ivec2 q, ivec2 dir) +{ + vec4 m0 = fetch_mask(q); + vec4 m1 = fetch_mask(q + dir); + // The silhouette is drawn by the ring. + if (!covered(m0) || !covered(m1)) + return 0.0; + + vec3 n0 = normal_of(m0); + vec3 n1 = normal_of(m1); + float d0 = fetch_depth(q); + float d1 = fetch_depth(q + dir); + vec3 p0 = view_position(q, d0); + vec3 p1 = view_position(q + dir, d1); + vec3 d = p1 - p0; + float px = dot(pixel_size_coef, vec2(-max(p0.z, p1.z), 1.0)); + bool same_part = m0.g == m1.g; + if (same_part && jump_strength(n0, n1, d, px) <= 0.0 && dot(n0, n1) >= CREASE_COS_START) + return 0.0; + + // Beside the pair, and before and after it along dir. + ivec2 perp = ivec2(dir.y, dir.x); + vec4 l0 = fetch_mask(q - perp); + vec4 r0 = fetch_mask(q + perp); + vec4 l1 = fetch_mask(q + dir - perp); + vec4 r1 = fetch_mask(q + dir + perp); + vec4 mb = fetch_mask(q - dir); + vec4 ma = fetch_mask(q + 2 * dir); + n0 = surface_normal(m0, l0, r0); + n1 = surface_normal(m1, l1, r1); + vec3 nb = covered(mb) ? normal_of(mb) : n0; + vec3 na = covered(ma) ? normal_of(ma) : n1; + float db = fetch_depth(q - dir); + float da = fetch_depth(q + 2 * dir); + float jump = jump_strength(n0, n1, d, px); + // A step: the texel after the pair lies pixels off the surface before it carried on, both ways, which a surface + // seen edge on does not. + float off = 1e9; + if (covered(mb)) + off = length(p1 - (2.0 * p0 - view_position(q - dir, db))); + if (covered(ma)) + off = min(off, length(p0 - (2.0 * p1 - view_position(q + 2 * dir, da)))); + if (off < 1e9) + jump *= smoothstep(1.0, 2.0, off / px); + // Nor a fillet, which turns a little at every texel on both sides. + jump *= 1.0 - gradual_turn(dot(nb, n0)) * gradual_turn(dot(n1, na)); + float crease = 1.0 - smoothstep(CREASE_COS_FULL, CREASE_COS_START, dot(n0, n1)); + float strength = same_part ? max(jump, crease) : 1.0; + if (strength <= 0.0) + return 0.0; + + // Where the triangle under q ends and the one under q + dir starts: together when they share the edge. + float lo = exit_along(m0, dir); + float hi = 1.0 - exit_along(m1, -dir); + if (same_part && abs(hi - lo) < 0.15) + return pack_edge(strength, 0.5 * (lo + hi)); + // Where the depth planes of both sides meet, when each side is flat over two texels and the planes part + // clearly along dir. + if (covered(mb) && covered(ma) && dot(nb, n0) > 0.999 && dot(na, n1) > 0.999) { + float a = d0 - db; + float b = da - d1; + float u = (d1 - d0 - b) / (a - b); + if (abs(a - b) > 0.1 * (abs(a) + abs(b)) && u >= 0.0 && u <= 1.0) + return pack_edge(strength, u); + } + // Where the nearer surface ends, when its triangle ends on a straight edge: the texel behind it, or the + // texels beside it, end on the same line. + float crossing = 0.5; + if (jump > 0.0) { + if (p0.z > p1.z) { + if ((covered(mb) && abs(exit_along(mb, dir) - min(lo + 1.0, EXIT_REACH)) < 0.1) || + (covered(l0) && covered(r0) && abs(exit_along(l0, dir) + exit_along(r0, dir) - 2.0 * lo) < 0.1)) + crossing = lo; + } + else { + float e = 1.0 - hi; + if ((covered(ma) && abs(exit_along(ma, -dir) - min(e + 1.0, EXIT_REACH)) < 0.1) || + (covered(l1) && covered(r1) && abs(exit_along(l1, -dir) + exit_along(r1, -dir) - 2.0 * e) < 0.1)) + crossing = hi; + } + } + return pack_edge(strength, crossing); +} + +void main() +{ + tex_size = textureSize(mask_tex, 0); + ivec2 q = ivec2(gl_FragCoord.xy); + + // For the ring around the selection: the nearest covered texel along the row, offset by 16, and the + // coverage of the row under a gaussian, whose sum over the column sets the silhouette between texels. + float nearest = 0.0; + float coverage = 0.0; + float weights = 0.0; + for (int k = -ring_reach; k <= ring_reach; ++k) { + float w = exp(-float(k * k) / (2.0 * ring_sigma * ring_sigma)); + weights += w; + if (covered(fetch_mask(q + ivec2(k, 0)))) { + coverage += w; + if (nearest == 0.0 || abs(k) < abs(int(nearest) - 16)) + nearest = float(16 + k); + } + } + + out_color = vec4(inner_edge(q, ivec2(1, 0)), inner_edge(q, ivec2(0, 1)), + nearest > 0.0 ? (nearest + 0.25) / 255.0 : 0.0, coverage / weights); +} diff --git a/resources/shaders/140/outline_mask.fs b/resources/shaders/140/outline_mask.fs new file mode 100644 index 0000000000..39ebbe84e1 --- /dev/null +++ b/resources/shaders/140/outline_mask.fs @@ -0,0 +1,54 @@ +#version 140 + +const vec3 ZERO = vec3(0.0, 0.0, 0.0); +// Farthest triangle edge distance stored, in pixels. +const float EXIT_REACH = 4.0; + +// 1 to 65535, told apart between neighboring volumes. +uniform float part_id; + +in vec3 clipping_planes_dots; +in vec3 eye_normal; +in vec3 to_camera; +noperspective in vec3 barycentric; + +out vec4 out_color; + +// Two bytes in one channel of the 16 bit target, offset so that a truncating conversion keeps them. +float pack2(float hi, float lo) +{ + return (hi * 256.0 + lo + 0.25) / 65535.0; +} + +vec2 oct_encode(vec3 n) +{ + n /= abs(n.x) + abs(n.y) + abs(n.z); + vec2 e = n.z >= 0.0 ? n.xy : (1.0 - abs(n.yx)) * vec2(n.x >= 0.0 ? 1.0 : -1.0, n.y >= 0.0 ? 1.0 : -1.0); + return floor((e * 0.5 + 0.5) * 255.0 + 0.5); +} + +// Pixels to the edge of the triangle along the screen direction over which the barycentrics change by d. +float exit_distance(vec3 d) +{ + vec3 t = vec3(EXIT_REACH); + if (d.x < 0.0) t.x = barycentric.x / -d.x; + if (d.y < 0.0) t.y = barycentric.y / -d.y; + if (d.z < 0.0) t.z = barycentric.z / -d.z; + return floor(clamp(min(t.x, min(t.y, t.z)) / EXIT_REACH, 0.0, 1.0) * 255.0 + 0.5); +} + +void main() +{ + if (any(lessThan(clipping_planes_dots, ZERO))) + discard; + + // Back faces show through cuts, so every surface is compared by its side facing the camera. + vec3 n = normalize(eye_normal); + if (dot(n, to_camera) < 0.0) + n = -n; + vec2 e = oct_encode(n); + vec3 bx = dFdx(barycentric); + vec3 by = dFdy(barycentric); + out_color = vec4(pack2(e.x, e.y), (part_id + 0.25) / 65535.0, + pack2(exit_distance(bx), exit_distance(-bx)), pack2(exit_distance(by), exit_distance(-by))); +} diff --git a/resources/shaders/140/outline_mask.vs b/resources/shaders/140/outline_mask.vs new file mode 100644 index 0000000000..41b0ed884f --- /dev/null +++ b/resources/shaders/140/outline_mask.vs @@ -0,0 +1,33 @@ +#version 140 + +uniform mat4 view_model_matrix; +uniform mat4 projection_matrix; +uniform mat3 view_normal_matrix; +uniform mat4 volume_world_matrix; + +// Clipping plane, x = min z, y = max z. Used by the FFF and SLA previews to clip with a top / bottom plane. +uniform vec2 z_range; +// Clipping plane - general orientation. Used by the SLA gizmo. +uniform vec4 clipping_plane; + +in vec3 v_position; +in vec3 v_normal; + +out vec3 clipping_planes_dots; +out vec3 eye_normal; +out vec3 to_camera; +noperspective out vec3 barycentric; + +void main() +{ + vec4 world_pos = volume_world_matrix * vec4(v_position, 1.0); + clipping_planes_dots = vec3(dot(world_pos, clipping_plane), world_pos.z - z_range.x, z_range.y - world_pos.z); + + vec4 position = view_model_matrix * vec4(v_position, 1.0); + eye_normal = view_normal_matrix * v_normal; + // projection_matrix[3][3] is 1 only for an orthographic camera, whose view rays all run along -z. + to_camera = mix(-position.xyz, vec3(0.0, 0.0, 1.0), projection_matrix[3][3]); + // GLModel gives every triangle three vertices of its own. + barycentric = vec3(equal(ivec3(gl_VertexID % 3), ivec3(0, 1, 2))); + gl_Position = projection_matrix * position; +} diff --git a/resources/shaders/140/phong.fs b/resources/shaders/140/phong.fs index c0cbc1c144..ff861126e6 100644 --- a/resources/shaders/140/phong.fs +++ b/resources/shaders/140/phong.fs @@ -1,7 +1,4 @@ #version 140 -// Multisample depth texture for the anti-aliased outline (see 3DScene.cpp render_with_outline). -// Optional on the GLSL 140 path: if unavailable, fallback to a non-multisample depth texture. -#extension GL_ARB_texture_multisample : enable const vec3 ZERO = vec3(0.0, 0.0, 0.0); const vec3 LightRed = vec3(0.78, 0.0, 0.0); @@ -53,21 +50,10 @@ uniform vec4 uniform_color_clip_plane_1; uniform vec4 uniform_color_clip_plane_2; uniform SlopeDetection slope; -//BBS: add outline_color -uniform bool is_outline; // ORCA: a part of a translucent filament, drawn as its print would show in premultiplied color, see // GLVolumeCollection::render(). It catches a highlight only with translucent_gloss, in realistic view. uniform bool translucent_filament; uniform bool translucent_gloss; -// The outline is a per-fragment discard mask, which the framebuffer MSAA cannot smooth, so the -// silhouette is resolved per sample from a multisample copy of the outlined model's depth buffer. -#ifdef GL_ARB_texture_multisample -uniform sampler2DMS depth_tex; -uniform int msaa_samples; // samples in depth_tex, 1 when MSAA is off -#else -uniform sampler2D depth_tex; -#endif -uniform vec2 screen_size; #ifdef ENABLE_ENVIRONMENT_MAP uniform sampler2D environment_tex; @@ -76,8 +62,6 @@ uniform vec2 screen_size; uniform PrintVolumeDetection print_volume; -uniform float z_far; -uniform float z_near; uniform bool enable_ssao; // 1 = the Design tab's studio lighting (studio_shade below); 0 = the two-light model above, which // every other canvas keeps. world_up_eye is world +Z in eye space, for the hemisphere ambient. @@ -112,95 +96,6 @@ vec4 translucent_filament_color(vec3 diffuse, float alpha, vec3 highlight, float out vec4 out_color; -vec3 getBackfaceColor(vec3 fill) { - float brightness = 0.2126 * fill.r + 0.7152 * fill.g + 0.0722 * fill.b; - return (brightness > 0.75) ? vec3(0.11, 0.165, 0.208) : vec3(0.988, 0.988, 0.988); -} - -// Silhouette edge detection & rendering algorithm by leoneruggiero -// https://www.shadertoy.com/view/DslXz2 -#define INFLATE 1 - -float GetTolerance(float d, float k) -{ - float A=- (z_far+z_near)/(z_far-z_near); - float B=-2.0*z_far*z_near /(z_far-z_near); - - d = d*2.0-1.0; - - return -k*(d+A)*(d+A)/B; -} - -// Depth of sample s at integer pixel coord. -#ifdef GL_ARB_texture_multisample -float FetchDepth(ivec2 coord, int s) -{ - // texelFetch has no wrap mode, so clamp to the edge texel (sampler2D used CLAMP_TO_EDGE). - ivec2 sz = textureSize(depth_tex); - return abs(texelFetch(depth_tex, clamp(coord, ivec2(0), sz - 1), s).r); -} -#else -float FetchDepth(ivec2 coord, int s) -{ - return abs(texture(depth_tex, (vec2(coord) + 0.5) / screen_size).r); -} -#endif - -float DetectSilho(ivec2 coord, ivec2 dir, int s) -{ - float x0 = FetchDepth(coord + dir*-2, s); - float x1 = FetchDepth(coord + dir*-1, s); - float x2 = FetchDepth(coord, s); - float x3 = FetchDepth(coord + dir* 1, s); - - float d0 = (x1-x0); - float d1 = (x2-x3); - - float r0 = x1 + d0 - x2; - float r1 = x2 + d1 - x1; - - float tol = GetTolerance(x2, 0.04); - - return smoothstep(0.0, tol*tol, max( - r0*r1, 0.0)); -} - -float DetectSilho(ivec2 coord, int s) -{ - return max( - DetectSilho(coord, ivec2(1,0), s), - DetectSilho(coord, ivec2(0,1), s) - ); -} - -// Full response of one sample. Reduce the max() per sample and average only afterwards: -// max(mean) <= mean(max), and averaging first hollows out diagonal and curved lines. -float DetectSilhoSample(ivec2 coord, int s) -{ - float v = DetectSilho(coord, s); - // Makes silhouettes thicker. - for (int i = 1; i <= INFLATE; ++i) - { - v = max(v, DetectSilho(coord + ivec2(i, 0), s)); - v = max(v, DetectSilho(coord + ivec2(0, i), s)); - } - return v; -} - -// Average the per-sample coverage into the sub-pixel anti-aliasing of the line. -float DetectSilho(vec2 fragCoord) -{ - ivec2 coord = ivec2(fragCoord); -#ifdef GL_ARB_texture_multisample - int n = max(msaa_samples, 1); -#else - const int n = 1; -#endif - float acc = 0.0; - for (int s = 0; s < n; ++s) - acc += DetectSilhoSample(coord, s); - return acc / float(n); -} - float compute_ssao_factor(vec3 normal, vec3 view_dir, vec3 eye_pos) { vec3 normal_dx = dFdx(normal); @@ -364,21 +259,12 @@ void main() vec3 lit = (lighting_model == 1) ? studio_shade(color.rgb, normal, view_dir) : (vec3(specular) + window_reflection + color.rgb * diffuse) * PHONG_BRIGHTNESS; - if (is_outline) { - vec3 shaded_rgb = lit * shade; - vec4 shaded_color = vec4(clamp(shaded_rgb, vec3(0.0), vec3(1.0)), color.a); - float s = DetectSilho(gl_FragCoord.xy); - if (s < 0.01) - discard; - out_color = vec4(mix(shaded_color.rgb, getBackfaceColor(shaded_color.rgb), s), shaded_color.a); - if (translucent_filament) - out_color.rgb *= out_color.a; - } #ifdef ENABLE_ENVIRONMENT_MAP - else if (use_environment_tex) + if (use_environment_tex) out_color = vec4(clamp((0.45 * texture(environment_tex, normalize(eye_normal).xy * 0.5 + 0.5).xyz + window_reflection + 0.8 * color.rgb * diffuse) * PHONG_BRIGHTNESS * shade, vec3(0.0), vec3(1.0)), color.a); + else #endif - else if (translucent_filament) + if (translucent_filament) out_color = translucent_filament_color(clamp(color.rgb * diffuse * PHONG_BRIGHTNESS * shade, vec3(0.0), vec3(1.0)), color.a, translucent_gloss ? (vec3(specular) + window_reflection) * PHONG_BRIGHTNESS * shade : ZERO, abs(dot(normal, view_dir))); diff --git a/resources/shaders/140/phong.vs b/resources/shaders/140/phong.vs index 7120b62c66..14d7081605 100644 --- a/resources/shaders/140/phong.vs +++ b/resources/shaders/140/phong.vs @@ -15,8 +15,6 @@ uniform mat4 projection_matrix; uniform mat3 view_normal_matrix; uniform mat4 volume_world_matrix; uniform SlopeDetection slope; -uniform bool is_outline; -uniform vec2 screen_size; // Clipping plane, x = min z, y = max z. Used by the FFF and SLA previews to clip with a top / bottom plane. uniform vec2 z_range; @@ -51,15 +49,6 @@ void main() world_normal_z = slope.actived ? dot(normalize(slope.volume_world_normal_matrix * v_normal), slope.up_direction) : 0.0; gl_Position = projection_matrix * position; - if (is_outline) { - vec3 n = normalize((view_normal_matrix * v_normal).xyz); - vec2 dir = normalize(n.xy); - if (dot(dir, dir) > 0.0) { - //set outline thickness - float px = 3.0; - gl_Position.xy += dir * (px * 2.0 / screen_size) * gl_Position.w; - } - } // Fill in the scalars for fragment shader clipping. Fragments with any of these components lower than zero are discarded. clipping_planes_dots = vec3(dot(world_pos, clipping_plane), world_pos.z - z_range.x, z_range.y - world_pos.z); color_clip_plane_dot = dot(world_pos, color_clip_plane); diff --git a/resources/shaders/140/ssao.fs b/resources/shaders/140/ssao.fs index 28b561ba2c..91fa7d4cd6 100644 --- a/resources/shaders/140/ssao.fs +++ b/resources/shaders/140/ssao.fs @@ -9,7 +9,6 @@ uniform sampler2D color_texture; uniform sampler2D depth_texture; uniform vec2 inv_tex_size; uniform float z_far; -uniform bool is_outline; // The pass has no normal target to read, so the surface normal is reconstructed from the depth // buffer. inv_projection_matrix unprojects a pixel back into view space and up_view is world +Z // expressed in view space, which is what tells a top surface from a wall. @@ -44,10 +43,6 @@ vec3 view_normal(ivec2 pixel, vec3 p) void main() { - if (is_outline) { - frag_color = vec4(texture(color_texture, tex_coord).rgb, 1.0); - return; - } ivec2 pixel = ivec2(gl_FragCoord.xy); vec3 color = texture(color_texture, tex_coord).rgb; diff --git a/scripts/flatpak/com.orcaslicer.OrcaSlicer.yml b/scripts/flatpak/com.orcaslicer.OrcaSlicer.yml index 1a18bf7766..928cf25b78 100644 --- a/scripts/flatpak/com.orcaslicer.OrcaSlicer.yml +++ b/scripts/flatpak/com.orcaslicer.OrcaSlicer.yml @@ -52,8 +52,8 @@ modules: - -Dtests=disabled sources: - type: archive - url: https://gstreamer.freedesktop.org/src/gst-plugins-good/gst-plugins-good-1.22.8.tar.xz - sha256: e305b9f07f52743ca481da0a4e0c76c35efd60adaf1b0694eb3bb021e2137e39 + url: https://gstreamer.freedesktop.org/src/gst-plugins-good/gst-plugins-good-1.26.11.tar.xz + sha256: 001deb0876d5d743cd3448abf74a27adec3fd850012fcb1b00994861bd6c1145 - name: kde-extra-cmake-modules buildsystem: cmake-ninja diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index d876c93dc1..9b90f7ccb5 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -699,8 +699,8 @@ static std::vector get_path_of_change_filament(const Print& print) // BBS double wipe_dist = scale_(gcodegen.config().wipe_distance.get_at(gcodegen.get_filament_config_index((int)gcodegen.writer().filament()->id()))); - /* Take the stored wipe path and replace first point with the current actual position - (they might be different, for example, in case of loop clipping). */ + // Replace the stored first point with the actual nozzle position, + // including any loop clipping or Wipe on loop move. Polyline wipe_path; wipe_path.append(gcodegen.last_pos()); wipe_path.append( @@ -1167,7 +1167,9 @@ static std::vector get_path_of_change_filament(const Print& print) // over the tower - which is what the is_finish_first travel above does. Otherwise the nozzle // is still over the model and this descent would drive it into the print, so defer it to the // re-descents below, which run after the travel to the tower. - const bool defer_compacted_descend = m_sparse_layers_skipped + // A layer joined to the tower layer below descends to it the same way, by less than a layer. + const bool joined_below_layer = m_layer_joined && !tcr.priming && (current_z - z) > EPSILON; + const bool defer_compacted_descend = (m_sparse_layers_skipped || joined_below_layer) && !tcr.priming && !tcr.is_finish_first && (current_z - z) > EPSILON; if (!is_approx(z, current_z) && !defer_compacted_descend) { gcode += gcodegen.writer().retract(); @@ -1176,7 +1178,7 @@ static std::vector get_path_of_change_filament(const Print& print) } // Tower compacted below the object, so any extrusion emitted without an explicit z has to be // pulled back down to it first. - const bool compacted_below_object = m_sparse_layers_skipped && z >= 0. && (tcr.print_z - z) > EPSILON; + const bool compacted_below_object = (m_sparse_layers_skipped && z >= 0. && (tcr.print_z - z) > EPSILON) || joined_below_layer; // Process the end filament gcode. bool add_change_filament_624 = false; @@ -1511,6 +1513,14 @@ static std::vector get_path_of_change_filament(const Print& print) if (position_before_toolchange) gcodegen.synchronize_toolchange_position(*position_before_toolchange, toolchange_gcode_str); + // A joined layer descends to the tower layer below it. With no macro and no nozzle change + // nothing has moved the head off the part yet, so travel over the tower before that descent. + if (joined_below_layer && !need_travel_after_change_filament_gcode && !is_nozzle_change) { + std::string start_pos_str = gcodegen.travel_to(wipe_tower_point_to_object_point(gcodegen, tool_change_start_pos + plate_origin_2d), erMixed, "Move to start pos"); + check_add_eol(start_pos_str); + wipe_next_start_point_str = start_pos_str; + } + if (need_travel_after_change_filament_gcode) { // move to start_pos for wiping after toolchange if (!is_used_travel_avoid_perimeter) { @@ -2098,7 +2108,8 @@ static std::vector get_path_of_change_filament(const Print& print) ignore_sparse = wipe_tower_layer_is_sparse(m_tool_changes[m_layer_idx]) && m_layer_idx != 0; if (m_tool_change_idx == 0 && !ignore_sparse) wipe_tower_z = m_last_wipe_tower_print_z + m_tool_changes[m_layer_idx].front().layer_height; - } + } else if (m_layer_joined) + wipe_tower_z = joined_tower_z(); if (!ignore_sparse) { gcode += append_tcr2(gcodegen, m_tool_changes[m_layer_idx][m_tool_change_idx++], extruder_id, wipe_tower_z); @@ -2115,7 +2126,8 @@ static std::vector get_path_of_change_filament(const Print& print) if (m_sparse_layers_skipped) { ignore_sparse = wipe_tower_layer_is_sparse(m_tool_changes[m_layer_idx]); wipe_tower_z = m_compacted_tower_z[m_layer_idx]; - } + } else if (m_layer_joined) + wipe_tower_z = joined_tower_z(); if ((m_enable_timelapse_print || m_enable_wrapping_detection) && m_is_first_print) { gcode += append_tcr(gcodegen, m_tool_changes[m_layer_idx][0], m_tool_changes[m_layer_idx][0].new_tool, wipe_tower_z); @@ -5194,8 +5206,13 @@ void GCode::process_layers( const std::pair>& layer = layers_to_print[precomputed.index]; const LayerTools& layer_tools = tool_ordering.tools_for_layer(layer.first); print.set_status(80, Slic3r::format(_(L("Generating G-code: layer %1%")), std::to_string(precomputed.index + 1))); - if (m_wipe_tower && layer_tools.has_wipe_tower) - m_wipe_tower->next_layer(); + // A layer that joined the tower layer below continues it. + if (m_wipe_tower && layer_tools.has_wipe_tower) { + if (layer_tools.joins_wipe_tower_layer_below()) + m_wipe_tower->join_layer(); + else + m_wipe_tower->next_layer(); + } //BBS check_placeholder_parser_failed(); print.throw_if_canceled(); @@ -7438,7 +7455,8 @@ LayerResult GCode::process_layer( gcode += insert_timelapse_gcode(); } - if (m_wipe_tower) + // A joined layer continues a tower layer whose first print is already done. + if (m_wipe_tower && ! layer_tools.joins_wipe_tower_layer_below()) m_wipe_tower->set_is_first_print(true); auto insert_wrapping_detection_gcode = [this, &print, &print_z, &most_used_extruder]() -> std::string { @@ -7527,7 +7545,8 @@ LayerResult GCode::process_layer( std::string gcode_toolchange; if (has_wipe_tower) { - if (!m_wipe_tower->is_empty_wipe_tower_gcode(*this, extruder_id, extruder_id == layer_tools.extruders.back())) { + const bool finish_tower_layer = extruder_id == layer_tools.extruders.back() && layer_tools.wipe_tower_layer_ends; + if (!m_wipe_tower->is_empty_wipe_tower_gcode(*this, extruder_id, finish_tower_layer)) { if (need_insert_timelapse_gcode_for_traditional && !has_insert_timelapse_gcode && !(m_farthest_point_timelapse.enabled && m_farthest_point_timelapse.farthest_is_photo_head)) { bool should_insert = true; @@ -7555,7 +7574,7 @@ LayerResult GCode::process_layer( gcode += insert_wrapping_detection_gcode(); has_insert_wrapping_detection_gcode = true; } - gcode_toolchange = m_wipe_tower->tool_change(*this, extruder_id, extruder_id == layer_tools.extruders.back()); + gcode_toolchange = m_wipe_tower->tool_change(*this, extruder_id, finish_tower_layer); } } else { // Same case-A/case-B split for the non-wipe-tower path. With the subsystem off, @@ -8782,11 +8801,14 @@ std::string GCode::extrude_loop(const ExtrusionLoop& loop_ paths.back().polyline.points.size() >= 2) wipe_on_loops_dest = wipe_on_loops_destination(paths, scale_(nozzle_diameter), is_ccw, is_hole); - bool wipe_inward_applied = false; // Orca: store loop paths in print order because inward offsets use this orientation. if (m_wipe.enable && FILAMENT_CONFIG(wipe)) { m_wipe.update_path(paths); + // A loop's role is its first path's role. An overhanging start must + // not hide ordinary external-wall segments elsewhere in the loop. + const auto external_path = std::find_if(paths.begin(), paths.end(), + [](const ExtrusionPath &path) { return is_external_perimeter(path.role()); }); // Orca: loop wipe paths retain print direction. Their material side is // therefore left for CCW contours and right for CW contours, with the // result inverted for holes. Only external perimeters are eligible. @@ -8794,18 +8816,19 @@ std::string GCode::extrude_loop(const ExtrusionLoop& loop_ // context was created. Check the effective setting again at execution. if (m_config.wipe_inward && m_config.wipe_inward_distance.value > 0. && wipe_support != nullptr && !wipe_support->inner_lines.empty() && - // A loop's role is its first path's role. An overhanging start must - // not hide ordinary external-wall segments elsewhere in the loop. - std::any_of(paths.begin(), paths.end(), - [](const ExtrusionPath &path) { return is_external_perimeter(path.role()); }) && - m_wipe.path.points.size() >= 2) { - // Orca: use the actual extrusion width from the path, not the config + external_path != paths.end() && m_wipe.path.points.size() >= 2) { + // Orca: use the actual extrusion width of the external wall, not the config // value — outer_wall_line_width=0 (Auto) would make get_abs_value // return 0 and silently disable the feature, and Arachne may produce - // a different width than the config default. - const double outer_wall_line_width = paths.front().width; + // a different width than the config default. An overhanging start + // may have another width, so it does not set the offset. + const double outer_wall_line_width = external_path->width; const double requested_offset = m_config.wipe_inward_distance.get_abs_value(outer_wall_line_width); - const double offset_dist = scale_(std::min(requested_offset, outer_wall_line_width)); + // Outer/Inner and sandwich order print the adjacent inner wall after + // this one. Only the outer bead's own inner half is available for wiping now. + const double max_offset = outer_wall_line_width * + (m_config.wall_sequence == WallSequence::InnerOuter ? 1. : 0.5); + const double offset_dist = scale_(std::min(requested_offset, max_offset)); if (offset_dist > SCALED_EPSILON) { const Point seam_start = paths.front().first_point(); const Point seam_end = paths.back().last_point(); @@ -8815,11 +8838,10 @@ std::string GCode::extrude_loop(const ExtrusionLoop& loop_ // from points[1]. The helper preserves that sentinel and atomically // replaces the remaining points, or leaves the path untouched. // Orca: a configured wall count does not guarantee that Arachne - // generated an adjacent wall for this particular loop. Only - // earlier entities are considered because later walls have - // not been printed yet (for example with Outer/Inner order). - // Inner walls determine the material side; every earlier wall - // remains available to validate the executable wipe path. + // generated an adjacent wall for this particular loop. Inner walls + // determine the material side; with Outer/Inner and sandwich order + // they include walls printed later. Only printed walls validate + // the executable wipe path. const double support_distance = scale_(std::max(nozzle_diameter, outer_wall_line_width)); Polyline inward_path = m_wipe.path; if (offset_wipe_path_toward_support( @@ -8827,8 +8849,9 @@ std::string GCode::extrude_loop(const ExtrusionLoop& loop_ wipe_offset_direction(is_ccw, is_hole), offset_dist, max_wipe_length, wipe_support->inner_lines, wipe_support->printed_lines, m_wipe.path.lines(), support_distance)) { + // Only the stored geometry changes. Like the regular wipe, the path + // runs when travel planning retracts and is skipped on short travels. m_wipe.path = std::move(inward_path); - wipe_inward_applied = true; } } } @@ -8841,12 +8864,6 @@ std::string GCode::extrude_loop(const ExtrusionLoop& loop_ this->set_last_pos(*wipe_on_loops_dest); } - // Execute the accepted path before another extrusion replaces it. Wiping - // must not force retraction or Z-hop across a short travel to the next wall. - // Ordinary travel planning decides whether to retract from the new position. - if (wipe_inward_applied) - gcode += m_wipe.wipe(*this, 0.); - return gcode; } @@ -8953,6 +8970,18 @@ std::string GCode::extrude_perimeters(const Print &print, const std::vector SCALED_EPSILON) wipe_support.emplace(); + // Outer/Inner and sandwich order print the adjacent inner wall after the + // external wall. Its geometry still identifies the inward side and whether + // the external wall has a neighbour, while the half-width limit in + // extrude_loop() keeps the wipe on the outer bead. + if (wipe_support && m_config.wall_sequence != WallSequence::InnerOuter) { + WipeInwardSupport all_walls; + for (const ExtrusionEntity* ee : region.perimeters) + all_walls.append(*ee); + wipe_support->inner_lines = std::move(all_walls.inner_lines); + wipe_support->inner_lines_complete = true; + } + // ORCA: loops flagged as extruded in mid air, out of reach of the layer below, are held back // for a second pass after the infill that anchors them. Infill already precedes infill first walls. const bool defer_unsupported = !is_infill_first; diff --git a/src/libslic3r/GCode.hpp b/src/libslic3r/GCode.hpp index 03c5325953..9d9f12877b 100644 --- a/src/libslic3r/GCode.hpp +++ b/src/libslic3r/GCode.hpp @@ -142,7 +142,9 @@ public: } std::string prime(GCode &gcodegen); - void next_layer() { ++ m_layer_idx; m_tool_change_idx = 0; } + void next_layer() { ++ m_layer_idx; m_tool_change_idx = 0; m_layer_joined = false; } + // The next object layer joined the current tower layer, so its purges print down at that layer's z. + void join_layer() { m_layer_joined = true; } std::string tool_change(GCode &gcodegen, int extruder_id, bool finish_layer); bool is_empty_wipe_tower_gcode(GCode &gcodegen, int extruder_id, bool finish_layer); std::string finalize(GCode &gcodegen); @@ -164,6 +166,8 @@ private: std::string append_tcr2(GCode &gcodegen, const WipeTower::ToolChangeResult &tcr, int new_extruder_id, double z = -1.) const; std::string travel_to_tower_gap(GCode &gcodegen, const Point &route_start, const Point &start_wipe_pos) const; Vec2f transform_wt2_pt(const Vec2f &pt) const; + // The current tower layer's z in the G-code frame, where a joined layer prints its purges. + double joined_tower_z() const { return m_tool_changes[m_layer_idx].front().print_z + m_print_config->z_offset.value; } Polygons shared_printable_area(GCode &gcodegen) const; // Postprocesses gcode: rotates and moves G1 extrusions and returns result @@ -183,6 +187,7 @@ private: int m_layer_idx; int m_tool_change_idx; double m_last_wipe_tower_print_z; + bool m_layer_joined = false; // BBS Vec3d m_plate_origin; diff --git a/src/libslic3r/GCode/ToolOrdering.cpp b/src/libslic3r/GCode/ToolOrdering.cpp index 75fcace426..e5c36d34c7 100644 --- a/src/libslic3r/GCode/ToolOrdering.cpp +++ b/src/libslic3r/GCode/ToolOrdering.cpp @@ -192,6 +192,14 @@ static double calc_max_layer_height(const PrintConfig &config, double max_object return std::max(max_layer_height, max_object_layer_height); } +static double calc_min_layer_height(const PrintConfig &config) +{ + double min_layer_height = std::numeric_limits::max(); + for (size_t i = 0; i < config.nozzle_diameter.values.size(); ++ i) + min_layer_height = std::min(min_layer_height, config.min_layer_height.get_at(i)); + return config.nozzle_diameter.values.empty() ? 0. : min_layer_height; +} + //calculate the flush weight (first value) and filament change count(second value) // Nozzle-aware flush-stat calculator. Resolves each // filament in the print sequence to its physical nozzle via the grouping result and tracks a @@ -1233,13 +1241,48 @@ void ToolOrdering::fill_wipe_tower_partitions(const PrintConfig &config, coordf_ } } - // Calculate the wipe_tower_layer_height values. - coordf_t wipe_tower_print_z_last = 0.; - for (LayerTools < : m_layer_tools) - if (lt.has_wipe_tower) { + // Calculate the wipe_tower_layer_height values. Precise Z height ends each object at its exact + // top, so another object's layers can sit above these by less than the printer's minimum layer + // height. A tower layer that thin cannot be printed, and a purge sized for it runs up to hundreds + // of mm long, so it joins the tower layer below. The floor matches the towers' own WT_EPSILON + // merge, which would otherwise size the joined tool changes with the sliver's height. The EPSILON + // margin keeps layers sliced at exactly the minimum height, whose sums round below it, apart. + const double min_tower_layer_height = std::max(calc_min_layer_height(config), 1e-3); + coordf_t wipe_tower_print_z_last = 0.; + // The layer that finishes the current tower layer, and whether any layer of it changes tools. + LayerTools *tower_layer_end = nullptr; + bool tower_layer_changes = false; + unsigned int current_extruder = (unsigned int) -1; + for (LayerTools < : m_layer_tools) { + lt.wipe_tower_layer_ends = true; + // The G-code takes one tower result per tool change, so a layer that changes tools always + // takes one; a layer that does not takes one only when it finishes the tower layer. + const bool changes = ! lt.extruders.empty() && + (current_extruder == (unsigned int) -1 || lt.extruders.size() > 1 || lt.extruders.front() != current_extruder); + if (! lt.extruders.empty()) + current_extruder = lt.extruders.back(); + if (! lt.has_wipe_tower) + continue; + // Only a layer that prints joins, so the tower layer is always finished by a printing layer. + if (tower_layer_end != nullptr && ! lt.extruders.empty() && lt.print_z - wipe_tower_print_z_last + EPSILON < min_tower_layer_height) { + lt.wipe_tower_print_z = tower_layer_end->wipe_tower_print_z; + lt.wipe_tower_layer_height = tower_layer_end->wipe_tower_layer_height; + // The finish rides on the last tool change of the joined layers, as it does on its own + // layer: one that takes over after the last result is gone has nothing left to print. + if (changes || ! tower_layer_changes) { + tower_layer_end->wipe_tower_layer_ends = false; + tower_layer_end = < + } else + lt.wipe_tower_layer_ends = false; + tower_layer_changes |= changes; + } else { + lt.wipe_tower_print_z = lt.print_z; lt.wipe_tower_layer_height = lt.print_z - wipe_tower_print_z_last; - wipe_tower_print_z_last = lt.print_z; + wipe_tower_print_z_last = lt.print_z; + tower_layer_end = < + tower_layer_changes = changes; } + } } void ToolOrdering::collect_extruder_statistics(bool prime_multi_material) diff --git a/src/libslic3r/GCode/ToolOrdering.hpp b/src/libslic3r/GCode/ToolOrdering.hpp index b7aca7dd30..e38cae4fb9 100644 --- a/src/libslic3r/GCode/ToolOrdering.hpp +++ b/src/libslic3r/GCode/ToolOrdering.hpp @@ -187,6 +187,13 @@ public: // and to support the wipe tower partitions above this one. size_t wipe_tower_partitions = 0; coordf_t wipe_tower_layer_height = 0.; + // print_z of the wipe tower layer this layer's tool changes print on. A layer too thin to be + // its own tower layer joins the one below, keeping that layer's z and height. + coordf_t wipe_tower_print_z = 0.; + // Whether this layer finishes its wipe tower layer. Of a tower layer and the layers joined to + // it, that is the last one changing tools, or the last one when none does. + bool wipe_tower_layer_ends = true; + bool joins_wipe_tower_layer_below() const { return has_wipe_tower && wipe_tower_print_z != print_z; } // Custom G-code (color change, extruder switch, pause) to be performed before this layer starts to print. const CustomGCode::Item *custom_gcode = nullptr; diff --git a/src/libslic3r/GCode/WipePathHelpers.cpp b/src/libslic3r/GCode/WipePathHelpers.cpp index 6e4518bb08..7bc7add103 100644 --- a/src/libslic3r/GCode/WipePathHelpers.cpp +++ b/src/libslic3r/GCode/WipePathHelpers.cpp @@ -1,6 +1,7 @@ #include "WipePathHelpers.hpp" #include "../AABBTreeLines.hpp" +#include "libslic3r/BoundingBox.hpp" #include "libslic3r/ExtrusionEntity.hpp" #include "libslic3r/Line.hpp" #include "libslic3r/Point.hpp" @@ -33,7 +34,7 @@ void WipeInwardSupport::append(const ExtrusionEntity &entity) is_internal_perimeter(entity.role()); const Lines lines = entity.as_polyline().lines(); printed_lines.insert(printed_lines.end(), lines.begin(), lines.end()); - if (is_inner) + if (is_inner && ! inner_lines_complete) inner_lines.insert(inner_lines.end(), lines.begin(), lines.end()); } @@ -513,7 +514,11 @@ static std::optional support_offset_at_start( const Vec2d support_edge = (nearest_line.b - nearest_line.a).cast(); if (support_edge.norm() > SCALED_EPSILON) { const Vec2d support_tangent = support_edge.normalized(); - sampled_offset -= support_tangent * sampled_offset.dot(support_tangent); + const Vec2d normal_offset = sampled_offset - support_tangent * sampled_offset.dot(support_tangent); + // At a shared endpoint the selected edge may erase the entire + // direction to the inner wall. Keep the endpoint vector in that case. + if (normal_offset.norm() > SCALED_EPSILON) + sampled_offset = normal_offset; } } if (sampled_offset.norm() <= SCALED_EPSILON) @@ -526,10 +531,20 @@ static std::optional support_offset_at_start( // sampled point itself would add the distance already travelled along the // perimeter and turn a normal transition into a long diagonal move. const Vec2d sampled_direction = sampled_offset.normalized(); - Vec2d local_offset = sampled_offset; + // Use the same corner reach as support validation. A displacement measured + // at the sample is not an available offset at the actual wall endpoint. + const double max_local_distance = miter_limit * max_support_distance + 4. * SCALED_EPSILON; + Point local_support; + nearest_line.distance_to_squared(local_origin, &local_support); + const Vec2d branch_offset = (local_support - local_origin).cast(); + const double branch_distance = branch_offset.norm(); + std::optional local_offset; + // The sampled branch may end before the seam. Its local endpoint remains + // usable even when the direction there differs from the sampled normal. + if (branch_distance > SCALED_EPSILON && branch_distance <= max_local_distance) + local_offset = branch_offset; double best_local_score = std::numeric_limits::infinity(); - for (size_t line_index : support_distancer.all_lines_in_radius( - local_origin, 2. * max_support_distance + 4. * SCALED_EPSILON)) { + for (size_t line_index : support_distancer.all_lines_in_radius(local_origin, max_local_distance)) { Point local_support; const Line &line = support_distancer.get_line(line_index); const double distance_squared = line.distance_to_squared(local_origin, &local_support); @@ -686,14 +701,34 @@ bool offset_wipe_path_toward_support(Polyline &polyline, Point seam_start, Point max_wipe_length <= SCALED_EPSILON || max_support_distance <= SCALED_EPSILON) return false; + // Orca: the executable path stays within the wipe length of its start, and + // support and side queries reach at most twice the corner reach beyond it. + // Keep only the printed walls in that area, so an island with many holes + // does not build trees of its whole printed prefix for every external loop. + BoundingBox seam_area(Points{seam_start, seam_end, wipe_start}); + seam_area.offset(max_wipe_length + 2. * miter_limit * max_support_distance); + const auto lines_near_seam = [&seam_area](const Lines &lines) { + Lines result; + for (const Line &line : lines) + if (std::max(line.a.x(), line.b.x()) >= seam_area.min.x() && + std::min(line.a.x(), line.b.x()) <= seam_area.max.x() && + std::max(line.a.y(), line.b.y()) >= seam_area.min.y() && + std::min(line.a.y(), line.b.y()) <= seam_area.max.y()) + result.push_back(line); + return result; + }; + const Lines target_lines = lines_near_seam(target_perimeter_lines); + if (target_lines.empty()) + return false; + Lines material_support_lines; - const Lines *candidate_support_lines = &target_perimeter_lines; + const Lines *candidate_support_lines = &target_lines; if (seam_start == seam_end) { // Orca: another contour may have a geometrically closer inner wall on // this loop's air side. Restrict zero-gap support using the local seam // normals before choosing the nearest wall. material_support_lines = material_side_support_lines( - polyline, seam_start, preferred_dir, target_perimeter_lines); + polyline, seam_start, preferred_dir, target_lines); if (material_support_lines.empty()) return false; candidate_support_lines = &material_support_lines; @@ -715,7 +750,7 @@ bool offset_wipe_path_toward_support(Polyline &polyline, Point seam_start, Point // Orca: every candidate is validated against the same generated geometry. // Build these AABB trees once per loop instead of rebuilding them for each // preferred, alternate, translated, direct, or reversed candidate. - Lines all_support_lines = printed_perimeter_lines; + Lines all_support_lines = lines_near_seam(printed_perimeter_lines); all_support_lines.insert(all_support_lines.end(), current_perimeter_lines.begin(), current_perimeter_lines.end()); AABBTreeLines::LinesDistancer all_support_distancer(std::move(all_support_lines)); AABBTreeLines::LinesDistancer current_perimeter_distancer(current_perimeter_lines); @@ -733,10 +768,9 @@ bool offset_wipe_path_toward_support(Polyline &polyline, Point seam_start, Point double path_length; }; - // Direction and wall contact have different origins after a loop pre-move. - // Keep the construction's wall endpoint for intersection checks even when - // the candidate's direction must be checked from the current nozzle position. - const auto validate_candidate = [&](Polyline path, Point path_start, Point direction_start, + // Check direction from the actual nozzle position, while retaining the + // construction's wall endpoint for connector intersection checks. + const auto validate_candidate = [&](Polyline path, Point path_start, double path_contact_tolerance, const Vec2d &candidate_support_direction, double candidate_offset, @@ -749,7 +783,7 @@ bool offset_wipe_path_toward_support(Polyline &polyline, Point seam_start, Point // than the requested offset. Preserve the zero-gap clearance rule, but // check direction and local material side independently for every gap. const bool material_side = wipe_path_stays_on_material_side( - path, direction_start, candidate_support_direction, + path, wipe_start, candidate_support_direction, support_distancer, current_perimeter_distancer, candidate_offset, require_clearance && seam_start == seam_end); const bool connector_clear = initial_connector_is_clear( @@ -769,7 +803,7 @@ bool offset_wipe_path_toward_support(Polyline &polyline, Point seam_start, Point if (! offset_wipe_path(path, seam_start, seam_end, wipe_start, dir, effective_offset, max_wipe_length)) return std::nullopt; - return validate_candidate(std::move(path), seam_start, seam_start, + return validate_candidate(std::move(path), seam_start, contact_tolerance, support_direction, effective_offset); }; @@ -790,7 +824,7 @@ bool offset_wipe_path_toward_support(Polyline &polyline, Point seam_start, Point candidate_translation, max_wipe_length)) return std::nullopt; const double candidate_tolerance = wipe_tolerance(candidate_offset); - return validate_candidate(std::move(source), source_start, source_start, candidate_tolerance, + return validate_candidate(std::move(source), source_start, candidate_tolerance, candidate_support_offset / support_distance, candidate_offset); }; @@ -815,7 +849,7 @@ bool offset_wipe_path_toward_support(Polyline &polyline, Point seam_start, Point const double candidate_tolerance = wipe_tolerance(candidate_offset); // Check the executed direction from the nozzle after any loop pre-move, // but retain the wall origin for the connector's intersection checks. - return validate_candidate(std::move(path), origin, wipe_start, + return validate_candidate(std::move(path), origin, candidate_tolerance, direction, candidate_offset, false); }; std::optional direct = direct_candidate(seam_end, toward_support); @@ -842,7 +876,7 @@ bool offset_wipe_path_toward_support(Polyline &polyline, Point seam_start, Point offset_wipe_path(reversed_source, seam_end, seam_start, wipe_start, -preferred_dir, reverse_offset, max_wipe_length)) { reversed_source.points.front() = seam_start; - auto candidate = validate_candidate(std::move(reversed_source), seam_end, seam_end, + auto candidate = validate_candidate(std::move(reversed_source), seam_end, wipe_tolerance(reverse_offset), reversed_support_offset->normalized(), reverse_offset); if (candidate && (! reversed || (candidate->path_length > reversed->path_length + length_margin && diff --git a/src/libslic3r/GCode/WipePathHelpers.hpp b/src/libslic3r/GCode/WipePathHelpers.hpp index 17c0dfa238..3def315a03 100644 --- a/src/libslic3r/GCode/WipePathHelpers.hpp +++ b/src/libslic3r/GCode/WipePathHelpers.hpp @@ -11,9 +11,13 @@ namespace Slic3r { // Printed prefix of one region's perimeter sequence. Append each entity only // after extrusion; later walls and other regions cannot support an inward wipe. +// When the adjacent inner wall is printed after the external wall, all inner +// walls are collected in advance as targets: they identify the inward side +// and the local wall count, while only printed walls support the path. struct WipeInwardSupport { Lines printed_lines; Lines inner_lines; + bool inner_lines_complete = false; void append(const ExtrusionEntity &entity); }; diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index 4852aa51ba..a207657eba 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -906,6 +906,64 @@ StringObjectException Print::sequential_print_clearance_valid(const Print &print Polygon hull_polygon; int object_index; double height; + // Whether the instance reaches above extruder_clearance_height_to_rod, and the Y extent of it + // the rod can hit while a later instance prints (see above_rod_y_range). + bool has_above_rod = false; + coord_t rod_min_y = 0; + coord_t rod_max_y = 0; + }; + // ORCA: Y extent of an instance's geometry above the rod height, in the same coordinates as the + // bounding boxes below. Conservative: any triangle with a vertex above the rod contributes all + // three of its vertices. Modifiers, blockers and negative volumes are not printed and are skipped. + const double rod_height = print.config().extruder_clearance_height_to_rod.value; + // A skirt is a wall around the whole footprint: a draft shield as tall as the object, otherwise + // skirt_height layers tall. Once it can reach the rod, the rod can hit the whole footprint, not just + // the geometry above the rod. A max_layer_height of 0 means 0.75 x nozzle diameter, as in Slicing.cpp. + double max_layer_height = 0.; + for (size_t i = 0; i < print.config().nozzle_diameter.size(); ++i) { + const double h = print.config().max_layer_height.get_at(i); + max_layer_height = std::max(max_layer_height, h > 0. ? h : 0.75 * print.config().nozzle_diameter.get_at(i)); + } + const bool skirt_reaches_rod = print.has_infinite_skirt() || + (print.config().skirt_loops > 0 && print.config().skirt_height * max_layer_height > rod_height); + auto above_rod_y_range = [rod_height](const PrintInstance &instance, coord_t &min_y, coord_t &max_y) -> bool { + // A raft lifts the whole object by its thickness, so mesh Z this far below the rod prints above it. + const double rod_z = rod_height - instance.print_object->slicing_parameters().object_print_z_min; + // Skip the mesh walk for the common case of an object that doesn't reach the rod. Like the too-tall + // check below, this compares the top without the raft, so an object only its raft lifts above the + // rod keeps the footprint test. + if (instance.print_object->max_z() <= scale_(rod_height)) + return false; + double ymin = std::numeric_limits::max(); + double ymax = std::numeric_limits::lowest(); + bool any = false; + const Transform3d inst_trafo = instance.model_instance->get_transformation().get_matrix(); + for (const ModelVolume *volume : instance.print_object->model_object()->volumes) { + if (!volume->is_model_part()) + continue; + const Transform3d trafo = inst_trafo * volume->get_transformation().get_matrix(); + const indexed_triangle_set &its = volume->mesh().its; + std::vector ys(its.vertices.size()), zs(its.vertices.size()); + for (size_t i = 0; i < its.vertices.size(); ++i) { + const Vec3d p = trafo * its.vertices[i].cast(); + ys[i] = p.y(); + zs[i] = p.z(); + } + for (const auto &f : its.indices) { + if (zs[f(0)] <= rod_z && zs[f(1)] <= rod_z && zs[f(2)] <= rod_z) + continue; + for (int j = 0; j < 3; ++j) { + ymin = std::min(ymin, ys[f(j)]); + ymax = std::max(ymax, ys[f(j)]); + } + any = true; + } + } + if (any) { + min_y = scaled(ymin); + max_y = scaled(ymax); + } + return any; }; auto find_object_index = [](const Model& model, const ModelObject* obj) { for (int index = 0; index < model.objects.size(); index++) @@ -999,6 +1057,23 @@ StringObjectException Print::sequential_print_clearance_valid(const Print &print struct print_instance_info print_info {&instance, convex_hull.bounding_box(), convex_hull}; print_info.height = instance.print_object->height(); print_info.object_index = find_object_index(print.model(), print_object->model_object()); + print_info.has_above_rod = above_rod_y_range(instance, print_info.rod_min_y, print_info.rod_max_y); + const BoundingBox footprint = print_info.bounding_box.inflated(-scale_(0.5 * print.config().extruder_clearance_radius.value + object_skirt_offset)); + if (print_info.has_above_rod && !skirt_reaches_rod) { + // The other instance's footprint is grown by half of extruder_clearance_radius, but the rod + // can reach as far as extruder_clearance_dist_to_rod: widen this range by the difference, then + // shrink it by the same 0.1 mm tolerance the footprint test uses. Never past the footprint + // itself, so plates that pass the footprint test still validate. + const coord_t extra = scaled(std::max(0., print.config().extruder_clearance_dist_to_rod.value - 0.5 * print.config().extruder_clearance_radius.value)); + print_info.rod_min_y = std::max(print_info.rod_min_y + scaled(0.1) - extra, footprint.min.y()); + print_info.rod_max_y = std::min(print_info.rod_max_y - scaled(0.1) + extra, footprint.max.y()); + } else { + // Below the rod, or with a skirt that reaches it, test the footprint as before. On printers whose + // lid clearance is lower than the rod's, overlapping a later instance is what lets an + // object below the rod use the rod height instead of the lid height. + print_info.rod_min_y = footprint.min.y(); + print_info.rod_max_y = footprint.max.y(); + } print_instance_with_bounding_box.push_back(std::move(print_info)); convex_hulls_other.emplace_back(std::move(convex_hull)); } @@ -1018,8 +1093,8 @@ StringObjectException Print::sequential_print_clearance_valid(const Print &print double hc2 = scale_(print.config().extruder_clearance_height_to_rod); // height to rod double printable_height = scale_(print.config().printable_height); - // Print each instance taller than hc2 after every instance it overlaps in Y, keeping list order where possible. - // With no valid order, keep the list order so the check below reports the collision. + // Print each instance that reaches above hc2 after every instance that overlaps that part of it in Y, keeping list + // order where possible. With no valid order, keep the list order so the check below reports the collision. { const size_t n = print_instance_with_bounding_box.size(); @@ -1031,16 +1106,23 @@ StringObjectException Print::sequential_print_clearance_valid(const Print &print for (size_t i = 0; i < n; ++i) fallback_order[i] = i; std::stable_sort(fallback_order.begin(), fallback_order.end(), by_object_index); - // Mirrors the inflation the vertical-clearance check below applies: only the - // potentially-too-tall instance's footprint is shrunk before testing Y overlap. - // A structured binding can't be captured by a lambda before C++20, so copy it first. - const float skirt_offset = object_skirt_offset; + // Every instance of an object shares its object_index, so order by place in the list instead, + // which tells instances apart and keeps copies of one object in their list order. + std::vector list_position(n); + for (size_t k = 0; k < n; ++k) + list_position[fallback_order[k]] = k; + auto by_list_position = [&list_position](size_t l, size_t r) { return list_position[l] < list_position[r]; }; + + // Mirrors the vertical-clearance check below: the part of the potentially-too-tall instance + // the rod can hit (see rod_min_y) is tested against the other instance's inflated footprint, + // i.e. everywhere the nozzle can be while that instance prints. auto overlaps_in_y = [&](size_t tall_idx, size_t other_idx) { - auto bbA = print_instance_with_bounding_box[tall_idx].bounding_box.inflated( - -scale_(0.5 * print.config().extruder_clearance_radius.value + skirt_offset)); + const auto &A = print_instance_with_bounding_box[tall_idx]; + if (!A.has_above_rod) + return false; auto &bbB = print_instance_with_bounding_box[other_idx].bounding_box; - auto inter_min = std::max(bbA.min.y(), bbB.min.y()); - auto inter_max = std::min(bbA.max.y(), bbB.max.y()); + auto inter_min = std::max(A.rod_min_y, bbB.min.y()); + auto inter_max = std::min(A.rod_max_y, bbB.max.y()); return inter_max - inter_min > 0; }; @@ -1061,7 +1143,7 @@ StringObjectException Print::sequential_print_clearance_valid(const Print &print bool infeasible = false; for (size_t a = 0; a < n && !infeasible; ++a) { if (a == last_idx) continue; - if (print_instance_with_bounding_box[a].height <= hc2) continue; // short enough: no constraint + if (!print_instance_with_bounding_box[a].has_above_rod) continue; // nothing reaches the rod: no constraint for (size_t b = 0; b < n; ++b) { if (b == a) continue; if (!overlaps_in_y(a, b)) continue; @@ -1078,13 +1160,13 @@ StringObjectException Print::sequential_print_clearance_valid(const Print &print } if (!infeasible) { - // Kahn's algorithm; ties are broken by original object_index so the result is + // Kahn's algorithm; ties are broken by place in the list so the result is // the minimal perturbation of the incoming order, not an arbitrary one. std::vector ready; for (size_t i = 0; i < n; ++i) if (i != last_idx && indegree[i] == 0) ready.push_back(i); - std::sort(ready.begin(), ready.end(), by_object_index); + std::sort(ready.begin(), ready.end(), by_list_position); std::vector order; order.reserve(n); @@ -1094,7 +1176,7 @@ StringObjectException Print::sequential_print_clearance_valid(const Print &print order.push_back(cur); for (size_t nxt : adj[cur]) { if (--indegree[nxt] == 0) { - auto pos = std::upper_bound(ready.begin(), ready.end(), nxt, by_object_index); + auto pos = std::upper_bound(ready.begin(), ready.end(), nxt, by_list_position); ready.insert(pos, nxt); } } @@ -1117,9 +1199,6 @@ StringObjectException Print::sequential_print_clearance_valid(const Print &print // differs from it, naming the instances held back to clear the rod: those printed later than // their place in the list. The first of them is the jump target. if (warning != nullptr && solved && solved_order != fallback_order) { - std::vector list_position(n); - for (size_t k = 0; k < n; ++k) - list_position[fallback_order[k]] = k; for (size_t k = 0; k < n; ++k) { if (k <= list_position[solved_order[k]]) continue; @@ -1152,33 +1231,6 @@ StringObjectException Print::sequential_print_clearance_valid(const Print &print } // sequential_print_vertical_clearance_valid { - // Ignore the last instance printed. - //print_instance_with_bounding_box.pop_back(); - /*bool has_interlaced_objects = false; - for (int k = 0; k < print_instance_count; k++) - { - auto inst = print_instance_with_bounding_box[k].print_instance; - auto bbox = print_instance_with_bounding_box[k].bounding_box; - auto iy1 = bbox.min.y(); - auto iy2 = bbox.max.y(); - - for (int i = 0; i < k; i++) - { - auto& p = print_instance_with_bounding_box[i].print_instance; - auto bbox2 = print_instance_with_bounding_box[i].bounding_box; - auto py1 = bbox2.min.y(); - auto py2 = bbox2.max.y(); - auto inter_min = std::max(iy1, py1); // min y of intersection - auto inter_max = std::min(iy2, py2); // max y of intersection. length=max_y-min_y>0 means intersection exists - if (inter_max - inter_min > 0) { - has_interlaced_objects = true; - break; - } - } - if (has_interlaced_objects) - break; - }*/ - // if objects are not overlapped on y-axis, they will not collide even if they are taller than extruder_clearance_height_to_rod int print_instance_count = print_instance_with_bounding_box.size(); std::map> too_tall_instances; @@ -1187,21 +1239,12 @@ StringObjectException Print::sequential_print_clearance_valid(const Print &print auto inst = print_instance_with_bounding_box[k].print_instance; // 只需要考虑喷嘴到滑杆的偏移量,这个比整个工具头的碰撞半径要小得多 // Only the offset from the nozzle to the slide bar needs to be considered, which is much smaller than the collision radius of the entire tool head. - auto bbox = print_instance_with_bounding_box[k].bounding_box.inflated(-scale_(0.5 * print.config().extruder_clearance_radius.value + object_skirt_offset)); - auto iy1 = bbox.min.y(); - auto iy2 = bbox.max.y(); + // ORCA: test only the part of this instance the rod can hit (see rod_min_y). + const auto &info_k = print_instance_with_bounding_box[k]; + const coord_t iy1 = info_k.rod_min_y; + const coord_t iy2 = info_k.rod_max_y; (const_cast(inst->model_instance))->arrange_order = k+1; double height = (k == (print_instance_count - 1))?printable_height:hc1; - /*if (has_interlaced_objects) { - if ((k < (print_instance_count - 1)) && (inst->print_object->height() > hc2)) { - too_tall_instances[inst] = std::make_pair(print_instance_with_bounding_box[k].hull_polygon, unscaled(hc2)); - } - } - else { - if ((k < (print_instance_count - 1)) && (inst->print_object->height() > hc1)) { - too_tall_instances[inst] = std::make_pair(print_instance_with_bounding_box[k].hull_polygon, unscaled(hc1)); - } - }*/ for (int i = k+1; i < print_instance_count; i++) { @@ -5402,7 +5445,7 @@ void Print::_make_wipe_tower() if (!layer_tools.has_wipe_tower) continue; bool first_layer = &layer_tools == &m_wipe_tower_data.tool_ordering.front(); - wipe_tower.plan_toolchange((float)layer_tools.print_z, (float)layer_tools.wipe_tower_layer_height, current_filament_id, current_filament_id); + wipe_tower.plan_toolchange((float)layer_tools.wipe_tower_print_z, (float)layer_tools.wipe_tower_layer_height, current_filament_id, current_filament_id); used_filament_ids.insert(layer_tools.extruders.begin(), layer_tools.extruders.end()); @@ -5453,7 +5496,7 @@ void Print::_make_wipe_tower() wipe_volume_nc = 15.f; } - wipe_tower.plan_toolchange((float)layer_tools.print_z, (float)layer_tools.wipe_tower_layer_height, current_filament_id, filament_id, + wipe_tower.plan_toolchange((float)layer_tools.wipe_tower_print_z, (float)layer_tools.wipe_tower_layer_height, current_filament_id, filament_id, wipe_volume_ec, wipe_volume_nc, volume_to_purge); current_filament_id = filament_id; } @@ -5560,7 +5603,7 @@ void Print::_make_wipe_tower() if (!layer_tools.has_wipe_tower) continue; bool first_layer = &layer_tools == &m_wipe_tower_data.tool_ordering.front(); - wipe_tower.plan_toolchange((float) layer_tools.print_z, (float) layer_tools.wipe_tower_layer_height, current_extruder_id, + wipe_tower.plan_toolchange((float) layer_tools.wipe_tower_print_z, (float) layer_tools.wipe_tower_layer_height, current_extruder_id, current_extruder_id, false); for (const auto extruder_id : layer_tools.extruders) { if ((first_layer && extruder_id == m_wipe_tower_data.tool_ordering.all_extruders().back()) || extruder_id != @@ -5581,7 +5624,7 @@ void Print::_make_wipe_tower() } // request a toolchange at the wipe tower with at least volume_to_wipe purging amount - wipe_tower.plan_toolchange((float) layer_tools.print_z, (float) layer_tools.wipe_tower_layer_height, + wipe_tower.plan_toolchange((float) layer_tools.wipe_tower_print_z, (float) layer_tools.wipe_tower_layer_height, current_extruder_id, extruder_id, volume_to_wipe); current_extruder_id = extruder_id; } diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index a8260cae3f..eb952087ca 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -6670,12 +6670,11 @@ void PrintConfigDef::init_fff_params() def = this->add("wipe_inward", coBool); def->label = L("Wipe inward"); def->category = L("Quality"); - def->tooltip = L("Applies only to external walls, including hole boundaries. Moves the hot nozzle toward printed " + def->tooltip = L("Applies only to external walls, including hole boundaries. Moves the hot nozzle toward the " "inner walls during wiping to reduce reheating of freshly printed plastic and seam marks.\n\n" "Especially useful at layer heights below 0.1 mm, where wipe marks are more visible.\n\n" - "Uses the regular wipe if no adjacent inner wall is already printed (single-wall areas or " - "Outer/Inner wall order), or if no supported inward path can be found, for example at tight " - "corners or seam gaps."); + "Uses the regular wipe where the outer wall has no adjacent inner wall, such as in single-wall " + "areas, or if no supported inward path can be found, for example at tight corners or seam gaps."); def->mode = comExpert; def->set_default_value(new ConfigOptionBool(false)); @@ -6688,7 +6687,10 @@ void PrintConfigDef::init_fff_params() "For example, 50% shifts the path by half of the outer-wall width. The effective offset is limited " "by both the actual outer-wall width and the available spacing to the adjacent wall, so values " "above 100% or an equivalent absolute distance have no additional effect. " - "Set to 0 to disable the offset."); + "Set to 0 to disable the offset.\n\n" + "With Outer/Inner or Inner/Outer/Inner wall order, the offset is limited to 50% of the actual " + "outer-wall width because the adjacent inner wall is printed after the outer wall. " + "This also applies to equivalent distances specified in millimeters."); def->sidetext = L("mm or %"); def->ratio_over = "outer_wall_line_width"; def->min = 0; diff --git a/src/libslic3r/Support/TreeSupport3D.cpp b/src/libslic3r/Support/TreeSupport3D.cpp index e2bd31eadd..40f15dcabb 100644 --- a/src/libslic3r/Support/TreeSupport3D.cpp +++ b/src/libslic3r/Support/TreeSupport3D.cpp @@ -51,7 +51,6 @@ #include #include #include -#include #include #include #include @@ -918,9 +917,39 @@ public: const bool force_tip_to_roof; bool min_xy_dist; + struct PendingRoof { + Polygons polygons; + size_t layer_idx; + size_t dtt_roof; + }; + struct PendingTip { + std::pair point; + LayerIndex insert_layer; + size_t dont_move_until; + bool roof; + size_t roof_recovery_dtt; + bool skip_ovalisation; + }; + // Roofs and tips of one overhang layer. Overhang layers are processed in parallel and a tip may be dropped + // in favor of a nearby one inserted earlier, so they are collected here and committed in overhang layer order + // to keep the result independent of thread timing. + struct Placement { + std::vector roofs; + std::vector tips; + }; + + void commit(Placement &&placement) + { + for (PendingRoof &roof : placement.roofs) + this->add_roof_unguarded(std::move(roof.polygons), roof.layer_idx, roof.dtt_roof); + for (const PendingTip &tip : placement.tips) + add_point_as_influence_area(tip); + } + public: // called by sample_overhang_area() void add_points_along_lines( + Placement &placement, // Insert points (tree tips or top contact interfaces) along these lines. LineInformations lines, // Start at this layer. @@ -963,7 +992,7 @@ public: // add all points that would not be valid for (const LineInformation &line : points) for (const std::pair &point_data : line) - add_point_as_influence_area(point_data, this_layer_idx, + placement.tips.push_back({ point_data, LayerIndex(this_layer_idx), // don't move until roof_tip_layers - dtt_roof_tip, // supports roof @@ -971,7 +1000,7 @@ public: // recovered roof/contact depth for this slice roof_recovery_depth, // disable ovalization - false); + false }); } // add all tips as roof to the roof storage @@ -984,7 +1013,7 @@ public: roof_circle.translate(p.first); new_roofs.emplace_back(std::move(roof_circle)); } - this->add_roof(std::move(new_roofs), this_layer_idx, roof_recovery_depth); + placement.roofs.push_back({ std::move(new_roofs), this_layer_idx, roof_recovery_depth }); } const size_t roof_recovery_depth = dtt_roof_tip + supports_roof_layers; @@ -993,59 +1022,56 @@ public: // Ovalisation should be disabled for these to improve the quality of the lines when tip_diameter=line_width bool disable_ovalistation = config.min_radius < 3 * config.support_line_width && roof_tip_layers == 0 && dtt_roof_tip == 0 && line.size() > 5; for (const std::pair &point_data : line) - add_point_as_influence_area(point_data, insert_layer_idx - dtt_roof_tip, + placement.tips.push_back({ point_data, insert_layer_idx - LayerIndex(dtt_roof_tip), // don't move until dont_move_until > dtt_roof_tip ? dont_move_until - dtt_roof_tip : 0, // supports roof roof_recovery_depth > 0, // recovered roof/contact depth for this slice roof_recovery_depth, - disable_ovalistation); + disable_ovalistation }); } } private: - // called by this->add_points_along_lines() - void add_point_as_influence_area(std::pair p, LayerIndex insert_layer, size_t dont_move_until, bool roof, size_t roof_recovery_dtt, bool skip_ovalisation) + // called by this->commit() + void add_point_as_influence_area(const PendingTip &tip) { - bool to_bp = p.second == LineStatus::TO_BP || p.second == LineStatus::TO_BP_SAFE; - bool gracious = to_bp || p.second == LineStatus::TO_MODEL_GRACIOUS || p.second == LineStatus::TO_MODEL_GRACIOUS_SAFE; - bool safe_radius = p.second == LineStatus::TO_BP_SAFE || p.second == LineStatus::TO_MODEL_GRACIOUS_SAFE; + const Point &position = tip.point.first; + const LineStatus status = tip.point.second; + bool to_bp = status == LineStatus::TO_BP || status == LineStatus::TO_BP_SAFE; + bool gracious = to_bp || status == LineStatus::TO_MODEL_GRACIOUS || status == LineStatus::TO_MODEL_GRACIOUS_SAFE; + bool safe_radius = status == LineStatus::TO_BP_SAFE || status == LineStatus::TO_MODEL_GRACIOUS_SAFE; if (! config.support_rests_on_model && ! to_bp) { BOOST_LOG_TRIVIAL(warning) << "Tried to add an invalid support point"; tree_supports_show_error("Unable to add tip. Some overhang may not be supported correctly."sv, true); return; } - Polygons circle{ m_base_circle }; - circle.front().translate(p.first); - { - Point hash_pos = p.first / ((config.min_radius + 1) / 10); - std::lock_guard critical_section_movebounds(m_mutex_movebounds); - if (!m_already_inserted[insert_layer].count(hash_pos)) { - // normalize the point a bit to also catch points which are so close that inserting it would achieve nothing - m_already_inserted[insert_layer].emplace(hash_pos); - static constexpr const size_t dtt = 0; - SupportElementState state; - state.target_height = insert_layer; - state.target_position = p.first; - state.next_position = p.first; - state.layer_idx = insert_layer; - state.effective_radius_height = dtt; - state.to_buildplate = to_bp; - state.distance_to_top = dtt; - state.result_on_layer = p.first; - assert(state.result_on_layer_is_set()); - state.increased_to_model_radius = 0; - state.to_model_gracious = gracious; - state.elephant_foot_increases = 0; - state.use_min_xy_dist = min_xy_dist; - state.supports_roof = roof; - state.dont_move_until = dont_move_until; - state.can_use_safe_radius = safe_radius; - state.set_pending_roof_recovery(force_tip_to_roof ? dont_move_until : 0, roof_recovery_dtt); - state.skip_ovalisation = skip_ovalisation; - move_bounds[insert_layer].emplace_back(state, std::move(circle)); - } + // normalize the point a bit to also catch points which are so close that inserting it would achieve nothing + if (m_already_inserted[tip.insert_layer].emplace(position / ((config.min_radius + 1) / 10)).second) { + Polygons circle{ m_base_circle }; + circle.front().translate(position); + static constexpr const size_t dtt = 0; + SupportElementState state; + state.target_height = tip.insert_layer; + state.target_position = position; + state.next_position = position; + state.layer_idx = tip.insert_layer; + state.effective_radius_height = dtt; + state.to_buildplate = to_bp; + state.distance_to_top = dtt; + state.result_on_layer = position; + assert(state.result_on_layer_is_set()); + state.increased_to_model_radius = 0; + state.to_model_gracious = gracious; + state.elephant_foot_increases = 0; + state.use_min_xy_dist = min_xy_dist; + state.supports_roof = tip.roof; + state.dont_move_until = tip.dont_move_until; + state.can_use_safe_radius = safe_radius; + state.set_pending_roof_recovery(force_tip_to_roof ? tip.dont_move_until : 0, tip.roof_recovery_dtt); + state.skip_ovalisation = tip.skip_ovalisation; + move_bounds[tip.insert_layer].emplace_back(state, std::move(circle)); } } @@ -1056,8 +1082,6 @@ private: coord_t m_base_radius; Polygon m_base_circle; - // Mutexes, guards - std::mutex m_mutex_movebounds; std::vector> m_already_inserted; }; @@ -1157,8 +1181,10 @@ void sample_overhang_area( const coord_t connect_length, // Configuration classes const TreeSupportMeshGroupSettings& mesh_group_settings, - // Configuration & Output - RichInterfacePlacer& interface_placer) + // Configuration + RichInterfacePlacer& interface_placer, + // Output + RichInterfacePlacer::Placement& placement) { // Assumption is that roof will support roof further up to avoid a lot of unnecessary branches. Each layer down it is checked whether the roof area // is still large enough to be a roof and aborted as soon as it is not. This part was already reworked a few times, and there could be an argument @@ -1226,7 +1252,9 @@ void sample_overhang_area( } } added_roofs.erase(added_roofs.begin() + dtt_roof, added_roofs.end()); - interface_placer.add_roofs(std::move(added_roofs), layer_idx); + for (size_t idx = 0; idx < added_roofs.size(); ++ idx) + if (! added_roofs[idx].empty()) + placement.roofs.push_back({ std::move(added_roofs[idx]), layer_idx - idx, idx }); } if (overhang_lines.empty()) { @@ -1263,11 +1291,12 @@ void sample_overhang_area( assert(dtt_roof <= layer_idx); if (dtt_roof >= layer_idx && large_horizontal_roof) // Reached buildplate when generating contact, interface and base interface layers. - interface_placer.add_roof_build_plate(std::move(overhang_area), dtt_roof); + placement.roofs.push_back({ std::move(overhang_area), 0, std::min(dtt_roof, interface_placer.support_parameters.num_top_interface_layers) }); else { // normal trees have to be generated const bool roof_enabled = num_support_roof_layers > 0; interface_placer.add_points_along_lines( + placement, // Sample along these lines overhang_lines, // First layer index to insert the tree tips or interfaces. @@ -1367,14 +1396,16 @@ static void generate_initial_areas( } RichInterfacePlacer rich_interface_placer{ interface_placer, volumes, force_tip_to_roof, num_support_layers, move_bounds }; + std::vector placements(raw_overhangs.size()); tbb::parallel_for(tbb::blocked_range(0, raw_overhangs.size()), [&volumes, &config, &raw_overhangs, &mesh_group_settings, min_xy_dist, roof_enabled, num_support_roof_layers, extra_outset, circle_length_to_half_linewidth_change, connect_length, - &rich_interface_placer, &throw_on_cancel](const tbb::blocked_range &range) { + &rich_interface_placer, &placements, &throw_on_cancel](const tbb::blocked_range &range) { for (size_t raw_overhang_idx = range.begin(); raw_overhang_idx < range.end(); ++ raw_overhang_idx) { size_t layer_idx = raw_overhangs[raw_overhang_idx].first; const Polygons &overhang_raw = *raw_overhangs[raw_overhang_idx].second; + RichInterfacePlacer::Placement &placement = placements[raw_overhang_idx]; // take the least restrictive avoidance possible Polygons relevant_forbidden; @@ -1463,7 +1494,7 @@ static void generate_initial_areas( LineInformations fresh_valid_points = convert_lines_to_internal(volumes, config, convert_internal_to_lines(split.second), layer_idx - lag_ctr); validate_range(fresh_valid_points); - rich_interface_placer.add_points_along_lines(fresh_valid_points, (force_tip_to_roof && lag_ctr <= num_support_roof_layers) ? num_support_roof_layers : 0, layer_idx - lag_ctr, false, roof_enabled ? num_support_roof_layers : 0); + rich_interface_placer.add_points_along_lines(placement, fresh_valid_points, (force_tip_to_roof && lag_ctr <= num_support_roof_layers) ? num_support_roof_layers : 0, layer_idx - lag_ctr, false, roof_enabled ? num_support_roof_layers : 0); } } #endif @@ -1481,7 +1512,7 @@ static void generate_initial_areas( //check_self_intersections(overhang_regular, "overhang_regular3"); for (ExPolygon &roof_part : union_ex(overhang_roofs)) { sample_overhang_area(to_polygons(std::move(roof_part)), true, layer_idx, num_support_roof_layers, connect_length, - mesh_group_settings, rich_interface_placer); + mesh_group_settings, rich_interface_placer, placement); throw_on_cancel(); } } @@ -1493,12 +1524,15 @@ static void generate_initial_areas( for (ExPolygon &support_part : union_ex(overhang_regular)) { sample_overhang_area(to_polygons(std::move(support_part)), false, layer_idx, num_support_roof_layers, connect_length, - mesh_group_settings, rich_interface_placer); + mesh_group_settings, rich_interface_placer, placement); throw_on_cancel(); } } }); + for (RichInterfacePlacer::Placement &placement : placements) + rich_interface_placer.commit(std::move(placement)); + finalize_raft_contact(print_object, raft_contact_layer_idx, interface_placer.top_contacts_mutable(), move_bounds); } diff --git a/src/libslic3r/Support/TreeSupportCommon.hpp b/src/libslic3r/Support/TreeSupportCommon.hpp index 6767d2193a..4bbb3cdb18 100644 --- a/src/libslic3r/Support/TreeSupportCommon.hpp +++ b/src/libslic3r/Support/TreeSupportCommon.hpp @@ -710,7 +710,8 @@ inline SupportGeneratorLayer& layer_allocate( return layer_initialize(layer, slicing_params, config, layer_idx); } -// Used by generate_initial_areas() in parallel by multiple layers. +// Adds top contact and interface areas to the support layers. add_roof() may be called from several threads, +// add_roof_unguarded() only while no other thread is adding roofs. class InterfacePlacer { public: InterfacePlacer( @@ -736,30 +737,12 @@ public: SupportGeneratorLayersPtr& top_contacts_mutable() { return this->top_contacts; } public: - // Insert the contact layer and some of the interface and base interface layers below. - void add_roofs(std::vector &&new_roofs, const size_t insert_layer_idx) - { - if (! new_roofs.empty()) { - std::lock_guard lock(m_mutex_layer_storage); - for (size_t idx = 0; idx < new_roofs.size(); ++ idx) - if (! new_roofs[idx].empty()) - add_roof_unguarded(std::move(new_roofs[idx]), insert_layer_idx - idx, idx); - } - } - void add_roof(Polygons &&new_roof, const size_t insert_layer_idx, const size_t dtt_tip) { std::lock_guard lock(m_mutex_layer_storage); add_roof_unguarded(std::move(new_roof), insert_layer_idx, dtt_tip); } - // called by sample_overhang_area() - void add_roof_build_plate(Polygons &&overhang_areas, size_t dtt_roof) - { - std::lock_guard lock(m_mutex_layer_storage); - this->add_roof_unguarded(std::move(overhang_areas), 0, std::min(dtt_roof, this->support_parameters.num_top_interface_layers)); - } - void add_roof_unguarded(Polygons &&new_roofs, const size_t insert_layer_idx, const size_t dtt_roof) { assert(support_parameters.has_top_contacts); diff --git a/src/slic3r/CMakeLists.txt b/src/slic3r/CMakeLists.txt index 272fa8072d..39cc2faf8f 100644 --- a/src/slic3r/CMakeLists.txt +++ b/src/slic3r/CMakeLists.txt @@ -591,6 +591,8 @@ set(SLIC3R_GUI_SOURCES GUI/SceneRaycaster.hpp GUI/SceneCache.cpp GUI/SceneCache.hpp + GUI/SelectionOutline.cpp + GUI/SelectionOutline.hpp GUI/FrameProfiler.cpp GUI/FrameProfiler.hpp GUI/SceneBenchmark.cpp diff --git a/src/slic3r/GUI/3DScene.cpp b/src/slic3r/GUI/3DScene.cpp index 5cdf3b0f25..60e8016fec 100644 --- a/src/slic3r/GUI/3DScene.cpp +++ b/src/slic3r/GUI/3DScene.cpp @@ -12,6 +12,7 @@ #include "PartPlate.hpp" #include "BitmapCache.hpp" #include "Camera.hpp" +#include "SelectionOutline.hpp" #include "libslic3r/BuildVolume.hpp" #include "libslic3r/ExtrusionEntity.hpp" @@ -107,9 +108,6 @@ float FullTransparentModdifiedToFixAlpha = 0.3f; // value like 0.18f could not because in C++ (int)(0.18f * 255) == 45 however in OpenGL it renders this as 46 // which breaks the `SelectMachineDialog::record_edge_pixels_data()` function! float FULL_BLACK_THRESHOLD = 0.2f; -// Keep depth_tex away from texture unit 0 to avoid sampler-type aliasing with -// shadow/environment samplers when realistic view is disabled. -static constexpr int OUTLINE_DEPTH_TEX_UNIT = 5; Slic3r::ColorRGBA adjust_color_for_rendering(const Slic3r::ColorRGBA &colors) { @@ -551,159 +549,6 @@ void GLVolume::render() simple_render(shader, model_objects, colors); } -//BBS: add outline related logic -void GLVolume::render_with_outline(const GUI::Size& cnv_size) -{ - if (!is_active) - return; - - GLShaderProgram *shader = GUI::wxGetApp().get_current_shader(); - if (shader == nullptr) - return; - - ModelObjectPtrs &model_objects = GUI::wxGetApp().model().objects; - std::vector colors = GUI::wxGetApp().plater()->get_extruders_colors(); - - const GUI::OpenGLManager::EFramebufferType framebuffers_type = GUI::OpenGLManager::get_framebuffers_type(); - if (framebuffers_type == GUI::OpenGLManager::EFramebufferType::Unknown) { - // No supported, degrade to normal rendering - simple_render(shader, model_objects, colors); - return; - } - // 0th. render pass, render the model using stencil buffer - glsafe(::glEnable(GL_STENCIL_TEST)); - glsafe(::glStencilMask(0xFF)); - glsafe(::glStencilOp(GL_KEEP, GL_REPLACE, GL_REPLACE)); - glsafe(::glClearStencil(0)); - glsafe(::glClear(GL_STENCIL_BUFFER_BIT)); - glsafe(::glStencilFunc(GL_ALWAYS, 0xFF, 0xFF)); - // This pass paints the visible surface, so it must go through simple_render() to keep - // per-triangle MMU paint colors; the later is_outline passes only draw the flat silhouette - // highlight and are fine using the single-color model. - simple_render(shader, model_objects, colors); - glsafe(::glStencilFunc(GL_NOTEQUAL, 0xFF, 0xFF)); - glsafe(::glStencilMask(0x00)); - shader->set_uniform("is_outline", true); - shader->set_uniform("screen_size", Vec2f{cnv_size.get_width(), cnv_size.get_height()}); - if (tverts_range == std::make_pair(0, -1)) - model.render(shader); - else - model.render(this->tverts_range, shader); - shader->set_uniform("is_outline", false); - glsafe(::glStencilMask(0xFF)); - glsafe(::glDisable(GL_STENCIL_TEST)); - // render the outline using depth buffer and discard the pixels that are not on the outline - // The silhouette is resolved per sample in the shader (see DetectSilho in gouraud.fs/phong.fs). - // That needs the GL 3.2 entry points and a shader that declares depth_tex as sampler2DMS, which - // only the 140 ones do and only under GL_ARB_texture_multisample - so ask the compiled program - // rather than the GL version, or a sampler2D ends up bound to a multisample texture. - // Only the Arb branch below allocates a multisample texture, so keep the target consistent with it. - const bool use_msaa_outline = framebuffers_type == GUI::OpenGLManager::EFramebufferType::Arb && - GUI::wxGetApp().is_gl_version_greater_or_equal_to(3, 2) && - shader->get_uniform_location("msaa_samples") >= 0; - const GLenum depth_tex_target = use_msaa_outline ? GL_TEXTURE_2D_MULTISAMPLE : GL_TEXTURE_2D; - // Keep the depth texture off image unit 0. The object shaders leave shadow_map (and - // environment_tex) at the default sampler value 0 whenever the shadow pass is skipped - which is - // the case with realistic view off - and GL forbids two sampler types referring to the same image - // unit. A sampler2DMS on unit 0 then makes every draw fail with INVALID_OPERATION on drivers that - // enforce it (Mesa), i.e. the model disappears entirely. Unit 5 is unused (shadow_map takes 4). - const int depth_tex_unit = OUTLINE_DEPTH_TEX_UNIT; - int aa_samples = 1; - if (use_msaa_outline) { - if (const AppConfig* app_config = GUI::wxGetApp().app_config; app_config != nullptr) { - const std::string value = app_config->get(SETTING_OPENGL_AA_SAMPLES); - if (value == "2" || value == "4" || value == "8" || value == "16") - aa_samples = ::atoi(value.c_str()); - } - // Never request more samples than the driver supports for depth textures (a 1-sample texture - // is used when MSAA is disabled, keeping a single code path for the sampler2DMS shader). - GLint max_samples = 1; - glsafe(::glGetIntegerv(GL_MAX_DEPTH_TEXTURE_SAMPLES, &max_samples)); - if (aa_samples > max_samples) - aa_samples = max_samples < 1 ? 1 : max_samples; - if (aa_samples < 1) - aa_samples = 1; - } - // 1st. render pass, render the model into a separate render target that has only depth buffer - GLuint depth_fbo = 0; - GLuint depth_tex = 0; - if (framebuffers_type == GUI::OpenGLManager::EFramebufferType::Arb) { - glsafe(::glGenFramebuffers(1, &depth_fbo)); - glsafe(::glBindFramebuffer(GL_FRAMEBUFFER, depth_fbo)); - - glsafe(::glActiveTexture(GL_TEXTURE0 + depth_tex_unit)); - glsafe(::glGenTextures(1, &depth_tex)); - glsafe(::glBindTexture(depth_tex_target, depth_tex)); - if (use_msaa_outline) { - // Multisample textures do not take filter/wrap parameters. - glsafe(::glTexImage2DMultisample(GL_TEXTURE_2D_MULTISAMPLE, aa_samples, GL_DEPTH_COMPONENT32F, cnv_size.get_width(), cnv_size.get_height(), GL_TRUE)); - } else { - glsafe(::glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE)); - glsafe(::glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE)); - glsafe(::glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR)); - glsafe(::glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR)); - glsafe(::glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT32F, cnv_size.get_width(), cnv_size.get_height(), 0, GL_DEPTH_COMPONENT, GL_FLOAT, nullptr)); - } - - glsafe(::glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, depth_tex_target, depth_tex, 0)); - } else { - glsafe(::glGenFramebuffersEXT(1, &depth_fbo)); - glsafe(::glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, depth_fbo)); - - glsafe(::glActiveTexture(GL_TEXTURE0 + depth_tex_unit)); - glsafe(::glGenTextures(1, &depth_tex)); - glsafe(::glBindTexture(GL_TEXTURE_2D, depth_tex)); - glsafe(::glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE)); - glsafe(::glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE)); - glsafe(::glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR)); - glsafe(::glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR)); - glsafe(::glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT32F, cnv_size.get_width(), cnv_size.get_height(), 0, GL_DEPTH_COMPONENT, GL_FLOAT, nullptr)); - - glsafe(::glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, GL_TEXTURE_2D, depth_tex, 0)); - } - // Unbind before drawing: the texture is this framebuffer's depth attachment, so leaving it bound - // to a sampled unit would be a feedback loop. - glsafe(::glBindTexture(depth_tex_target, 0)); - glsafe(::glActiveTexture(GL_TEXTURE0)); - glsafe(::glClear(GL_DEPTH_BUFFER_BIT)); - if (tverts_range == std::make_pair(0, -1)) - model.render(shader); - else - model.render(this->tverts_range, shader); - - // 2nd. render pass, just a normal render with the depth buffer passed as a texture - if (framebuffers_type == GUI::OpenGLManager::EFramebufferType::Arb) { - glsafe(::glBindFramebuffer(GL_FRAMEBUFFER, 0)); - } else if (framebuffers_type == GUI::OpenGLManager::EFramebufferType::Ext) { - glsafe(::glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0)); - } - shader->set_uniform("is_outline", true); - shader->set_uniform("screen_size", Vec2f{cnv_size.get_width(), cnv_size.get_height()}); - shader->set_uniform("msaa_samples", aa_samples); - glsafe(::glActiveTexture(GL_TEXTURE0 + depth_tex_unit)); - glsafe(::glBindTexture(depth_tex_target, depth_tex)); - glsafe(::glActiveTexture(GL_TEXTURE0)); - shader->set_uniform("depth_tex", depth_tex_unit); - simple_render(shader, model_objects, colors); - - // Some clean up to do - glsafe(::glActiveTexture(GL_TEXTURE0 + depth_tex_unit)); - glsafe(::glBindTexture(depth_tex_target, 0)); - glsafe(::glActiveTexture(GL_TEXTURE0)); - shader->set_uniform("is_outline", false); - if (framebuffers_type == GUI::OpenGLManager::EFramebufferType::Arb) { - glsafe(::glBindFramebuffer(GL_FRAMEBUFFER, 0)); - if (depth_fbo != 0) - glsafe(::glDeleteFramebuffers(1, &depth_fbo)); - } else if (framebuffers_type == GUI::OpenGLManager::EFramebufferType::Ext) { - glsafe(::glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0)); - if (depth_fbo != 0) - glsafe(::glDeleteFramebuffersEXT(1, &depth_fbo)); - } - if (depth_tex != 0) - glsafe(::glDeleteTextures(1, &depth_tex)); -} - //BBS add render for simple case void GLVolume::simple_render(GLShaderProgram* shader, ModelObjectPtrs& model_objects, std::vector& extruder_colors, bool ban_light, bool ban_color_volume) { @@ -1202,15 +1047,14 @@ float GLVolumeCollection::get_selection_support_normal_z() const return static_cast(-std::cos(std::clamp(angle_rad, 0.0, Geometry::deg2rad(89.0)))); } -//BBS: add outline drawing logic void GLVolumeCollection::render(GLVolumeCollection::ERenderType type, bool disable_cullface, const Transform3d & view_matrix, const Transform3d& projection_matrix, - const GUI::Size& cnv_size, std::function filter_func, bool partly_inside_enable, - std::vector * printable_heights) const + std::vector * printable_heights, + std::vector * outlined_volumes) const { GLVolumeWithIdAndZList to_render = volumes_to_render(volumes, type, view_matrix, filter_func); if (to_render.empty()) @@ -1238,17 +1082,10 @@ void GLVolumeCollection::render(GLVolumeCollection::ERenderType type, const float support_normal_z = get_selection_support_normal_z(); - // The outline passes below are driven by is_outline, which only the object shaders have; with an - // overlay one (wireframe, x-ray) bound they would just draw the volume again. - const bool shader_can_outline = shader->get_uniform_location("is_outline") >= 0; // ORCA: the object shaders that know how draw a part of a translucent filament as its print would // show, in premultiplied color, see translucent_filament_color() in gouraud.fs const bool shade_translucent_filaments = type == ERenderType::Transparent && shader->get_uniform_location("translucent_filament") >= 0; - // Prime depth_tex on every frame so non-outline draws do not keep the - // default sampler unit 0, which can conflict with other sampler types. - shader->set_uniform("depth_tex", OUTLINE_DEPTH_TEX_UNIT); - // Compute up direction accounting for build plate tilt. This is frame-invariant // (config cannot change mid-render), so compute it once before the volume loop. const Vec3f up_direction = GUI::build_plate_tilt_up_direction().cast(); @@ -1358,11 +1195,19 @@ void GLVolumeCollection::render(GLVolumeCollection::ERenderType type, glsafe(::glEnable(GL_POLYGON_OFFSET_FILL)); glsafe(::glPolygonOffset(1.0f, 1.0f)); } - //BBS: add outline related logic - if (volume.first->selected && shader_can_outline && GUI::wxGetApp().show_outline()) - volume.first->render_with_outline(cnv_size); - else - volume.first->render(); + const bool outlined = outlined_volumes != nullptr && volume.first->selected && volume.first->is_active && !volume.first->is_wipe_tower; + if (outlined) { + outlined_volumes->push_back(volume.first); + glsafe(::glEnable(GL_STENCIL_TEST)); + glsafe(::glStencilMask(GUI::SelectionOutline::StencilBit)); + glsafe(::glStencilFunc(GL_ALWAYS, GUI::SelectionOutline::StencilBit, GUI::SelectionOutline::StencilBit)); + glsafe(::glStencilOp(GL_KEEP, GL_KEEP, GL_REPLACE)); + } + volume.first->render(); + if (outlined) { + glsafe(::glDisable(GL_STENCIL_TEST)); + glsafe(::glStencilMask(0xFF)); + } if (volume.first->depth_bias) glsafe(::glDisable(GL_POLYGON_OFFSET_FILL)); diff --git a/src/slic3r/GUI/3DScene.hpp b/src/slic3r/GUI/3DScene.hpp index ac31946c80..47b451bb2c 100644 --- a/src/slic3r/GUI/3DScene.hpp +++ b/src/slic3r/GUI/3DScene.hpp @@ -48,9 +48,6 @@ extern Slic3r::ColorRGBA adjust_color_for_rendering(const Slic3r::C namespace Slic3r { -namespace GUI { - class Size; -} class SLAPrintObject; enum SLAPrintObjectStep : unsigned int; @@ -366,9 +363,6 @@ public: virtual void render(); - //BBS: add outline related logic and add virtual specifier - virtual void render_with_outline(const GUI::Size& cnv_size); - //BBS: add simple render function for thumbnail void simple_render(GLShaderProgram* shader, ModelObjectPtrs& model_objects, std::vector& extruder_colors, bool ban_light =false, bool ban_color_volume = false); @@ -400,7 +394,6 @@ class GLWipeTowerVolume : public GLVolume { public: GLWipeTowerVolume(const std::vector& colors); void render() override; - void render_with_outline(const GUI::Size& cnv_size) override { render(); } std::vector model_per_colors; bool IsTransparent(); @@ -512,17 +505,17 @@ public: float get_selection_support_normal_z() const; // Render the volumes by OpenGL. - //BBS: add outline drawing logic void render(ERenderType type, bool disable_cullface, const Transform3d & view_matrix, const Transform3d& projection_matrix, - const GUI::Size& cnv_size, std::function filter_func = std::function(), bool partly_inside_enable =true, // Per-extruder printable heights (extruder_printable_height); null / size<=1 // leaves the shader's extruder_printable_heights flag at 0.0 (single-extruder = inert). - std::vector * printable_heights = nullptr + std::vector * printable_heights = nullptr, + // Collects the selected volumes drawn, marked in the stencil for SelectionOutline. + std::vector * outlined_volumes = nullptr ) const; // Clear the geometry diff --git a/src/slic3r/GUI/DeepLinkHandlerMac.mm b/src/slic3r/GUI/DeepLinkHandlerMac.mm index fd3d8272ff..394b7d0570 100644 --- a/src/slic3r/GUI/DeepLinkHandlerMac.mm +++ b/src/slic3r/GUI/DeepLinkHandlerMac.mm @@ -17,7 +17,12 @@ if (url == nil || url.length == 0) return; BOOST_LOG_TRIVIAL(info) << "Deep link received: " << [url UTF8String]; - Slic3r::GUI::wxGetApp().MacOpenURL(wxString::FromUTF8([url UTF8String])); + const wxString wx_url = wxString::FromUTF8([url UTF8String]); + // Before OnInit, hand the URL to wxWidgets so it calls MacOpenURL once init finishes. + if (!wxTheApp->OSXInitWasCalled()) + wxTheApp->OSXStoreOpenURL(wx_url); + else + Slic3r::GUI::wxGetApp().MacOpenURL(wx_url); } @end diff --git a/src/slic3r/GUI/GCodeViewer.cpp b/src/slic3r/GUI/GCodeViewer.cpp index 07cc49df65..c492bedfbe 100644 --- a/src/slic3r/GUI/GCodeViewer.cpp +++ b/src/slic3r/GUI/GCodeViewer.cpp @@ -2214,7 +2214,7 @@ GCodeViewer::ImexMarkerPlan GCodeViewer::resolve_imex_marker_plan(const DynamicP void GCodeViewer::render_scene(int canvas_width, int canvas_height) { glsafe(::glEnable(GL_DEPTH_TEST)); - render_shells(canvas_width, canvas_height); + render_shells(); if (m_viewer.get_extrusion_roles_count() == 0) return; @@ -3434,7 +3434,7 @@ void GCodeViewer::render_toolpaths() #endif // ENABLE_NEW_GCODE_VIEWER_DEBUG } -void GCodeViewer::render_shells(int canvas_width, int canvas_height) +void GCodeViewer::render_shells() { //BBS: add shell previewing logic if ((!m_shells.previewing && !m_shells.visible) || m_shells.volumes.empty()) @@ -3452,7 +3452,7 @@ void GCodeViewer::render_shells(int canvas_width, int canvas_height) const Camera& camera = wxGetApp().plater()->get_camera(); shader->set_uniform("z_far", camera.get_far_z()); shader->set_uniform("z_near", camera.get_near_z()); - m_shells.volumes.render(GLVolumeCollection::ERenderType::Transparent, false, camera.get_view_matrix(), camera.get_projection_matrix(), {canvas_width, canvas_height}); + m_shells.volumes.render(GLVolumeCollection::ERenderType::Transparent, false, camera.get_view_matrix(), camera.get_projection_matrix()); shader->set_uniform("emission_factor", 0.0f); shader->stop_using(); diff --git a/src/slic3r/GUI/GCodeViewer.hpp b/src/slic3r/GUI/GCodeViewer.hpp index e4e16aa492..10fad783ea 100644 --- a/src/slic3r/GUI/GCodeViewer.hpp +++ b/src/slic3r/GUI/GCodeViewer.hpp @@ -536,7 +536,7 @@ private: void render_toolpaths(); // The sequential markers and the IDEX/IQEX toolhead boxes. void render_markers(int canvas_width, int canvas_height); - void render_shells(int canvas_width, int canvas_height); + void render_shells(); // ORCA: a filament color as the toolpaths show it, opaque unless translucent filaments are shown ColorRGBA shown_filament_color(ColorRGBA color) const; diff --git a/src/slic3r/GUI/GLCanvas3D.cpp b/src/slic3r/GUI/GLCanvas3D.cpp index ad3adb765f..d85a523a6b 100644 --- a/src/slic3r/GUI/GLCanvas3D.cpp +++ b/src/slic3r/GUI/GLCanvas3D.cpp @@ -1697,6 +1697,7 @@ GLCanvas3D::~GLCanvas3D() { if (_set_current()) { m_scene_cache.reset(); + m_selection_outline.reset(); m_frame_profiler.reset(); if (m_fxaa_texture_id != 0) { glsafe(::glDeleteTextures(1, &m_fxaa_texture_id)); @@ -2911,7 +2912,8 @@ void GLCanvas3D::_render_scene(const Camera& camera, const Size& cnv_size) { // Recorded by PartPlate::render_icons() below, when it runs. wxGetApp().plater()->get_partplate_list().clear_hover_tooltip(); - glsafe(::glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)); + glsafe(::glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT)); + m_outlined_volumes.clear(); // Invalidate the shadow map each frame; the View3D and Preview paths below rebuild it. This // keeps the Assemble canvas from sampling a stale map with an outdated light matrix. m_shadow_map_valid = false; @@ -2977,6 +2979,8 @@ void GLCanvas3D::_render_scene(const Camera& camera, const Size& cnv_size) _render_objects(GLVolumeCollection::ERenderType::Transparent, !m_gizmos.is_running()); _render_wireframe_overlay(); m_frame_profiler.mark("transparent"); + _render_selection_outline(); + m_frame_profiler.mark("outline"); } /* preview render */ else if (m_canvas_type == ECanvasType::CanvasPreview && m_render_preview) { @@ -2990,6 +2994,7 @@ void GLCanvas3D::_render_scene(const Camera& camera, const Size& cnv_size) m_frame_profiler.mark("bed"); _render_platelist(camera.get_view_matrix(), camera.get_projection_matrix(), !camera.is_looking_downward(), only_current, true, hover_id); m_frame_profiler.mark("plates"); + _render_selection_outline(); // Realistic view: the print casts a shadow onto the plate here as it does in View3D. _render_shadows(camera.get_view_matrix(), camera.get_projection_matrix()); m_frame_profiler.mark("shadows"); @@ -3013,6 +3018,8 @@ void GLCanvas3D::_render_scene(const Camera& camera, const Size& cnv_size) _render_objects(GLVolumeCollection::ERenderType::Transparent, !m_gizmos.is_running()); _render_wireframe_overlay(); m_frame_profiler.mark("objects"); + _render_selection_outline(); + m_frame_profiler.mark("outline"); } _render_sequential_clearance(); @@ -8930,7 +8937,18 @@ void GLCanvas3D::_render_ssao_pass(unsigned int width, unsigned int height) glsafe(::glBindTexture(GL_TEXTURE_2D, m_ssao_color_texture_id)); glsafe(::glActiveTexture(GL_TEXTURE1)); glsafe(::glBindTexture(GL_TEXTURE_2D, m_ssao_depth_texture_id)); + // The selection outline sits on top of the surfaces, so it is not shaded by their occlusion. + const bool keep_outline = m_selection_outline.uses_stencil(); + if (keep_outline) { + glsafe(::glEnable(GL_STENCIL_TEST)); + glsafe(::glStencilMask(0x00)); + glsafe(::glStencilFunc(GL_NOTEQUAL, SelectionOutline::DrawnBit, SelectionOutline::DrawnBit)); + } m_background.render(); + if (keep_outline) { + glsafe(::glDisable(GL_STENCIL_TEST)); + glsafe(::glStencilMask(0xFF)); + } glsafe(::glBindTexture(GL_TEXTURE_2D, 0)); glsafe(::glActiveTexture(GL_TEXTURE0)); glsafe(::glBindTexture(GL_TEXTURE_2D, 0)); @@ -9116,7 +9134,6 @@ void GLCanvas3D::_render_below_plate_volumes() shader->set_uniform("z_range", std::array{ -FLT_MAX, float(SINKING_Z_THRESHOLD) }); shader->set_uniform("clipping_plane", m_volumes.get_clipping_plane()); shader->set_uniform("use_color_clip_plane", false); - shader->set_uniform("is_outline", false); shader->set_uniform("slope.actived", false); shader->set_uniform("print_volume.type", -1); shader->set_uniform("extruder_printable_heights", std::array{ 0.0f, 0.0f, 0.0f }); @@ -9821,12 +9838,7 @@ void GLCanvas3D::_render_objects(GLVolumeCollection::ERenderType type, bool with if (static_light.has_value()) shader->set_uniform("static_light_dir", *static_light); - const Size& cvn_size = get_canvas_size(); - { - const Camera& camera = wxGetApp().plater()->get_camera(); - shader->set_uniform("z_far", camera.get_far_z()); - shader->set_uniform("z_near", camera.get_near_z()); - } + std::vector* outlined_volumes = wxGetApp().show_outline() ? &m_outlined_volumes : nullptr; switch (type) { default: @@ -9838,10 +9850,10 @@ void GLCanvas3D::_render_objects(GLVolumeCollection::ERenderType type, bool with if (m_picking_enabled && m_layers_editing.is_enabled() && (m_layers_editing.last_object_id != -1) && (m_layers_editing.object_max_z() > 0.0f)) { int object_id = m_layers_editing.last_object_id; const Camera& camera = wxGetApp().plater()->get_camera(); - m_volumes.render(type, false, camera.get_view_matrix(), camera.get_projection_matrix(), cvn_size, [object_id](const GLVolume& volume) { + m_volumes.render(type, false, camera.get_view_matrix(), camera.get_projection_matrix(), [object_id](const GLVolume& volume) { // Which volume to paint without the layer height profile shader? return volume.is_active && (volume.is_modifier || volume.composite_id.object_id != object_id); - }); + }, true, nullptr, outlined_volumes); m_layers_editing.render_volumes(*this, m_volumes); } else { @@ -9854,7 +9866,7 @@ void GLCanvas3D::_render_objects(GLVolumeCollection::ERenderType type, bool with //BBS:add assemble view related logic // do not cull backfaces to show broken geometry, if any const Camera& camera = wxGetApp().plater()->get_camera(); - m_volumes.render(type, m_picking_enabled, camera.get_view_matrix(), camera.get_projection_matrix(), cvn_size, [this, canvas_type](const GLVolume& volume) { + m_volumes.render(type, m_picking_enabled, camera.get_view_matrix(), camera.get_projection_matrix(), [this, canvas_type](const GLVolume& volume) { if (canvas_type == ECanvasType::CanvasAssembleView) { return !volume.is_modifier && !volume.is_wipe_tower; } @@ -9862,7 +9874,7 @@ void GLCanvas3D::_render_objects(GLVolumeCollection::ERenderType type, bool with return (m_render_sla_auxiliaries || volume.composite_id.volume_id >= 0); } }, - partly_inside_enable, printable_heights); + partly_inside_enable, printable_heights, outlined_volumes); } } else { @@ -9890,7 +9902,7 @@ void GLCanvas3D::_render_objects(GLVolumeCollection::ERenderType type, bool with }*/ const Camera& camera = wxGetApp().plater()->get_camera(); //BBS:add assemble view related logic - m_volumes.render(type, false, camera.get_view_matrix(), camera.get_projection_matrix(), cvn_size, [canvas_type](const GLVolume& volume) { + m_volumes.render(type, false, camera.get_view_matrix(), camera.get_projection_matrix(), [canvas_type](const GLVolume& volume) { if (canvas_type == ECanvasType::CanvasAssembleView) { return !volume.is_modifier; } @@ -9898,7 +9910,7 @@ void GLCanvas3D::_render_objects(GLVolumeCollection::ERenderType type, bool with return true; } }, - partly_inside_enable, printable_heights); + partly_inside_enable, printable_heights, outlined_volumes); // IMEX ghosts are transparent and share the same shader/camera state; // render them right after the main transparent pass while the shader is still bound. _render_imex_ghosts(); @@ -9923,6 +9935,14 @@ void GLCanvas3D::_render_objects(GLVolumeCollection::ERenderType type, bool with m_camera_clipping_plane = ClippingPlane::ClipsNothing(); } +void GLCanvas3D::_render_selection_outline() +{ + // With the clipping the object passes left in m_volumes. + m_selection_outline.render(m_outlined_volumes, wxGetApp().plater()->get_camera(), m_volumes.get_z_range(), + m_volumes.get_clipping_plane(), get_scale(), m_background); + m_outlined_volumes.clear(); +} + void GLCanvas3D::_render_section_view_caps() { // A gizmo with its own clipper draws its own cut faces. @@ -9996,7 +10016,7 @@ void GLCanvas3D::_render_xray_volumes() shader->start_using(); m_volumes.render(GLVolumeCollection::ERenderType::All, true, camera.get_view_matrix(), camera.get_projection_matrix(), - get_canvas_size(), [this, canvas_type](const GLVolume& volume) { + [this, canvas_type](const GLVolume& volume) { if (canvas_type == ECanvasType::CanvasAssembleView) return !volume.is_modifier && !volume.is_wipe_tower; return m_render_sla_auxiliaries || volume.composite_id.volume_id >= 0; @@ -10055,7 +10075,6 @@ void GLCanvas3D::_render_wireframe_overlay() const Camera& camera = wxGetApp().plater()->get_camera(); const Transform3d& view_matrix = camera.get_view_matrix(); const Transform3d& proj_matrix = camera.get_projection_matrix(); - const Size sz = get_canvas_size(); shader->start_using(); shader->set_uniform("offset", OpenGLManager::get_gl_info().is_mesa() ? 0.0005 : 0.00001); @@ -10069,7 +10088,7 @@ void GLCanvas3D::_render_wireframe_overlay() glsafe(::glPolygonMode(GL_FRONT_AND_BACK, GL_LINE)); #endif - m_volumes.render(GLVolumeCollection::ERenderType::All, false, view_matrix, proj_matrix, sz, [](const GLVolume& volume) { + m_volumes.render(GLVolumeCollection::ERenderType::All, false, view_matrix, proj_matrix, [](const GLVolume& volume) { return !volume.render_color.is_transparent() || (volume.visible && !volume.is_modifier && volume.color.is_transparent()); }); diff --git a/src/slic3r/GUI/GLCanvas3D.hpp b/src/slic3r/GUI/GLCanvas3D.hpp index cc53e5a227..01a2a6dca7 100644 --- a/src/slic3r/GUI/GLCanvas3D.hpp +++ b/src/slic3r/GUI/GLCanvas3D.hpp @@ -39,6 +39,7 @@ #include "Camera.hpp" #include "SceneRaycaster.hpp" #include "SceneCache.hpp" +#include "SelectionOutline.hpp" #include "FrameProfiler.hpp" #include "IMToolbar.hpp" #include "slic3r/GUI/3DBed.hpp" @@ -939,6 +940,9 @@ public: std::array m_ssao_texture_size{ { 0, 0 } }; // The last scene pass, for frames that only rebuild the overlay. SceneCache m_scene_cache; + SelectionOutline m_selection_outline; + // Selected volumes the object passes of this frame drew, outlined after them. + std::vector m_outlined_volumes; // Signature of the overlay on screen; empty after render(), a paint request or a frame drawn but // not shown, so the next frame is presented regardless. std::optional m_presented_signature; @@ -1586,6 +1590,7 @@ private: // IMEX ghost hover tooltip: filament swatch + label drawn as an ImGui overlay. void _render_imex_ghost_tooltip(); void _render_section_view_caps(); + void _render_selection_outline(); void _render_wireframe_overlay(); bool _is_below_plate_view_active() const; void _render_below_plate_volumes(); diff --git a/src/slic3r/GUI/GLShadersManager.cpp b/src/slic3r/GUI/GLShadersManager.cpp index 003f994a21..0ea7faa4f5 100644 --- a/src/slic3r/GUI/GLShadersManager.cpp +++ b/src/slic3r/GUI/GLShadersManager.cpp @@ -98,6 +98,12 @@ std::pair GLShadersManager::init() ); // used to render objects as translucent, edge weighted surfaces in the X-Ray view valid &= append_shader("xray", { prefix + "xray.vs", prefix + "xray.fs" }); +#if !SLIC3R_OPENGL_ES + // used to outline the selected volumes, see SelectionOutline + valid &= append_shader("outline_mask", { prefix + "outline_mask.vs", prefix + "outline_mask.fs" }); + valid &= append_shader("outline_edges", { prefix + "background.vs", prefix + "outline_edges.fs" }); + valid &= append_shader("outline", { prefix + "background.vs", prefix + "outline.fs" }); +#endif // !SLIC3R_OPENGL_ES // used to render variable layers heights in 3d editor valid &= append_shader("variable_layer_height", { prefix + "variable_layer_height.vs", prefix + "variable_layer_height.fs" }); // used to render highlight contour around selected triangles inside the multi-material gizmo diff --git a/src/slic3r/GUI/GUI_App.cpp b/src/slic3r/GUI/GUI_App.cpp index 2bd15f18e4..ea385efe17 100644 --- a/src/slic3r/GUI/GUI_App.cpp +++ b/src/slic3r/GUI/GUI_App.cpp @@ -4542,8 +4542,10 @@ void GUI_App::select_machine(const std::string& agent_id) } } - // If machine doesn't exist, create it first - if (!existing) { + // If machine doesn't exist, create it first. The Orca agent never connects, so an entry saved + // under it holds no binding; re-insert it for the active agent, whose machine list can't see + // it otherwise. Entries bound by any other agent stay with that agent. + if (!existing || (existing->printer_agent_id == ORCA_PRINTER_AGENT_ID && agent_id != ORCA_PRINTER_AGENT_ID)) { BBLocalMachine machine; machine.dev_id = dev_id; // We use dev_id as dev_ip to store the address (host:port) @@ -4558,7 +4560,7 @@ void GUI_App::select_machine(const std::string& agent_id) BOOST_LOG_TRIVIAL(error) << __FUNCTION__ << ": failed to create machine dev_id=" << dev_id; return; } - BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << ": created new machine dev_id=" << dev_id; + BOOST_LOG_TRIVIAL(info) << __FUNCTION__ << ": created or adopted machine dev_id=" << dev_id; } else if (agent_id == MOONRAKER_PRINTER_AGENT_ID && existing->printer_agent_id == agent_id && (!existing->has_access_right() || existing->get_access_code() != access_code)) { existing->set_access_code(access_code); @@ -9721,6 +9723,11 @@ void GUI_App::MacOpenURL(const wxString& url) { if (url.empty()) return; + // A cold launch delivers the URL before post_init, so open it there like a command-line URL. + if (!m_post_initialized) { + init_params->input_files = { into_u8(url) }; + return; + } start_download(into_u8(url)); } diff --git a/src/slic3r/GUI/GUI_Init.cpp b/src/slic3r/GUI/GUI_Init.cpp index 62e62321ab..ab3401b4bd 100644 --- a/src/slic3r/GUI/GUI_Init.cpp +++ b/src/slic3r/GUI/GUI_Init.cpp @@ -5,6 +5,9 @@ #include "slic3r/GUI/GUI_App.hpp" #include "slic3r/GUI/InstanceCheck.hpp" #include "slic3r/GUI/Mcp/McpService.hpp" +#ifdef __APPLE__ +#include "slic3r/GUI/DeepLinkHandlerMac.h" +#endif #include "slic3r/GUI/format.hpp" #include "slic3r/GUI/MainFrame.hpp" #include "slic3r/GUI/I18N.hpp" @@ -61,6 +64,9 @@ int GUI_Run(GUI_InitParams ¶ms) // gui->autosave = m_config.opt_string("autosave"); GUI::GUI_App::SetInstance(gui); gui->init_params = ¶ms; +#ifdef __APPLE__ + register_mac_deep_link_handler(); +#endif int result = 0; if (params.argc > 1) { diff --git a/src/slic3r/GUI/OpenGLManager.cpp b/src/slic3r/GUI/OpenGLManager.cpp index fccfb57a9a..cd882847e8 100644 --- a/src/slic3r/GUI/OpenGLManager.cpp +++ b/src/slic3r/GUI/OpenGLManager.cpp @@ -483,6 +483,23 @@ bool OpenGLManager::is_scene_canvas(const wxWindow* window) return window != nullptr && window->GetName() == SCENE_CANVAS_NAME; } +int OpenGLManager::stencil_bits() +{ + GLint bits = 0; + ::glGetError(); // drop anything pending, so the check below sees only this query + ::glGetIntegerv(GL_STENCIL_BITS, &bits); // compatibility profiles + if (::glGetError() != GL_NO_ERROR) { + bits = 0; + GLint fbo = 0; + ::glGetIntegerv(GL_DRAW_FRAMEBUFFER_BINDING, &fbo); + // The default framebuffer names its stencil buffer, a framebuffer object its stencil attachment. + ::glGetFramebufferAttachmentParameteriv(GL_DRAW_FRAMEBUFFER, fbo == 0 ? GL_STENCIL : GL_STENCIL_ATTACHMENT, + GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE, &bits); + ::glGetError(); + } + return std::max(0, int(bits)); +} + void OpenGLManager::detect_multisample(int* attribList) { int wxVersion = wxMAJOR_VERSION * 10000 + wxMINOR_VERSION * 100 + wxRELEASE_NUMBER; diff --git a/src/slic3r/GUI/OpenGLManager.hpp b/src/slic3r/GUI/OpenGLManager.hpp index e9de7fc197..979e7cb2ec 100644 --- a/src/slic3r/GUI/OpenGLManager.hpp +++ b/src/slic3r/GUI/OpenGLManager.hpp @@ -105,6 +105,8 @@ public: static bool is_scene_canvas(const wxWindow* window); static const GLInfo& get_gl_info() { return s_gl_info; } static bool force_power_of_two_textures() { return s_force_power_of_two_textures; } + // Of the bound draw framebuffer. + static int stencil_bits(); private: static void detect_multisample(int* attribList); diff --git a/src/slic3r/GUI/ParamsDialog.cpp b/src/slic3r/GUI/ParamsDialog.cpp index 3fa40ec931..b600af6f73 100644 --- a/src/slic3r/GUI/ParamsDialog.cpp +++ b/src/slic3r/GUI/ParamsDialog.cpp @@ -1,7 +1,6 @@ #include "ParamsDialog.hpp" #include "ParamsPanel.hpp" #include "GUI_App.hpp" -#include "MainFrame.hpp" #include "Plater.hpp" #include "Tab.hpp" @@ -95,9 +94,6 @@ ParamsDialog::ParamsDialog(wxWindow * parent) void ParamsDialog::Popup() { wxGetApp().UpdateDlgDarkUI(this); -#ifdef __WIN32__ - Reparent(wxGetApp().mainframe); -#endif Center(); if (m_panel && m_panel->get_current_tab()) { bool just_edit = false; diff --git a/src/slic3r/GUI/SelectionOutline.cpp b/src/slic3r/GUI/SelectionOutline.cpp new file mode 100644 index 0000000000..36758e9a4d --- /dev/null +++ b/src/slic3r/GUI/SelectionOutline.cpp @@ -0,0 +1,303 @@ +#include "libslic3r/libslic3r.h" +#include "SelectionOutline.hpp" + +#include "3DScene.hpp" +#include "Camera.hpp" +#include "GLModel.hpp" +#include "GLShader.hpp" +#include "GUI_App.hpp" +#include "OpenGLManager.hpp" +#include "libslic3r/BoundingBox.hpp" +#include "libslic3r/Color.hpp" +#include "libslic3r/Point.hpp" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace Slic3r { +namespace GUI { + +// Widths on the model in mm, kept between two widths in pixels at a scale of 1. +static constexpr float RING_WIDTH_MM = 0.35f; +static constexpr std::array RING_WIDTH_PX = { 2.5f, 5.0f }; +static constexpr float LINE_HALF_WIDTH_MM = 0.09f; +static constexpr std::array LINE_HALF_WIDTH_PX = { 0.6f, 1.2f }; +static constexpr float LINE_OPACITY = 0.75f; +// The farthest the outline shaders search. +static constexpr int MAX_REACH = 15; + +static const ColorRGB OUTLINE_COLOR = ColorRGB::WHITE(); + +void SelectionOutline::render(const std::vector& volumes, const Camera& camera, const std::array& z_range, + const std::array& clipping_plane, float scale, GLModel& quad) +{ + // The targets take 16 bytes a pixel, so they are kept only while something is outlined. + if (volumes.empty()) { + reset(); + return; + } + if (OpenGLManager::get_framebuffers_type() != OpenGLManager::EFramebufferType::Arb) + return; + GLShaderProgram* mask_shader = wxGetApp().get_shader("outline_mask"); + GLShaderProgram* edges_shader = wxGetApp().get_shader("outline_edges"); + GLShaderProgram* shader = wxGetApp().get_shader("outline"); + if (mask_shader == nullptr || edges_shader == nullptr || shader == nullptr) + return; + + const std::array& viewport = camera.get_viewport(); + const int width = viewport[2]; + const int height = viewport[3]; + if (width <= 0 || height <= 0 || !update_targets(width, height)) + return; + if (m_stencil_bits < 0) + m_stencil_bits = OpenGLManager::stencil_bits(); + + const Transform3d& view_matrix = camera.get_view_matrix(); + const Transform3d& projection_matrix = camera.get_projection_matrix(); + const Matrix4d& projection = projection_matrix.matrix(); + // The passes reach as far as the widest lines. + const float ring_width = RING_WIDTH_PX[1] * scale; + const float line_width = LINE_HALF_WIDTH_PX[1] * scale; + // Wide enough to place the silhouette between texels at the outer edge of the ring. + const float ring_sigma = 0.5f * (ring_width + 0.5f); + const int ring_reach = std::min(MAX_REACH, int(std::ceil(ring_width + 1.5f))); + const int line_reach = std::min(MAX_REACH - 1, int(std::ceil(line_width + 0.5f)) + 1); + // A pixel spans 2 / (P11 * height) of view space, at unit depth for a perspective camera. + const float pixel_size = float(2.0 / (projection(1, 1) * height)); + const Vec2f pixel_size_coef = camera.get_type() == Camera::EType::Ortho ? Vec2f(0.0f, pixel_size) : Vec2f(pixel_size, 0.0f); + + // Screen box of the volumes, the whole screen when one reaches behind the camera. + std::array box = { 0, 0, width, height }; + { + const Matrix4d view_projection = projection * view_matrix.matrix(); + Vec2d lo(DBL_MAX, DBL_MAX); + Vec2d hi(-DBL_MAX, -DBL_MAX); + bool behind = false; + for (const GLVolume* volume : volumes) { + const BoundingBoxf3& bb = volume->transformed_bounding_box(); + for (int i = 0; i < 8 && !behind; ++i) { + const Vec4d c = view_projection * Vec4d((i & 1) ? bb.max.x() : bb.min.x(), (i & 2) ? bb.max.y() : bb.min.y(), + (i & 4) ? bb.max.z() : bb.min.z(), 1.0); + behind = c.w() <= 0.0; + lo = lo.cwiseMin(c.head<2>() / c.w()); + hi = hi.cwiseMax(c.head<2>() / c.w()); + } + } + // Clamped before the conversion, as a corner close to the camera plane projects far off screen. + auto to_pixel = [](double ndc, int size) { return std::clamp((ndc * 0.5 + 0.5) * size, -1.0, size + 1.0); }; + if (!behind) + box = { int(std::floor(to_pixel(lo.x(), width))), int(std::floor(to_pixel(lo.y(), height))), + int(std::ceil(to_pixel(hi.x(), width))), int(std::ceil(to_pixel(hi.y(), height))) }; + } + auto scissor = [&box, width, height](int pad) { + const int x0 = std::clamp(box[0] - pad, 0, width); + const int y0 = std::clamp(box[1] - pad, 0, height); + const int x1 = std::clamp(box[2] + pad, 0, width); + const int y1 = std::clamp(box[3] + pad, 0, height); + glsafe(::glScissor(x0, y0, std::max(0, x1 - x0), std::max(0, y1 - y0))); + }; + // Each pass reads the one before it this far beyond the pixels it writes. + const int composite_pad = int(std::ceil(ring_width)) + 2; + const int edges_pad = composite_pad + std::max(ring_reach, line_reach + 1) + 1; + const int mask_pad = edges_pad + std::max(ring_reach, 2) + 1; + + GLint prev_fbo = 0; + glsafe(::glGetIntegerv(GL_FRAMEBUFFER_BINDING, &prev_fbo)); + GLfloat clear_color[4] = { 0.0f, 0.0f, 0.0f, 0.0f }; + glsafe(::glGetFloatv(GL_COLOR_CLEAR_VALUE, clear_color)); + const GLboolean blend = ::glIsEnabled(GL_BLEND); + const GLboolean cull = ::glIsEnabled(GL_CULL_FACE); + const GLboolean scissor_test = ::glIsEnabled(GL_SCISSOR_TEST); + GLint scissor_box[4] = { 0, 0, 0, 0 }; + glsafe(::glGetIntegerv(GL_SCISSOR_BOX, scissor_box)); + + // The mask: normal, part and the distances to the triangle edges of the nearest selected surface. + glsafe(::glBindFramebuffer(GL_FRAMEBUFFER, m_mask_fbo)); + glsafe(::glEnable(GL_SCISSOR_TEST)); + scissor(mask_pad); + // Before the clear, which leaves the depth alone under a closed depth mask. + glsafe(::glDepthMask(GL_TRUE)); + glsafe(::glClearColor(0.0f, 0.0f, 0.0f, 0.0f)); + glsafe(::glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)); + glsafe(::glEnable(GL_DEPTH_TEST)); + glsafe(::glDepthFunc(GL_LESS)); + glsafe(::glDisable(GL_BLEND)); + glsafe(::glDisable(GL_CULL_FACE)); + mask_shader->start_using(); + mask_shader->set_uniform("projection_matrix", projection_matrix); + mask_shader->set_uniform("z_range", z_range); + mask_shader->set_uniform("clipping_plane", clipping_plane); + for (size_t i = 0; i < volumes.size(); ++i) { + GLVolume& volume = *volumes[i]; + const Transform3d model_matrix = volume.world_matrix(); + mask_shader->set_uniform("volume_world_matrix", model_matrix); + mask_shader->set_uniform("view_model_matrix", view_matrix * model_matrix); + mask_shader->set_uniform("view_normal_matrix", Matrix3d(view_matrix.matrix().block(0, 0, 3, 3) * + model_matrix.matrix().block(0, 0, 3, 3).inverse().transpose())); + mask_shader->set_uniform("part_id", float(i % 65535 + 1)); + if (volume.tverts_range == std::make_pair(0, -1)) + volume.model.render(mask_shader); + else + volume.model.render(volume.tverts_range, mask_shader); + } + mask_shader->stop_using(); + + glsafe(::glActiveTexture(GL_TEXTURE0)); + glsafe(::glBindTexture(GL_TEXTURE_2D, m_mask_texture)); + glsafe(::glActiveTexture(GL_TEXTURE1)); + glsafe(::glBindTexture(GL_TEXTURE_2D, m_depth_texture)); + + // The edges: inner ones between neighboring texels, and the nearest covered texel along each row. + glsafe(::glBindFramebuffer(GL_FRAMEBUFFER, m_edges_fbo)); + glsafe(::glDisable(GL_DEPTH_TEST)); + scissor(edges_pad); + edges_shader->start_using(); + edges_shader->set_uniform("mask_tex", 0); + edges_shader->set_uniform("depth_tex", 1); + edges_shader->set_uniform("tex_size", Vec2f(float(width), float(height))); + edges_shader->set_uniform("inv_projection_matrix", Matrix4d(projection.inverse())); + edges_shader->set_uniform("pixel_size_coef", pixel_size_coef); + edges_shader->set_uniform("ring_reach", ring_reach); + edges_shader->set_uniform("ring_sigma", ring_sigma); + quad.render(); + edges_shader->stop_using(); + + glsafe(::glActiveTexture(GL_TEXTURE2)); + glsafe(::glBindTexture(GL_TEXTURE_2D, m_edges_texture)); + + // Over the scene, depth tested so that what is in front of the selection hides its outline. + glsafe(::glBindFramebuffer(GL_FRAMEBUFFER, static_cast(prev_fbo))); + scissor(composite_pad); + glsafe(::glEnable(GL_DEPTH_TEST)); + glsafe(::glDepthFunc(GL_LEQUAL)); + glsafe(::glDepthMask(GL_FALSE)); + glsafe(::glEnable(GL_BLEND)); + glsafe(::glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)); + const bool use_stencil = uses_stencil(); + if (use_stencil) { + glsafe(::glEnable(GL_STENCIL_TEST)); + glsafe(::glStencilMask(DrawnBit)); + glsafe(::glStencilOp(GL_KEEP, GL_KEEP, GL_REPLACE)); + } + shader->start_using(); + shader->set_uniform("mask_tex", 0); + shader->set_uniform("depth_tex", 1); + shader->set_uniform("edges_tex", 2); + shader->set_uniform("tex_size", Vec2f(float(width), float(height))); + shader->set_uniform("use_stencil", use_stencil); + shader->set_uniform("ring_width", std::array{ RING_WIDTH_PX[0] * scale, ring_width, RING_WIDTH_MM }); + shader->set_uniform("ring_reach", ring_reach); + shader->set_uniform("ring_sigma", ring_sigma); + shader->set_uniform("line_width", std::array{ LINE_HALF_WIDTH_PX[0] * scale, line_width, LINE_HALF_WIDTH_MM }); + shader->set_uniform("line_reach", line_reach); + shader->set_uniform("line_opacity", LINE_OPACITY); + shader->set_uniform("outline_color", OUTLINE_COLOR); + shader->set_uniform("depth_coef", std::array{ float(projection(2, 2)), float(projection(2, 3)), + float(projection(3, 2)), float(projection(3, 3)) }); + shader->set_uniform("pixel_size_coef", pixel_size_coef); + // The ring off the samples of the selection, the lines on them, both marking DrawnBit where they draw. + if (use_stencil) + glsafe(::glStencilFunc(GL_NOTEQUAL, StencilBit | DrawnBit, StencilBit)); + shader->set_uniform("inner", false); + quad.render(); + if (use_stencil) + glsafe(::glStencilFunc(GL_EQUAL, StencilBit | DrawnBit, StencilBit)); + shader->set_uniform("inner", true); + quad.render(); + shader->stop_using(); + + if (use_stencil) { + glsafe(::glDisable(GL_STENCIL_TEST)); + glsafe(::glStencilMask(0xFF)); + glsafe(::glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP)); + } + glsafe(::glScissor(scissor_box[0], scissor_box[1], scissor_box[2], scissor_box[3])); + if (!scissor_test) + glsafe(::glDisable(GL_SCISSOR_TEST)); + glsafe(::glDepthFunc(GL_LESS)); + glsafe(::glDepthMask(GL_TRUE)); + if (!blend) + glsafe(::glDisable(GL_BLEND)); + if (cull) + glsafe(::glEnable(GL_CULL_FACE)); + glsafe(::glClearColor(clear_color[0], clear_color[1], clear_color[2], clear_color[3])); + for (GLenum unit : { GL_TEXTURE2, GL_TEXTURE1, GL_TEXTURE0 }) { + glsafe(::glActiveTexture(unit)); + glsafe(::glBindTexture(GL_TEXTURE_2D, 0)); + } +} + +void SelectionOutline::reset() +{ + for (unsigned int* id : { &m_mask_texture, &m_depth_texture, &m_edges_texture }) { + if (*id != 0) { + glsafe(::glDeleteTextures(1, id)); + *id = 0; + } + } + for (unsigned int* id : { &m_mask_fbo, &m_edges_fbo }) { + if (*id != 0) { + glsafe(::glDeleteFramebuffers(1, id)); + *id = 0; + } + } + m_size = { { 0, 0 } }; + m_complete = false; + m_stencil_bits = -1; +} + +bool SelectionOutline::update_targets(unsigned int width, unsigned int height) +{ + if (m_mask_fbo != 0 && m_size[0] == width && m_size[1] == height) + return m_complete; + + auto allocate = [width, height](unsigned int& id, GLint format, GLenum data_format, GLenum type) { + if (id == 0) { + glsafe(::glGenTextures(1, &id)); + glsafe(::glBindTexture(GL_TEXTURE_2D, id)); + glsafe(::glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST)); + glsafe(::glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST)); + glsafe(::glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE)); + glsafe(::glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE)); + } + else + glsafe(::glBindTexture(GL_TEXTURE_2D, id)); + glsafe(::glTexImage2D(GL_TEXTURE_2D, 0, format, width, height, 0, data_format, type, nullptr)); + }; + allocate(m_mask_texture, GL_RGBA16, GL_RGBA, GL_UNSIGNED_SHORT); + allocate(m_depth_texture, wxGetApp().is_gl_version_greater_or_equal_to(3, 0) ? GL_DEPTH_COMPONENT32F : GL_DEPTH_COMPONENT24, + GL_DEPTH_COMPONENT, GL_FLOAT); + allocate(m_edges_texture, GL_RGBA8, GL_RGBA, GL_UNSIGNED_BYTE); + glsafe(::glBindTexture(GL_TEXTURE_2D, 0)); + + GLint prev_fbo = 0; + glsafe(::glGetIntegerv(GL_FRAMEBUFFER_BINDING, &prev_fbo)); + if (m_mask_fbo == 0) + glsafe(::glGenFramebuffers(1, &m_mask_fbo)); + glsafe(::glBindFramebuffer(GL_FRAMEBUFFER, m_mask_fbo)); + glsafe(::glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, m_mask_texture, 0)); + glsafe(::glFramebufferTexture2D(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_TEXTURE_2D, m_depth_texture, 0)); + m_complete = ::glCheckFramebufferStatus(GL_FRAMEBUFFER) == GL_FRAMEBUFFER_COMPLETE; + if (m_edges_fbo == 0) + glsafe(::glGenFramebuffers(1, &m_edges_fbo)); + glsafe(::glBindFramebuffer(GL_FRAMEBUFFER, m_edges_fbo)); + glsafe(::glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, m_edges_texture, 0)); + m_complete = m_complete && ::glCheckFramebufferStatus(GL_FRAMEBUFFER) == GL_FRAMEBUFFER_COMPLETE; + glsafe(::glBindFramebuffer(GL_FRAMEBUFFER, static_cast(prev_fbo))); + + m_size = { { width, height } }; + if (!m_complete) + BOOST_LOG_TRIVIAL(error) << "SelectionOutline: incomplete framebuffers, the selection is drawn without its outline"; + return m_complete; +} + +} // namespace GUI +} // namespace Slic3r diff --git a/src/slic3r/GUI/SelectionOutline.hpp b/src/slic3r/GUI/SelectionOutline.hpp new file mode 100644 index 0000000000..f0aedbe677 --- /dev/null +++ b/src/slic3r/GUI/SelectionOutline.hpp @@ -0,0 +1,47 @@ +#pragma once + +#include +#include + +namespace Slic3r { + +class GLVolume; + +namespace GUI { + +struct Camera; +class GLModel; + +// The outline of the selected volumes: a ring around them and lines along their inner edges, found in a mask +// of the volumes and drawn over the scene. See docs/HLSD/selection-outline.md. +class SelectionOutline +{ +public: + // Set in the stencil where the outlined volumes are drawn. + static constexpr unsigned int StencilBit = 0x80; + // Set in the stencil where the outline is drawn, which the occlusion pass leaves as it is. + static constexpr unsigned int DrawnBit = 0x40; + + // Over the bound framebuffer, whose stencil and depth hold the scene the volumes were drawn into. + void render(const std::vector& volumes, const Camera& camera, const std::array& z_range, + const std::array& clipping_plane, float scale, GLModel& quad); + // Frees the targets. + void reset(); + // The stencil holds the bits above, so the outline marks DrawnBit. + bool uses_stencil() const { return m_stencil_bits >= 8; } + +private: + bool update_targets(unsigned int width, unsigned int height); + + unsigned int m_mask_fbo{ 0 }; + unsigned int m_mask_texture{ 0 }; + unsigned int m_depth_texture{ 0 }; + unsigned int m_edges_fbo{ 0 }; + unsigned int m_edges_texture{ 0 }; + std::array m_size{ { 0, 0 } }; + bool m_complete{ false }; + int m_stencil_bits{ -1 }; +}; + +} // namespace GUI +} // namespace Slic3r diff --git a/src/slic3r/GUI/SyncAmsInfoDialog.cpp b/src/slic3r/GUI/SyncAmsInfoDialog.cpp index a39b71c751..a007513766 100644 --- a/src/slic3r/GUI/SyncAmsInfoDialog.cpp +++ b/src/slic3r/GUI/SyncAmsInfoDialog.cpp @@ -1144,6 +1144,12 @@ void SyncAmsInfoDialog::reinit_dialog() m_ams_mapping_result.clear(); m_preview_colors_in_thumbnail.clear(); + // The dialog is reused across syncs, so the plate picked last time may no longer exist + // (plates deleted or another project loaded). update_show_status() reads its thumbnail. + PartPlateList &plate_list = wxGetApp().plater()->get_partplate_list(); + if (m_specify_plate_idx < 0 || m_specify_plate_idx >= plate_list.get_plate_count()) + m_specify_plate_idx = plate_list.get_curr_plate_index(); + show_status(PrintDialogStatus::PrintStatusInit); update_show_status(); } diff --git a/src/slic3r/GUI/UVEditorCanvas.cpp b/src/slic3r/GUI/UVEditorCanvas.cpp index 2380205415..502a1cd912 100644 --- a/src/slic3r/GUI/UVEditorCanvas.cpp +++ b/src/slic3r/GUI/UVEditorCanvas.cpp @@ -1532,17 +1532,8 @@ void UVEditorCanvas::render() // Dim the texture everywhere but inside the islands: the fills go into the stencil only, then one // full-viewport quad washes the rest towards the background. Skipped without a stencil buffer, where the // quad would cover the islands too. - if (m_stencil_bits < 0) { - GLint bits = 0; - ::glGetError(); // drop anything pending, so the check below sees only this query - ::glGetIntegerv(GL_STENCIL_BITS, &bits); // compatibility profiles - if (::glGetError() != GL_NO_ERROR) { - bits = 0; - ::glGetFramebufferAttachmentParameteriv(GL_DRAW_FRAMEBUFFER, GL_STENCIL, GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE, &bits); - ::glGetError(); - } - m_stencil_bits = std::max(0, int(bits)); - } + if (m_stencil_bits < 0) + m_stencil_bits = OpenGLManager::stencil_bits(); if (has_islands() && !m_island_fill.empty() && m_stencil_bits > 0) { if (!m_dim_quad_glmodel.is_initialized()) { GLModel::Geometry q; diff --git a/src/slic3r/GUI/Widgets/CheckBox.cpp b/src/slic3r/GUI/Widgets/CheckBox.cpp index f9461a1eaa..9de2a9f572 100644 --- a/src/slic3r/GUI/Widgets/CheckBox.cpp +++ b/src/slic3r/GUI/Widgets/CheckBox.cpp @@ -94,6 +94,13 @@ void CheckBox::update() CheckBox::State CheckBox::GetNormalState() const { return State_Normal; } +bool CheckBox::MSWCommand(WXUINT param, WXWORD id) +{ + // Owner-drawn, so a double click sends BN_DBLCLK besides the click wxAnyButton makes of it, + // and wxToggleButton toggles on both. Ignore it so a double click toggles twice, not three times. + return param == BN_DBLCLK || wxBitmapToggleButton::MSWCommand(param, id); +} + #endif diff --git a/src/slic3r/GUI/Widgets/CheckBox.hpp b/src/slic3r/GUI/Widgets/CheckBox.hpp index 8b7e5acd9a..37ecaa60a8 100644 --- a/src/slic3r/GUI/Widgets/CheckBox.hpp +++ b/src/slic3r/GUI/Widgets/CheckBox.hpp @@ -29,6 +29,7 @@ public: protected: #ifdef __WXMSW__ virtual State GetNormalState() const wxOVERRIDE; + virtual bool MSWCommand(WXUINT param, WXWORD id) wxOVERRIDE; #endif #ifdef __WXOSX__ diff --git a/src/slic3r/GUI/Widgets/RadioBox.cpp b/src/slic3r/GUI/Widgets/RadioBox.cpp index 5b4af4e7b5..47992d5db7 100644 --- a/src/slic3r/GUI/Widgets/RadioBox.cpp +++ b/src/slic3r/GUI/Widgets/RadioBox.cpp @@ -56,6 +56,14 @@ void RadioBox::Rescale() #endif } +#ifdef __WXMSW__ +bool RadioBox::MSWCommand(WXUINT param, WXWORD id) +{ + // See CheckBox::MSWCommand. + return param == BN_DBLCLK || wxBitmapToggleButton::MSWCommand(param, id); +} +#endif + void RadioBox::update() { if (IsEnabled()) { diff --git a/src/slic3r/GUI/Widgets/RadioBox.hpp b/src/slic3r/GUI/Widgets/RadioBox.hpp index ffbb4abda8..87fce53487 100644 --- a/src/slic3r/GUI/Widgets/RadioBox.hpp +++ b/src/slic3r/GUI/Widgets/RadioBox.hpp @@ -22,6 +22,10 @@ public: return wxBitmapToggleButton::Disable(); } +#ifdef __WXMSW__ + bool MSWCommand(WXUINT param, WXWORD id) override; +#endif + private: void update(); diff --git a/src/slic3r/GUI/Widgets/SwitchButton.cpp b/src/slic3r/GUI/Widgets/SwitchButton.cpp index 84c2df6e34..9621730750 100644 --- a/src/slic3r/GUI/Widgets/SwitchButton.cpp +++ b/src/slic3r/GUI/Widgets/SwitchButton.cpp @@ -112,6 +112,14 @@ bool SwitchButton::SetBackgroundColour(const wxColour& colour) return false; } +#ifdef __WXMSW__ +bool SwitchButton::MSWCommand(WXUINT param, WXWORD id) +{ + // See CheckBox::MSWCommand. + return param == BN_DBLCLK || wxBitmapToggleButton::MSWCommand(param, id); +} +#endif + void SwitchButton::Rescale() { if (labels[0].IsEmpty()) { @@ -375,13 +383,13 @@ void ModeSwitchButton::doRender(wxDC& dc) } } else { // Developer mode - double scale = 1.00; -#ifdef __WXOSX__ - scale = Slic3r::GUI::mac_max_scaling_factor(); - dc.SetFont(dc.GetFont().Scaled(scale)); -#elif defined(__WXMSW__) - scale = m_parent->GetDPIScaleFactor(); - dc.SetFont(dc.GetFont().Scaled(scale)); + // Only the MSW DC draws in physical pixels, so the font and its baseline offset follow the + // DPI scale there. macOS and GTK draw in logical units: scaling the font again by the Retina + // backing factor made "DEV" overflow the switch. + double y_offset = 0.0; +#if defined(__WXMSW__) + y_offset = m_parent->GetDPIScaleFactor(); + dc.SetFont(dc.GetFont().Scaled(y_offset)); #endif wxString str = "DEV"; int kerning = 3; // pixels between chars @@ -397,11 +405,6 @@ void ModeSwitchButton::doRender(wxDC& dc) wxFontMetrics fm = dc.GetFontMetrics(); int lineHeight = fm.ascent + fm.descent + fm.internalLeading; - double y_offset = scale; -#if defined(__WXGTK__) - y_offset = 0; -#endif - wxCoord y = std::floor(v_center - lineHeight * 0.50 - y_offset); for (char c : str) { diff --git a/src/slic3r/GUI/Widgets/SwitchButton.hpp b/src/slic3r/GUI/Widgets/SwitchButton.hpp index e2664a6a00..7444420c8c 100644 --- a/src/slic3r/GUI/Widgets/SwitchButton.hpp +++ b/src/slic3r/GUI/Widgets/SwitchButton.hpp @@ -44,6 +44,10 @@ public: bool SetBackgroundColour(const wxColour& colour) override; +#ifdef __WXMSW__ + bool MSWCommand(WXUINT param, WXWORD id) override; +#endif + private: void update(); diff --git a/src/slic3r/GUI/calib_dlg.cpp b/src/slic3r/GUI/calib_dlg.cpp index eeb4c2a7bc..370f523426 100644 --- a/src/slic3r/GUI/calib_dlg.cpp +++ b/src/slic3r/GUI/calib_dlg.cpp @@ -1107,7 +1107,7 @@ Input_Shaping_Freq_Test_Dlg::Input_Shaping_Freq_Test_Dlg(wxWindow* parent, wxWin firmware_note = _L("Klipper version => 0.9.0"); break; case GCodeFlavor::gcfRepRapFirmware: - firmware_note = _L("RepRap firmware version => 3.4.0\nCheck your firmware documentation for supported shaper types."); + firmware_note = _L("RepRapFirmware version => 3.4.0\nCheck your firmware documentation for supported shaper types."); break; default: break; @@ -1169,8 +1169,8 @@ Input_Shaping_Freq_Test_Dlg::Input_Shaping_Freq_Test_Dlg(wxWindow* parent, wxWin m_tiFreqEndY->Hide(); settings_sizer->Hide(y_freq_sizer); start_x_text->SetLabel(_L("Frequency (Start / End): ")); - m_tiFreqStartX->GetTextCtrl()->SetToolTip(_L("RepRap firmware uses the same frequency range for both axes.")); - m_tiFreqEndX->GetTextCtrl()->SetToolTip(_L("RepRap firmware uses the same frequency range for both axes.")); + m_tiFreqStartX->GetTextCtrl()->SetToolTip(_L("RepRapFirmware uses the same frequency range for both axes.")); + m_tiFreqEndX->GetTextCtrl()->SetToolTip(_L("RepRapFirmware uses the same frequency range for both axes.")); } // Damping Factor @@ -1330,7 +1330,7 @@ Input_Shaping_Damp_Test_Dlg::Input_Shaping_Damp_Test_Dlg(wxWindow* parent, wxWin firmware_note = _L("Klipper version => 0.9.0"); break; case GCodeFlavor::gcfRepRapFirmware: - firmware_note = _L("RepRap firmware version => 3.4.0\nCheck your firmware documentation for supported shaper types."); + firmware_note = _L("RepRapFirmware version => 3.4.0\nCheck your firmware documentation for supported shaper types."); break; default: break; @@ -1373,7 +1373,7 @@ Input_Shaping_Damp_Test_Dlg::Input_Shaping_Damp_Test_Dlg(wxWindow* parent, wxWin m_tiFreqY->GetTextCtrl()->SetValue(m_tiFreqX->GetTextCtrl()->GetValue()); m_tiFreqY->Hide(); freq_text->SetLabel(freq_str); - m_tiFreqX->GetTextCtrl()->SetToolTip(_L("RepRap firmware uses the same frequency for both axes.")); + m_tiFreqX->GetTextCtrl()->SetToolTip(_L("RepRapFirmware uses the same frequency for both axes.")); } // Damping Factor Start and End diff --git a/tests/fff_print/test_print.cpp b/tests/fff_print/test_print.cpp index 249385741f..833ac23f4f 100644 --- a/tests/fff_print/test_print.cpp +++ b/tests/fff_print/test_print.cpp @@ -1261,6 +1261,311 @@ TEST_CASE("Sequential printing still rejects two objects over the rod height tha CHECK_THAT(print.validate().string, Catch::Matchers::ContainsSubstring("too tall")); } +TEST_CASE("Sequential printing keeps copies of one object in their list order", "[Print]") +{ + // Every copy of an object shares its object index, so ordering by that alone leaves the copies to + // the sort, which shuffles them once there are enough. Nothing here comes near the rod: 200 copies + // of a part lower than the nozzle, on a grid, so nothing needs reordering. + std::vector meshes; + meshes.push_back(make_cube(5, 5, 2)); + DynamicPrintConfig config = DynamicPrintConfig::full_print_config(); + config.set_deserialize_strict({ + { "print_sequence", "by object" }, + { "skirt_loops", 0 }, + { "layer_change_gcode", "G92 E0\n" } // validate() relative-E reset + }); + Print print; + Model model; + Test::init_print(std::move(meshes), print, model, config, nullptr, /*arrange=*/false, /*instances=*/200); + const ModelInstancePtrs &instances = model.objects.front()->instances; + for (size_t k = 0; k < instances.size(); ++k) + instances[k]->set_offset(Vec3d(10. + 12. * double(k % 15), 10. + 12. * double(k / 15), instances[k]->get_offset().z())); + print.apply(model, config); + + std::vector warnings; + const StringObjectException error = print.validate(&warnings); + INFO(error.string); + REQUIRE(error.string.empty()); + CHECK(find_order_warning(warnings) == nullptr); + // validate() records the print order on the print's own copy of the model. + const ModelInstancePtrs &copies = print.model().objects.front()->instances; + CHECK(std::is_sorted(copies.begin(), copies.end(), + [](const ModelInstance *l, const ModelInstance *r) { return l->arrange_order < r->arrange_order; })); +} + +TEST_CASE("Sequential printing still lets objects below the rod use the rod height when the lid is lower", "[Print]") +{ + // Some stock profiles put the lid below the rod, such as the Creality Ender-3 V3 KE (lid 34 mm, + // rod 47 mm). An object that shares a Y band with a later one is checked against the rod height + // instead of the lid, so two 40 mm boxes side by side in X still slice. + std::vector meshes; + for (size_t i = 0; i < 2; ++i) { + TriangleMesh box = make_cube(20, 20, 40); + box.translate(float(80 + 80 * i), 80.f, 0.f); + meshes.push_back(std::move(box)); + } + DynamicPrintConfig config = DynamicPrintConfig::full_print_config(); + config.set_deserialize_strict({ + { "print_sequence", "by object" }, + { "extruder_clearance_height_to_lid", 34 }, + { "extruder_clearance_height_to_rod", 47 }, + { "skirt_loops", 0 }, + { "layer_change_gcode", "G92 E0\n" } // validate() relative-E reset + }); + Print print; + Model model; + Test::init_print(std::move(meshes), print, model, config, nullptr, /*arrange=*/false); + + const std::string error = print.validate().string; + INFO(error); + CHECK(error.empty()); +} + +TEST_CASE("Sequential printing counts only the part of an object above the rod height", "[Print]") +{ + // Each object is a 2 mm slab carrying one fin on its front (-Y) or back (+Y) edge, with the rod at + // 25 mm. The slabs share a Y band, but the rod can only hit the fins. Each fin is checked against + // the other slab's footprint widened by half of extruder_clearance_radius, not against the other + // fin: facing away from each other, neither fin is within that range; facing each other, both are, + // and no print order works. With one of each, only the first slab's fin is, so the second slab has to + // print first. + enum class Fins { FacingAway, FacingEachOther, OneOfEach }; + const Fins fins = GENERATE(Fins::FacingAway, Fins::FacingEachOther, Fins::OneOfEach); + // A raised object (snap to the bed turned off) whose own height is below the rod but whose top is + // above it must get the same rule. + const bool raised = GENERATE(false, true); + // A per-object skirt that reaches the rod is a wall around the whole footprint, so the rod can hit + // all of it: the plate is refused whichever way the fins face, as it was before this rule. That is + // a draft shield (as tall as the object) or a skirt whose skirt_height reaches the rod. + enum class Skirt { None, DraftShield, Tall }; + const Skirt skirt = GENERATE(Skirt::None, Skirt::DraftShield, Skirt::Tall); + CAPTURE(int(fins), raised, int(skirt)); + + const double fin_height = raised ? 20. : 29.5; + const double raise_by = raised ? 10. : 0.; + auto slab_with_fin = [fin_height](bool fin_at_back, double x, double y) { + TriangleMesh slab = make_cube(40, 30, 2); + TriangleMesh fin = make_cube(8, 2, fin_height); + fin.translate(16.f, fin_at_back ? 28.f : 0.f, 0.f); + slab.merge(fin); + slab.translate(float(x), float(y), 0.f); + return slab; + }; + // The first slab sits further back (+Y), so its front fin faces the second slab. + std::vector meshes; + meshes.push_back(slab_with_fin(fins == Fins::FacingAway, 40, 85)); + meshes.push_back(slab_with_fin(fins == Fins::FacingEachOther, 170, 45)); + + DynamicPrintConfig config = DynamicPrintConfig::full_print_config(); + config.set_deserialize_strict({ + { "print_sequence", "by object" }, + { "extruder_clearance_height_to_rod", 25 }, + // The rod reaches half of the default 40 mm radius; the fins are 18 mm clear when facing away. + { "extruder_clearance_dist_to_rod", 20 }, + { "skirt_loops", 0 }, + { "layer_change_gcode", "G92 E0\n" } // validate() relative-E reset + }); + if (skirt == Skirt::DraftShield) + config.set_deserialize_strict({ + { "draft_shield", "enabled" }, + { "skirt_type", "perobject" }, + { "skirt_loops", 1 } + }); + else if (skirt == Skirt::Tall) + config.set_deserialize_strict({ + { "skirt_type", "perobject" }, + { "skirt_loops", 1 }, + { "skirt_height", 160 } // layers, well above the 25 mm rod at the default max layer height + }); + Print print; + Model model; + Test::init_print(std::move(meshes), print, model, config, nullptr, /*arrange=*/false); + if (raised) { + for (ModelObject *object : model.objects) { + ModelInstance *instance = object->instances.front(); + instance->set_offset(instance->get_offset() + Vec3d(0., 0., raise_by)); + } + print.apply(model, config); + REQUIRE(print.objects().front()->height() <= scale_(25.)); + REQUIRE(print.objects().front()->max_z() > scale_(25.)); + } + + const std::string error = print.validate().string; + INFO(error); + const bool refused = fins == Fins::FacingEachOther || skirt != Skirt::None; + CHECK((error.find("too tall") != std::string::npos) == refused); + if (fins == Fins::OneOfEach && !refused) { + // validate() records the print order on the print's own copy of the model. + const ModelObjectPtrs &objects = print.model().objects; + CHECK(objects[1]->instances.front()->arrange_order < objects[0]->instances.front()->arrange_order); + } +} + +// Two 2 mm slabs side by side in X, each with one fin above the rod, the fins facing away from each +// other so only the fins can meet the rod. Mesh coordinates, so the first slab sits further back (+Y). +static std::vector slabs_with_fins_facing_away(double fin_height, double low_fin_height) +{ + auto slab = [&](bool fin_at_back, double x, double y) { + TriangleMesh mesh = make_cube(40, 30, 2); + TriangleMesh fin = make_cube(8, 2, fin_height); + fin.translate(16.f, fin_at_back ? 28.f : 0.f, 0.f); + mesh.merge(fin); + if (low_fin_height > 0.) { + // A second, lower fin on the opposite edge, facing the other slab. + TriangleMesh low_fin = make_cube(8, 2, low_fin_height); + low_fin.translate(16.f, fin_at_back ? 0.f : 28.f, 0.f); + mesh.merge(low_fin); + } + mesh.translate(float(x), float(y), 0.f); + return mesh; + }; + std::vector meshes; + meshes.push_back(slab(true, 40, 85)); + meshes.push_back(slab(false, 170, 45)); + return meshes; +} + +TEST_CASE("Sequential printing checks the part above the rod against the rod's full reach", "[Print]") +{ + // Bambu Lab A1 mini values: half the toolhead radius is 36.5 mm, but the rod reaches 56.5 mm from the + // nozzle. The facing-away fins are farther apart than the first and closer than the second, so they only + // clear when the rod's reach is the smaller of the two. + const double dist_to_rod = GENERATE(0., 56.5); + CAPTURE(dist_to_rod); + + DynamicPrintConfig config = DynamicPrintConfig::full_print_config(); + config.set_deserialize_strict({ + { "print_sequence", "by object" }, + { "extruder_clearance_radius", 73 }, + { "extruder_clearance_height_to_rod", 25 }, + { "extruder_clearance_dist_to_rod", dist_to_rod }, + { "skirt_loops", 0 }, + { "layer_change_gcode", "G92 E0\n" } // validate() relative-E reset + }); + Print print; + Model model; + Test::init_print(slabs_with_fins_facing_away(29.5, 0.), print, model, config, nullptr, /*arrange=*/false); + + const std::string error = print.validate().string; + INFO(error); + CHECK((error.find("too tall") != std::string::npos) == (dist_to_rod > 36.5)); +} + +TEST_CASE("Sequential printing keeps the rod's reach within the object", "[Print]") +{ + // Snapmaker U1 values, which leave Distance to rod at its default. The boxes clear the radius in X and + // are 38 mm apart in Y, more than half the radius but less than Distance to rod. The reach past half + // the radius only widens the part above the rod up to the object's own footprint, so they still validate. + DynamicPrintConfig config = DynamicPrintConfig::full_print_config(); + config.set_deserialize_strict({ + { "print_sequence", "by object" }, + { "extruder_clearance_radius", 72.5 }, + { "extruder_clearance_height_to_rod", 27.5 }, + { "skirt_loops", 0 }, + { "layer_change_gcode", "G92 E0\n" } // validate() relative-E reset + }); + REQUIRE(config.opt_float("extruder_clearance_dist_to_rod") > 38.); + + std::vector meshes; + for (const Vec2f &position : { Vec2f(20.f, 40.f), Vec2f(130.f, 110.f) }) { + TriangleMesh box = make_cube(32, 32, 32); + box.translate(position.x(), position.y(), 0.f); + meshes.push_back(std::move(box)); + } + Print print; + Model model; + Test::init_print(std::move(meshes), print, model, config, nullptr, /*arrange=*/false); + + const std::string error = print.validate().string; + INFO(error); + CHECK(error.empty()); +} + +TEST_CASE("Sequential printing counts a raft toward what reaches the rod", "[Print]") +{ + // Each slab has a tall fin facing away from the other slab and a lower fin facing it. Without a raft + // the lower fin stays under the rod and the plate validates; a raft lifts it above the rod, and then + // the lower fins meet. + const bool raft = GENERATE(false, true); + CAPTURE(raft); + + DynamicPrintConfig config = DynamicPrintConfig::full_print_config(); + config.set_deserialize_strict({ + { "print_sequence", "by object" }, + { "extruder_clearance_height_to_rod", 25 }, + { "extruder_clearance_dist_to_rod", 20 }, + { "skirt_loops", 0 }, + { "raft_layers", raft ? 3 : 0 }, + { "layer_change_gcode", "G92 E0\n" } // validate() relative-E reset + }); + Print print; + Model model; + Test::init_print(slabs_with_fins_facing_away(29.5, 24.8), print, model, config, nullptr, /*arrange=*/false); + if (raft) + REQUIRE(print.objects().front()->slicing_parameters().object_print_z_min > 0.2); + + const std::string error = print.validate().string; + INFO(error); + CHECK((error.find("too tall") != std::string::npos) == raft); +} + +TEST_CASE("Sequential printing keeps the rod height for an object only its raft lifts above the rod", "[Print]") +{ + // With the lid below the rod, an object that shares a Y band with a later one is checked against the + // rod height instead of the lid. The fins face away from each other and stay below the rod on their + // own; only the raft lifts them above it. The too-tall check compares the top without the raft, so the + // slabs keep the footprint test and the rod height, and the plate still validates. + DynamicPrintConfig config = DynamicPrintConfig::full_print_config(); + config.set_deserialize_strict({ + { "print_sequence", "by object" }, + { "extruder_clearance_height_to_lid", 20 }, + { "extruder_clearance_height_to_rod", 25 }, + { "extruder_clearance_dist_to_rod", 20 }, + { "skirt_loops", 0 }, + { "raft_layers", 3 }, + { "layer_change_gcode", "G92 E0\n" } // validate() relative-E reset + }); + Print print; + Model model; + Test::init_print(slabs_with_fins_facing_away(24.8, 0.), print, model, config, nullptr, /*arrange=*/false); + REQUIRE(24.8 + print.objects().front()->slicing_parameters().object_print_z_min > 25.); + + const std::string error = print.validate().string; + INFO(error); + CHECK(error.empty()); +} + +TEST_CASE("Sequential printing applies an instance's rotation to the part above the rod", "[Print]") +{ + // The fins face away from each other in the meshes, but each instance is turned 180 degrees about its + // own center, so on the bed they face each other and no print order works. + DynamicPrintConfig config = DynamicPrintConfig::full_print_config(); + config.set_deserialize_strict({ + { "print_sequence", "by object" }, + { "extruder_clearance_height_to_rod", 25 }, + { "extruder_clearance_dist_to_rod", 20 }, + { "skirt_loops", 0 }, + { "layer_change_gcode", "G92 E0\n" } // validate() relative-E reset + }); + Print print; + Model model; + Test::init_print(slabs_with_fins_facing_away(29.5, 0.), print, model, config, nullptr, /*arrange=*/false); + for (ModelObject *object : model.objects) { + ModelInstance *instance = object->instances.front(); + const Vec3d center = object->instance_bounding_box(0).center(); + const Vec3d offset = instance->get_offset(); + instance->set_rotation(Vec3d(0., 0., PI)); + // A half turn about the instance origin moves the object too; shift it back so it turns in place. + instance->set_offset(Vec3d(2. * center.x() - offset.x(), 2. * center.y() - offset.y(), offset.z())); + REQUIRE((object->instance_bounding_box(0).center() - center).norm() < EPSILON); + } + print.apply(model, config); + + const std::string error = print.validate().string; + INFO(error); + CHECK(error.find("too tall") != std::string::npos); +} + // A sequential (by-object) print must publish the print-level nozzle group result just // like a by-layer print, so custom g-code can index the per-nozzle placeholder tables // (e.g. nozzle_diameter_at_nozzle_id[]) instead of failing on an empty vector. diff --git a/tests/fff_print/test_wipe.cpp b/tests/fff_print/test_wipe.cpp index 83a31e8137..f36c3ec942 100644 --- a/tests/fff_print/test_wipe.cpp +++ b/tests/fff_print/test_wipe.cpp @@ -15,6 +15,7 @@ #include #include #include +#include #include #include @@ -186,15 +187,22 @@ TEST_CASE("Wipe retraction preserves fractional speed with inward wipe disabled" CHECK_THAT(before_wipe, Catch::Matchers::WithinAbs(0.8 - expected_during, 0.00005)); } -TEST_CASE("Inward wipe respects the minimum travel for retraction and Z hop", "[Wipe][Regression]") +TEST_CASE("Inward wipe preserves retraction splits and minimum travel", "[Wipe][RetractionSplit][Regression]") { const char *wall_generator = GENERATE("classic", "arachne"); const char *relative_e = GENERATE("0", "1"); const char *reduce_crossing_wall = GENERATE("0", "1"); - const char *minimum_travel = GENERATE("5", "0"); - CAPTURE(wall_generator, relative_e, reduce_crossing_wall, minimum_travel); + const char *minimum_travel = GENERATE("5", "1", "0"); + const bool wipe_on_loops = GENERATE(false, true); + const auto split = GENERATE(table({ + {"0%", "50%"}, {"25%", "25%"}, {"100%", "0%"}, {"0%", "100%"}, {"0%", "0%"} + })); + const char *before_percent = std::get<0>(split); + const char *after_percent = std::get<1>(split); + CAPTURE(wall_generator, relative_e, reduce_crossing_wall, minimum_travel, wipe_on_loops, + before_percent, after_percent); DynamicPrintConfig config = wipe_config( - wall_generator, true, "50%", "10%", false, "3", "inner-outer-inner wall"); + wall_generator, true, "50%", "10%", wipe_on_loops, "3", "inner-outer-inner wall"); config.set_deserialize_strict({ {"gcode_flavor", "marlin2"}, {"use_relative_e_distances", relative_e}, @@ -202,8 +210,8 @@ TEST_CASE("Inward wipe respects the minimum travel for retraction and Z hop", "[ {"retraction_minimum_travel", minimum_travel}, {"retract_when_changing_layer", "0"}, {"use_firmware_retraction", "0"}, - {"retract_before_wipe", "0%"}, - {"retract_after_wipe", "0%"}, + {"retract_before_wipe", before_percent}, + {"retract_after_wipe", after_percent}, {"retraction_speed", "25.5"}, {"role_based_wipe_speed", "0"}, {"wipe_speed", "100"}, @@ -213,62 +221,96 @@ TEST_CASE("Inward wipe respects the minimum travel for retraction and Z hop", "[ }); config.set_key_value("z_hop_types", new ConfigOptionEnumsGeneric{zhtNormal}); config.set_key_value("retract_lift_enforce", new ConfigOptionEnumsGeneric{rletAllSurfaces}); - const std::string output = slice({make_cube(10., 10., 1.)}, config); - const auto &role_tag = GCodeProcessor::reserved_tag(GCodeProcessor::ETags::Role); - const auto &start_tag = GCodeProcessor::reserved_tag(GCodeProcessor::ETags::Wipe_Start); - const auto &end_tag = GCodeProcessor::reserved_tag(GCodeProcessor::ETags::Wipe_End); - ExtrusionRole role = erNone; - bool after_outer_wall = false; - bool in_wipe = false; - size_t transitions = 0; - size_t same_layer_transitions = 0; - size_t inward_wipes = 0; - double retraction = 0.; - double lift = 0.; - double outer_z = 0.; - GCodeReader parser; - parser.apply_config(config); - parser.parse_buffer(output, [&](GCodeReader &self, const GCodeReader::GCodeLine &line) { - if (line.comment().find(role_tag) == 0) - role = ExtrusionEntity::string_to_role(line.comment().substr(role_tag.size())); - if (line.comment().find(start_tag) == 0) { - in_wipe = true; - if (after_outer_wall) - ++inward_wipes; - } else if (line.comment().find(end_tag) == 0) { - in_wipe = false; - } - if (line.extruding(self) && line.dist_XY(self) > EPSILON) { - if (role == erExternalPerimeter) { - after_outer_wall = true; - retraction = lift = 0.; - outer_z = line.new_Z(self); - } else if (after_outer_wall) { - REQUIRE(role == erPerimeter); - ++transitions; - const double layer_rise = std::max(0., double(self.z()) - outer_z); - if (layer_rise < EPSILON) - ++same_layer_transitions; - // A 5 mm threshold suppresses retraction across a few wall widths. - // A zero threshold still permits the ordinary retract and lift. - const bool retract = std::stod(minimum_travel) == 0.; - CHECK_THAT(retraction, Catch::Matchers::WithinAbs(retract ? 0.8 : 0., 0.00005)); - // Exclude an ordinary layer change from the accumulated upward motion. - CHECK_THAT(lift - layer_rise, Catch::Matchers::WithinAbs(retract ? 0.4 : 0., 0.001)); - after_outer_wall = false; + std::vector regular_wipes; + for (bool inward : {false, true}) { + config.set_key_value("wipe_inward", new ConfigOptionBool(inward)); + const std::string output = slice({make_cube(10., 10., 1.)}, config); + const auto &role_tag = GCodeProcessor::reserved_tag(GCodeProcessor::ETags::Role); + const auto &start_tag = GCodeProcessor::reserved_tag(GCodeProcessor::ETags::Wipe_Start); + const auto &end_tag = GCodeProcessor::reserved_tag(GCodeProcessor::ETags::Wipe_End); + ExtrusionRole role = erNone; + bool after_outer_wall = false; + bool in_wipe = false; + bool wipe_seen = false; + size_t transitions = 0; + size_t same_layer_transitions = 0; + size_t outer_wipes = 0; + double before_wipe = 0.; + double during_wipe = 0.; + double after_wipe = 0.; + double wipe_length = 0.; + double lift = 0.; + double outer_z = 0.; + GCodeReader parser; + parser.apply_config(config); + parser.parse_buffer(output, [&](GCodeReader &self, const GCodeReader::GCodeLine &line) { + if (line.comment().find(role_tag) == 0) + role = ExtrusionEntity::string_to_role(line.comment().substr(role_tag.size())); + if (line.comment().find(start_tag) == 0) { + in_wipe = true; + wipe_seen = true; + if (after_outer_wall) + ++outer_wipes; + } else if (line.comment().find(end_tag) == 0) { + in_wipe = false; } - } else if (after_outer_wall) { - if (line.retracting(self)) - retraction -= line.dist_E(self); - lift += std::max(0., double(line.dist_Z(self))); - if (in_wipe) - CHECK_THAT(line.dist_E(self), Catch::Matchers::WithinAbs(0., 0.00005)); - } - }); - // The 1 mm cube has five 0.2 mm layers: every outer wall must still wipe. - REQUIRE(transitions == 5); - REQUIRE(same_layer_transitions >= 4); - REQUIRE(inward_wipes == transitions); + if (line.extruding(self) && line.dist_XY(self) > EPSILON) { + if (role == erExternalPerimeter) { + after_outer_wall = true; + before_wipe = during_wipe = after_wipe = wipe_length = lift = 0.; + wipe_seen = false; + outer_z = line.new_Z(self); + } else if (after_outer_wall) { + REQUIRE(role == erPerimeter); + const bool retract = inward ? regular_wipes.at(transitions) : wipe_seen; + if (!inward) + regular_wipes.push_back(wipe_seen); + CHECK(wipe_seen == retract); + if (retract) + REQUIRE(wipe_length > EPSILON); + else + CHECK_THAT(wipe_length, Catch::Matchers::WithinAbs(0., EPSILON)); + ++transitions; + const double layer_rise = std::max(0., double(self.z()) - outer_z); + if (layer_rise < EPSILON) + ++same_layer_transitions; + // Inward wiping must use the same retraction decisions as + // regular wiping, including a longer first-layer transition. + // The 1 mm threshold also catches a wipe endpoint that would + // make an otherwise short travel long enough to retract. + // Otherwise the configured split is limited by the time available + // at 100 mm/s, with any excess retracted before the wipe. + const double expected_after = retract ? 0.8 * std::stod(after_percent) / 100. : 0.; + const double requested_before = retract ? 0.8 * std::stod(before_percent) / 100. : 0.; + const double expected_during = retract ? std::min(0.8 - requested_before - expected_after, + 25.5 * wipe_length / 100.) : 0.; + const double expected_before = retract ? 0.8 - expected_during - expected_after : 0.; + CHECK_THAT(before_wipe, Catch::Matchers::WithinAbs(expected_before, 0.0001)); + CHECK_THAT(during_wipe, Catch::Matchers::WithinAbs(expected_during, 0.0001)); + CHECK_THAT(after_wipe, Catch::Matchers::WithinAbs(expected_after, 0.0001)); + CHECK_THAT(lift - layer_rise, Catch::Matchers::WithinAbs(retract ? 0.4 : 0., 0.001)); + after_outer_wall = false; + } + } else if (after_outer_wall) { + if (line.retracting(self)) { + double &portion = in_wipe ? during_wipe : (wipe_seen ? after_wipe : before_wipe); + portion -= line.dist_E(self); + } + if (in_wipe) + wipe_length += line.dist_XY(self); + lift += std::max(0., double(line.dist_Z(self))); + } + }); + // The 1 mm cube has five 0.2 mm layers. Inward wiping follows the + // ordinary retraction decision at every outer-to-inner wall transition. + REQUIRE(transitions == 5); + REQUIRE(same_layer_transitions >= 4); + REQUIRE(outer_wipes == std::count(regular_wipes.begin(), regular_wipes.end(), true)); + if (std::stod(minimum_travel) == 0.) + REQUIRE(outer_wipes == transitions); + else + REQUIRE(outer_wipes < transitions); + } } TEST_CASE("Changing inward wipe settings preserves the sliced geometry", "[Wipe][Regression]") @@ -375,6 +417,7 @@ TEST_CASE("Inward wipe recognizes an external wall starting on an overhang", "[W init_print({make_cube(10., 10., 1.)}, print, model, config); print.process(); size_t mixed_loops = 0; + double external_width = 0.; const auto mark_overhangs = [&](auto &&self, ExtrusionEntity *entity) -> void { if (auto *collection = dynamic_cast(entity)) { for (ExtrusionEntity *child : collection->entities) @@ -391,6 +434,11 @@ TEST_CASE("Inward wipe recognizes an external wall starting on an overhang", "[W path.polyline.points = {source.polyline.points[i - 1], source.polyline.points[i]}; const bool overhang = path.polyline.points.front().y() > 0 || path.polyline.points.back().y() > 0; path.set_extrusion_role(overhang ? erOverhangPerimeter : erExternalPerimeter); + // A wider overhang bead at the seam must not widen the inward offset. + if (overhang) + path.width *= 2.f; + else + external_width = std::max(external_width, double(path.width)); has_overhang |= overhang; has_external |= !overhang; paths.push_back(std::move(path)); @@ -413,8 +461,11 @@ TEST_CASE("Inward wipe recognizes an external wall starting on an overhang", "[W if (trajectory.destinations.empty()) continue; const Vec2d move = trajectory.destinations.front() - trajectory.start; - if (trajectory.start.x() > 4. && trajectory.start.y() > 4. && move.x() < -0.05 && move.y() < -0.05) + if (trajectory.start.x() > 4. && trajectory.start.y() > 4. && move.x() < -0.05 && move.y() < -0.05) { has_inward_wipe = true; + // The 50% offset of the external wall reaches at most its miter at this square corner. + CHECK(move.norm() < 0.5 * external_width * std::sqrt(2.) + 0.01); + } } CHECK(has_inward_wipe == inward); } @@ -439,8 +490,10 @@ TEST_CASE("Inward wipe is retained across layers with a back seam", "[Wipe][Regr const char *wall_generator = GENERATE("classic", "arachne"); INFO("wall generator: " << wall_generator); - const DynamicPrintConfig inward_config = wipe_config( + DynamicPrintConfig inward_config = wipe_config( wall_generator, true, "50%", "0%", false, "3", "inner-outer-inner wall", false, "0%", "back"); + // Exercise the offset on every layer independently of the travel threshold. + inward_config.set_deserialize_strict({{"retraction_minimum_travel", "0"}}); const std::vector inward = wipe_trajectories(slice({make_cube(27., 27., 1.)}, inward_config)); REQUIRE_FALSE(inward.empty()); @@ -463,6 +516,41 @@ TEST_CASE("Inward wipe is retained across layers with a back seam", "[Wipe][Regr } } +TEST_CASE("Inward wipe leaves a sandwich wall corner toward the printed material", + "[Wipe][InwardCornerRegression][Regression]") +{ + const char *wall_generator = GENERATE("classic", "arachne"); + const char *layer_height = GENERATE("0.1", "0.2"); + const char *seam_gap = GENERATE("0%", "10%"); + const bool wipe_on_loops = GENERATE(false, true); + CAPTURE(wall_generator, layer_height, seam_gap, wipe_on_loops); + DynamicPrintConfig config = wipe_config( + wall_generator, true, "50%", seam_gap, wipe_on_loops, "3", "inner-outer-inner wall", false, "0%", "back"); + config.set_deserialize_strict({ + {"layer_height", layer_height}, + {"initial_layer_print_height", layer_height}, + {"initial_layer_line_width", "0.5"}, + {"outer_wall_line_width", "0.42"}, + {"inner_wall_line_width", "0.45"}, + {"elefant_foot_compensation", "0"}, + {"retraction_minimum_travel", "0"}, + }); + size_t outer_wipes = 0; + const double requested_offset = 0.42 * 0.5; + for (const WipeTrajectory &trajectory : wipe_trajectories(slice({make_cube(27., 27., 0.6)}, config))) { + // This back seam lies above x=y=13; the inner walls lie below it. + if (trajectory.start.x() <= 13. || trajectory.start.y() <= 13.) + continue; + ++outer_wipes; + REQUIRE_FALSE(trajectory.destinations.empty()); + const Vec2d first_move = trajectory.destinations.front() - trajectory.start; + CHECK(first_move.x() < -0.2 * requested_offset); + CHECK(first_move.y() < -0.2 * requested_offset); + CHECK(first_move.norm() > 0.5 * requested_offset); + } + REQUIRE(outer_wipes == size_t(std::lround(0.6 / std::stod(layer_height)))); +} + TEST_CASE("Literal inward wipe distance is clamped to the outer wall width", "[Wipe][Regression]") { const char *wall_generator = GENERATE("classic", "arachne"); @@ -482,15 +570,44 @@ TEST_CASE("Literal inward wipe distance is clamped to the outer wall width", "[W REQUIRE_THAT((oversized[i] - full_width[i]).norm(), Catch::Matchers::WithinAbs(0., 0.01)); } +TEST_CASE("Sandwich wall order limits inward wipe to half the outer wall width", "[Wipe][InwardWallOrder][Regression]") +{ + const char *wall_generator = GENERATE("classic", "arachne"); + const bool wipe_on_loops = GENERATE(false, true); + const auto [outer_width, distance, limited] = GENERATE(table({ + {"0", "25%", false}, {"0", "50%", true}, {"0", "50.1%", true}, {"0", "100%", true}, + {"0.4", "0.15", false}, {"0.4", "0.21", true}, {"0.6", "0.21", false}, {"0.6", "0.4", true} + })); + CAPTURE(wall_generator, wipe_on_loops, outer_width, distance); + DynamicPrintConfig regular = wipe_config( + wall_generator, false, "50%", "10%", wipe_on_loops, "3", "inner-outer-inner wall"); + regular.set_deserialize_strict({{"outer_wall_line_width", outer_width}, {"retraction_minimum_travel", "0"}}); + DynamicPrintConfig inward = regular; + inward.set_deserialize_strict({{"wipe_inward", "1"}}); + const auto regular_paths = wipe_destinations(slice({make_cube(10., 10., 1.)}, regular)); + const auto half_width_paths = wipe_destinations(slice({make_cube(10., 10., 1.)}, inward)); + inward.set_deserialize_strict({{"wipe_inward_distance", distance}}); + const auto requested_paths = wipe_destinations(slice({make_cube(10., 10., 1.)}, inward)); + REQUIRE_FALSE(regular_paths.empty()); + REQUIRE_FALSE(half_width_paths.empty()); + REQUIRE_FALSE(requested_paths.empty()); + // Oversized requests retain the inward wipe instead of falling back to the + // regular path. The same 0.21 mm request reaches the limit for a 0.4 mm + // wall but remains below it for a 0.6 mm wall, using actual extrusion widths. + REQUIRE(trajectories_differ(regular_paths, half_width_paths)); + CHECK(trajectories_differ(half_width_paths, requested_paths) == !limited); +} + TEST_CASE("Inward wipe is not applied without an adjacent wall", "[Wipe][Regression]") { const char *wall_generator = GENERATE("classic", "arachne"); - INFO("wall generator: " << wall_generator); + const char *wall_sequence = GENERATE("inner wall/outer wall", "outer wall/inner wall", "inner-outer-inner wall"); + INFO("wall generator: " << wall_generator << ", wall sequence: " << wall_sequence); - const std::vector regular = wipe_destinations( - slice({make_cube(10., 10., 1.)}, wipe_config(wall_generator, false, "50%", "10%", false, "1"))); - const std::vector inward = wipe_destinations( - slice({make_cube(10., 10., 1.)}, wipe_config(wall_generator, true, "50%", "10%", false, "1"))); + const std::vector regular = wipe_destinations(slice({make_cube(10., 10., 1.)}, + wipe_config(wall_generator, false, "50%", "10%", false, "1", wall_sequence))); + const std::vector inward = wipe_destinations(slice({make_cube(10., 10., 1.)}, + wipe_config(wall_generator, true, "50%", "10%", false, "1", wall_sequence))); REQUIRE_FALSE(regular.empty()); REQUIRE_FALSE(trajectories_differ(regular, inward)); @@ -515,20 +632,27 @@ TEST_CASE("Inward wipe uses an alternate extra wall when the configured wall cou REQUIRE(trajectories_differ(regular, inward)); } -TEST_CASE("Inward wipe is not applied before the adjacent wall is printed", "[Wipe][Regression]") +TEST_CASE("Outer wall first limits inward wipe to half the outer wall width", "[Wipe][Regression]") { const char *wall_generator = GENERATE("classic", "arachne"); INFO("wall generator: " << wall_generator); - const std::vector regular = wipe_destinations( - slice({make_cube(10., 10., 1.)}, wipe_config( - wall_generator, false, "50%", "10%", false, "2", "outer wall/inner wall"))); - const std::vector inward = wipe_destinations( - slice({make_cube(10., 10., 1.)}, wipe_config( - wall_generator, true, "50%", "10%", false, "2", "outer wall/inner wall"))); + // The adjacent inner wall is printed after the outer wall. It still sets the + // inward side, but only the outer bead's own inner half is available. + const auto destinations = [wall_generator](bool wipe_inward, const char *distance) { + DynamicPrintConfig config = wipe_config( + wall_generator, wipe_inward, distance, "10%", false, "2", "outer wall/inner wall"); + // Wipe after every outer wall, including the short travel to its inner wall. + config.set_deserialize_strict({{"retraction_minimum_travel", "0"}}); + return wipe_destinations(slice({make_cube(10., 10., 1.)}, config)); + }; + const std::vector regular = destinations(false, "50%"); + const std::vector half_width = destinations(true, "50%"); REQUIRE_FALSE(regular.empty()); - REQUIRE_FALSE(trajectories_differ(regular, inward)); + REQUIRE_FALSE(half_width.empty()); + REQUIRE(trajectories_differ(regular, half_width)); + CHECK_FALSE(trajectories_differ(half_width, destinations(true, "100%"))); } TEST_CASE("Wipe on loops preserves the corner move with inward wipe disabled", "[Wipe][Regression]") diff --git a/tests/fff_print/test_wipe_tower.cpp b/tests/fff_print/test_wipe_tower.cpp index 86d6f2a6dc..f5b33701d5 100644 --- a/tests/fff_print/test_wipe_tower.cpp +++ b/tests/fff_print/test_wipe_tower.cpp @@ -1,4 +1,5 @@ #include +#include #include #include "libslic3r/Config.hpp" @@ -25,6 +26,7 @@ #include "libslic3r/ClipperUtils.hpp" #include "libslic3r/GCode/GCodeProcessor.hpp" #include "libslic3r/GCodeReader.hpp" +#include "libslic3r/GCode/ToolOrdering.hpp" #include "libslic3r/GCode/WipeTower.hpp" #include "libslic3r/LocalesUtils.hpp" #include "libslic3r/PrintConfig.hpp" @@ -673,3 +675,164 @@ TEST_CASE("Without sparse layers the filament change starts at the tallest print CHECK(tower_z < printed_z - EPSILON); } } + +// Two cubes at 0.2 mm layers with precise Z height on: the 20 mm cube stays on the 0.2 mm grid, and +// precise Z height spreads the other's gap to `short_height` over its last five layers, moving them +// off the grid. Slices and exports the plate; the emitter throws if it loses step with the tower. +static std::string slice_precise_z_pair(DynamicPrintConfig config, const char *tower_type, double short_height, Print &print, + const std::vector> *overrides = nullptr) +{ + // The default position puts the 50 mm tower plus its 3 mm brim past the 200 mm test bed. + config.set_deserialize_strict({ { "precise_z_height", "1" }, { "wipe_tower_type", tower_type }, + { "wipe_tower_x", "130" }, { "wipe_tower_y", "140" } }); + Model model; + init_print({ cube(20), make_cube(20, 20, short_height) }, print, model, config, overrides); + print.apply(model, config); // see slice_with_prime_tower + REQUIRE(print.has_wipe_tower()); + std::string out; + REQUIRE_NOTHROW(out = gcode(print)); + CHECK_FALSE(out.empty()); + return out; +} + +// Z of every extruding move under the tower's feature tag. +static std::vector tower_extrusion_z(const std::string &gcode) +{ + std::vector zs; + bool in_tower = false; + GCodeReader parser; + parser.parse_buffer(gcode, [&](GCodeReader &self, const GCodeReader::GCodeLine &line) { + const std::string_view raw = line.raw(); + if (raw.rfind(";TYPE:", 0) == 0 || raw.rfind("; FEATURE: ", 0) == 0) + in_tower = raw.find("Prime tower") != std::string_view::npos; + else if (in_tower && line.extruding(self) && (line.has_x() || line.has_y())) + zs.emplace_back(self.z()); + }); + return zs; +} + +static size_t count_joined_layers(const Print &print) +{ + size_t joined = 0; + for (const LayerTools < : print.wipe_tower_data().tool_ordering.layer_tools()) + joined += lt.joins_wipe_tower_layer_below() ? 1 : 0; + return joined; +} + +TEST_CASE("A layer less than the minimum layer height above another prints its tool changes on the tower layer below", "[WipeTower]") +{ + // Both filaments print on every layer of both cubes, so every off-grid layer changes tools. At + // 10.004 mm the last five layers grow by 0.0008 mm each and sit 0.0008 to 0.004 mm above the 20 mm + // cube's; at 10.15 mm they shrink by 0.01 mm each, leaving the 20 mm cube's layers 0.01 to 0.05 mm + // above them. All of that is under the 0.07 mm minimum layer height. A purge sized for a 0.0008 mm + // layer is 100 / (0.0008 * 50) = 2500 mm deep, for a 0.05 mm one 40 mm; on a 0.19 mm layer it is + // about 10.5 mm, and a joined layer holds two. + const char *tower_type = GENERATE("type1", "type2"); + const double short_height = GENERATE(10.004, 10.15); + DynamicPrintConfig config = tower_estimate_config("rectangle"); + config.set_deserialize_strict({ { "min_layer_height", "0.07" } }); + + Print print; + const std::string out = slice_precise_z_pair(config, tower_type, short_height, print); + + CHECK(count_joined_layers(print) > 0); + std::vector tower_layer_z; + for (const LayerTools < : print.wipe_tower_data().tool_ordering.layer_tools()) + if (lt.joins_wipe_tower_layer_below()) + CHECK(lt.print_z - lt.wipe_tower_print_z < 0.07); + else if (lt.has_wipe_tower) + tower_layer_z.emplace_back(lt.print_z); + CHECK(print.wipe_tower_data().depth < 30.f); + + // A joined layer's purges go down to the tower layer they join, so the tower is only ever + // extruded at its own layers' z, never up to 0.05 mm above one (G-code Z has 3 decimals). + const std::vector zs = tower_extrusion_z(out); + REQUIRE_FALSE(zs.empty()); + size_t off_layer = 0; + for (double z : zs) + if (std::none_of(tower_layer_z.begin(), tower_layer_z.end(), [z](double t) { return std::abs(z - t) < 0.002; })) + ++off_layer; + CHECK(off_layer == 0); + + // The nozzle goes below the object layer only over the tower: descending anywhere else drags it + // through the layer just printed. + BoundingBox tower_box(print.first_layer_wipe_tower_corners()); + tower_box.offset(scaled(5.)); + size_t descents = 0, off_tower = 0; + double layer_z = 0.; + GCodeReader parser; + parser.parse_buffer(out, [&](GCodeReader &self, const GCodeReader::GCodeLine &line) { + const std::string_view raw = line.raw(); + if (raw.rfind(";Z:", 0) == 0) + layer_z = std::stod(std::string(raw.substr(3))); + else if (line.has_z() && ! line.has_x() && ! line.has_y() && line.z() < layer_z - 1e-3) { + ++descents; + if (! tower_box.contains(Point(scaled(self.x()), scaled(self.y())))) { + INFO("descent to Z " << line.z() << " at X " << self.x() << " Y " << self.y() << ", layer Z " << layer_z); + ++off_tower; + } + } + }); + CHECK(descents > 0); + CHECK(off_tower == 0); +} + +TEST_CASE("Layers sliced at the printer's minimum layer height keep their own tower layers", "[WipeTower]") +{ + // 0.08 mm layers summed in floating point sit 0.0799999 mm apart now and then, just under the + // 0.08 mm minimum. Those are whole layers, not off-grid ones: none may join the layer below. + const char *tower_type = GENERATE("type1", "type2"); + DynamicPrintConfig config = tower_estimate_config("rectangle"); + config.set_deserialize_strict({ { "layer_height", "0.08" }, { "min_layer_height", "0.08" }, { "wipe_tower_type", tower_type }, + { "wipe_tower_x", "130" }, { "wipe_tower_y", "140" } }); + + Print print; + Model model; + init_print({ cube(20) }, print, model, config); + print.apply(model, config); // see slice_with_prime_tower + REQUIRE(print.has_wipe_tower()); + REQUIRE_NOTHROW(gcode(print)); + CHECK(count_joined_layers(print) == 0); +} + +TEST_CASE("A joined layer that keeps its filament leaves finishing the tower layer to the one that changed", "[WipeTower]") +{ + // The 20 mm cube prints both filaments on every layer, the short one only `filament`. Whenever the + // 20 mm cube's layer ends on that filament, the off-grid layer joined to it changes nothing, and the + // tower layer's results are all taken by the time it would finish the layer. + const char *tower_type = GENERATE("type1", "type2"); + const int filament = GENERATE(1, 2); + // An unset feature filament reads as filament 1, so the short cube names its filament for each. + const std::vector> overrides = { + {}, + { { "extruder", filament }, { "outer_wall_filament_id", filament }, { "inner_wall_filament_id", filament }, + { "sparse_infill_filament_id", filament }, { "internal_solid_filament_id", filament }, + { "top_surface_filament_id", filament }, { "bottom_surface_filament_id", filament } } }; + const DynamicPrintConfig config = tower_estimate_config("rectangle"); + + Print print; + slice_precise_z_pair(config, tower_type, 10.004, print, &overrides); + + // At least one joined layer must change no tools, or this does not test the case. + size_t keeps_filament = 0; + unsigned int last = (unsigned int) -1; + for (const LayerTools < : print.wipe_tower_data().tool_ordering.layer_tools()) { + if (lt.joins_wipe_tower_layer_below() && lt.extruders.size() == 1 && lt.extruders.front() == last) + ++keeps_filament; + if (! lt.extruders.empty()) + last = lt.extruders.back(); + } + CHECK(keeps_filament > 0); +} + +TEST_CASE("Smooth timelapse prints each tower layer's wall once when a layer joins it", "[WipeTower]") +{ + // Smooth timelapse prints a tower on every layer even with one filament, and the Type 1 tower opens + // each of its layers with the timelapse wall. A layer joined to the one below must not print it again. + DynamicPrintConfig config = tower_estimate_config("rectangle", 1); + config.set_deserialize_strict({ { "timelapse_type", "1" } }); + + Print print; + slice_precise_z_pair(config, "type1", 10.004, print); + CHECK(count_joined_layers(print) > 0); +} diff --git a/tests/libslic3r/test_wipe_path.cpp b/tests/libslic3r/test_wipe_path.cpp index 4a513a83a8..24095945e1 100644 --- a/tests/libslic3r/test_wipe_path.cpp +++ b/tests/libslic3r/test_wipe_path.cpp @@ -716,6 +716,90 @@ TEST_CASE("Stored wipe path follows the incoming wall when a corner gap truncate CHECK(path.points[1].y() < seam_end.y()); } +TEST_CASE("Stored wipe path preserves the requested offset beside an inner wall corner", + "[WipePath][InwardCornerRegression][Regression]") +{ + const double inner_corner = GENERATE(12.448, 12.45, 12.452, 12.47); + const int mirror = GENERATE(1, -1); + const int rotation = GENERATE(0, 1, 2, 3); + CAPTURE(inner_corner, mirror, rotation); + const auto point = [mirror, rotation](double x, double y) { + x *= mirror; + for (int i = 0; i < rotation; ++i) { + const double old_x = x; + x = -y; + y = old_x; + } + return Point::new_scale(x, y); + }; + // A 0.42 mm outer wall and the already printed sandwich-order inner wall + // put the 0.84 mm support sample beside that inner wall's corner. Moving + // the corner across the sample must not reduce a 0.21 mm offset to noise. + const double corner = 13.29; + const double offset = 0.21; + const Polyline original{ + point(corner, corner), point(-corner, corner), point(-corner, -corner), + point(corner, -corner), point(corner, corner - 0.04), + }; + const Polyline inner{ + point(inner_corner, inner_corner), point(-inner_corner, inner_corner), + point(-inner_corner, -inner_corner), point(inner_corner, -inner_corner), + point(inner_corner, inner_corner), + }; + Polyline path = original; + REQUIRE(offset_wipe_path_toward_support( + path, original.first_point(), original.last_point(), original.last_point(), + mirror, scale_(offset), scale_(2.), inner.lines(), inner.lines(), original.lines(), scale_(0.42))); + REQUIRE(path.points.size() >= 2); + // The fully supported forward offset keeps its inward miter and full length. + const Point expected = point(corner - offset, corner - offset); + CHECK_THAT((path.points[1] - expected).cast().norm(), + Catch::Matchers::WithinAbs(0., 4. * SCALED_EPSILON)); + const Vec2d first_move = (path.points[1] - original.last_point()).cast(); + CHECK(first_move.dot((point(0., 0.) - original.last_point()).cast()) > 0.); + path.points.front() = original.last_point(); + CHECK_THAT(path.length(), Catch::Matchers::WithinAbs(scale_(2.), 4. * SCALED_EPSILON)); +} + +TEST_CASE("Stored wipe path checks every candidate from the nozzle after a loop pre-move", + "[WipePath][InwardCornerRegression][Regression]") +{ + const double gap = GENERATE(0., 0.04); + const int mirror = GENERATE(1, -1); + const int rotation = GENERATE(0, 1, 2, 3); + CAPTURE(gap, mirror, rotation); + const auto point = [mirror, rotation](double x, double y) { + x *= mirror; + for (int i = 0; i < rotation; ++i) { + const double old_x = x; + x = -y; + y = old_x; + } + return Point::new_scale(x, y); + }; + const Polyline original{ + point(13.29, 13.29), point(-13.29, 13.29), point(-13.29, -13.29), + point(13.29, -13.29), point(13.29, 13.29 - gap), + }; + const Polyline inner{ + point(12.448, 12.448), point(-12.448, 12.448), point(-12.448, -12.448), + point(12.448, -12.448), point(12.448, 12.448), + }; + // The nozzle is already farther inward than the requested 0.02 mm offset. + // Neither a forward nor a reverse candidate may move it back toward the wall. + const Point wipe_start = point(13.21, 13.21); + Polyline path = original; + if (offset_wipe_path_toward_support( + path, original.first_point(), original.last_point(), wipe_start, + mirror, scale_(0.02), scale_(2.), inner.lines(), inner.lines(), original.lines(), scale_(0.42))) { + REQUIRE(path.points.size() >= 2); + const Vec2d first_move = (path.points[1] - wipe_start).cast(); + CHECK(first_move.dot((point(0., 0.) - wipe_start).cast()) > 0.); + } else { + CHECK(path.points == original.points); + } +} + TEST_CASE("Stored wipe path prefers support on the material side of a seam gap", "[WipePath][Regression]") { const coord_t s = scale_(1.0);