Skip to content

ImageMap FULL PR3: texture G-code emission and bbs_3mf persist - #12

Draft
aceRage wants to merge 5 commits into
mainfrom
cursor/imagemap-full-pr3-gcode-3mf-706d
Draft

ImageMap FULL PR3: texture G-code emission and bbs_3mf persist#12
aceRage wants to merge 5 commits into
mainfrom
cursor/imagemap-full-pr3-gcode-3mf-706d

Conversation

@aceRage

@aceRage aceRage commented Sep 4, 2026

Copy link
Copy Markdown
Owner

Description

ImageMap → Ultra FULL PR3 GCode + 3MF persist. Stacks PR1 (#10) + PR2 (#11) + this PR onto main.

Source: OrcaSlicer-ImageMap @92548381056.

Starts from PR2 cursor/imagemap-full-pr2-hooks-a37f (f28ab966b0 / open PR #11).

What this PR does

  • G-code: texture overhang / Contoning emission hooks, seam-hiding (texture_mapping_seam_hiding_hint), and outer-wall LineWidth flow modulation in _extrude (GCodeTextureMapping.cpp + surgical _extrude multiply). Background color stays on the PR2 tagged filament path.
  • bbs_3mf: load/save texture_mapping_definitions, texture_mapping_global_settings, texture_mapping_background_color, texture_mapping_outer_wall_gradient_{global_strength,max_line_width,min_line_width} via project config JSON; texture_mapping_color triangle attr; virtual filament IDs 99–255 not clamped away; imported UV/RGBA/raw atlas under Metadata/imported_texture/ (ImageMapRawFilamentOffsetAtlas). Atlas sidecars are written even when print config is omitted; restore keeps atlas/RGBA if UV triangle counts do not match.
  • Model: OBJ+PNG decode via decode_image_texture_* + atlas; CutUtils Remap for simplify/cut (C7); load_gltf / .glb is an explicit unsupported stub (clear error, no crash).

What this PR does not do

  • Prime-tower image metadata / Metadata/texture_mapping prime-tower tree
  • Full GLTF / tinygltf
  • MMUPaintedTexturePreview, gizmos, Plater (PR4)
  • Any change to paint_depth_* or PaintDepth.* (hard gate)

Side-texture / Contoning G-code hooks

Documented in docs/imagemap-full-pr3.md. Cloud may not smoke-slice.

  1. PR2 tags Contoning / side-texture paths and resolves virtual zone IDs in ToolOrdering.
  2. GCode::texture_mapping_seam_hiding_hint feeds SeamPlacer::place_seam.
  3. GCode::texture_mapping_path_flow_scales multiplies extrusion dE for external perimeters when a LineWidth / offset-gradient / Contoning overhang row is active (PR1 offset context). Empty scales = identity.
  4. Ultra _extrude is not replaced (paint-depth / sloped-Z stay). ImageMap’s full per-segment centerline-shift dump is not copied.

Persist keys (C6)

Must round-trip on the same 3MF as paint_depth_*:

  • texture_mapping_definitions
  • texture_mapping_global_settings
  • texture_mapping_background_color
  • texture_mapping_outer_wall_gradient_global_strength
  • texture_mapping_outer_wall_gradient_max_line_width
  • texture_mapping_outer_wall_gradient_min_line_width

Plus atlas / virtual filament IDs / texture_mapping_color triangle attributes.

Ultra always loads full Metadata/project_settings.config, so paint-depth keys stay intact. C5 legacy mmu_segmented_region_max_width migration is untouched.

Screenshots/Recordings/Graphs

N/A (libslic3r G-code / 3MF / Model; no UI).

Tests

  • tests/libslic3r/test_texture_mapping.cpp [texturemapping][pr3]:
    • C5: handle_legacy_composite still migrates mmu_segmented_region_max_width.
    • C6: bbs_3mf round-trip of TM + paint_depth_* keys, raw atlas payload, virtual filament IDs 99–255, and texture_mapping_color.
    • C7: Remap snapshot/apply on ImageTexture (+ region-paint facets); CutUtils::perform_with_plane remaps ImageTexture UVs.
    • GLTF stub throws.
  • Do not change test_paint_depth*.cpp. Please run [paintdepth],[texturemapping] locally; cloud cannot build libslic3r_tests.

Depends on #10 and #11. See docs/imagemap-full-pr3.md.

Open in Web Open in Cursor 

cursoragent and others added 5 commits September 4, 2026 11:51
…S LUT.

Extract TextureMapping/Contoning/Offset/Remap/ImportedTexture and ColorSolver
vendors from OrcaSlicer-ImageMap @ 9254838. Track lut_wide.png.c with Git
LFS. Register six texture_mapping_* keys only; leave paint_depth_* untouched.

Co-authored-by: aceRage <aceRage@users.noreply.github.com>
Print apply loads texture_mapping_definitions, ToolOrdering resolves
virtual zone IDs, and MMS nests TM outer-wall width around the Ultra
paint-depth clamp. LayerRegion side modulation and Contoning gates live
in LayerRegionTextureMapping; Fill gets a Contoning schedule driver
rather than ImageMap's full geometry dump.

Co-authored-by: aceRage <aceRage@users.noreply.github.com>
try_make_texture_mapping_perimeters is a free function, so *this leftovers from the ImageMap member extract would not compile. Fill now keys top-surface TM off solid_infill_filament, make_fills matches ImageMap's 5-arg cancel+cache form, and Contoning tests seed filament colours.

Co-authored-by: aceRage <aceRage@users.noreply.github.com>
Emit texture/Contoning-aware extrusion volume and seam-hiding from
GCode.cpp, round-trip texture_mapping_* plus imported atlas through
bbs_3mf, and wire CutUtils Remap for simplify/cut. GLTF import is an
unsupported stub. No Plater/gizmo UI.

Co-authored-by: aceRage <aceRage@users.noreply.github.com>
Keep raw-atlas/RGBA 3MF restore even if imported UV counts do not match, write atlas sidecars without requiring print config, and add tests for virtual filament IDs, texture_mapping_color, and CutUtils remap.

Co-authored-by: aceRage <aceRage@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants