Skip to content

New Pack option added to AutoUV - #655

Open
Micheus wants to merge 2 commits into
dgud:masterfrom
Micheus:mv/uv-packing
Open

Micheus wants to merge 2 commits into
dgud:masterfrom
Micheus:mv/uv-packing

Conversation

@Micheus

@Micheus Micheus commented Oct 26, 2026

Copy link
Copy Markdown
Collaborator

A new Pack option was added to AutoUV window giving access to three packing
methods: "Legacy (Rows/Columns)", "Bounding Box" and "Polygon".

The Legacy (Rows/Columns) option is the native Wings3D's packing method that
was exposed with the addition of options to define Gap and Margin;
Two new methods was added:

  • Bounding Box: packing (MaxRects) method to Pack Charts that packs the UV
    islands of a tile by their bounding boxes using MaxRects (Best Short Side Fit).
  • Polygon: method to pack charts that packs UV islands by their outlines, so
    small islands can fill the holes of larger ones.

NOTE:
Added three packing methods to AutoUV: Legacy (Rows/Columns), Bounding Box
and Polygon.

Add a "Bounding Box" method to Pack Charts that packs the UV islands of
a tile by their bounding boxes using MaxRects (Best Short Side Fit).

* auv_pack_maxrects: packs movable charts around fixed ones. Charts
  that do not fit stay in place and are reported as unpacked, selecting
  the ones that still overlap another chart.
* auv_pack_utils: option validation, rotation candidates, convex hull
  and minimum-area oriented bounding box, chart bounds and transforms,
  shared with other packers.
* Options dialog: profile (Fast, Balanced, Quality, Max), gap and
  margin as percent of the tile side, rotation step, and normalize
  orientation (rotates each chart to its minimum-area oriented
  bounding box before packing), plus "Scale to fit" when every chart
  is movable.
* Works on the charts of the current tile; with an empty selection all
  of them are packed, otherwise unselected charts are obstacles.

Expose the internal Wings3D packing (rows/columns) as the "Legacy"
method of Pack Charts, next to the new packing methods.

* Menu: "Legacy (Rows/Columns)" with an options dialog.
* Options dialog: gap and margin as percent of the tile side, saved
  in the preferences like the other methods.
* pack_legacy/2 arranges all charts of the current tile inside the
  tile's unit square (uniform rescale) using
  auv_placement:place_areas/3. The selection is ignored.
* Adding option to Bounding Box method.
@Micheus

Micheus commented Oct 26, 2026

Copy link
Copy Markdown
Collaborator Author

Start arrangment:
image

Legacy applied:
image

Bonding Box applied:
image

Polygon applied:
image

Add a "Polygon" method to Pack Charts that packs UV islands by their
outlines, so small islands can fill the holes of larger ones.

* auv_pack_poly: bottom-left fill on a conservative occupancy grid,
  verified with an exact polygon test, followed by a short exact
  compaction. Profiles control grid size, rotation candidates and
  compaction rounds. Islands that do not fit stay in place.
* auv_poly: polygon geometry (collision with gap, containment).
* auv_pack_utils: code shared by both packers (options, rotation
  candidates, OBB, chart transforms, outline extraction, scale search).
* auv_pack_maxrects: renamed from auv_packing; uses auv_pack_utils.
* New options: Max profile, polygon order, "Scale to fit" for both
  methods (uniform scale, only when every chart is movable).
* Added option to legacy mode handle selected islands without scale them.
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.

1 participant