Skip to content

Fix cross-section panels being mis-projected for non-default up_axis#13

Open
dirlligafu wants to merge 1 commit into
6wheel:mainfrom
dirlligafu:fix-compositor-axis-hardcoding
Open

Fix cross-section panels being mis-projected for non-default up_axis#13
dirlligafu wants to merge 1 commit into
6wheel:mainfrom
dirlligafu:fix-compositor-axis-hardcoding

Conversation

@dirlligafu

Copy link
Copy Markdown

In short

If your model needs the "Up axis" set to Z or X instead of the default Y (some game exports need this), the cross-section cut images came out broken, looking like a flat squashed line instead of a real cut through the model. This fixes that, only for that specific combination, nothing else changes.

What this fixes in details

The cross-section cut panels (compose_image's "SECTION N" panels) render degenerate or mis-projected content for any model where the up axis isn't the default "y" (e.g. up_axis="z" or "x", set via the Orientation controls). This is a real case, not just theoretical: the Orientation controls exist specifically because some models (e.g. BeamNG exports) don't follow the default convention.

Root cause

_draw_rib() and _rib_used_bbox() in compositor.py hardcoded plotting each cut segment's world-axis index 0 as horizontal and index 1 as vertical. That's only correct by coincidence for the default up_axis="y"/forward_axis="z" setup, where the two axes left over after a forward-axis cut happen to be indices 0 and 1. For any other up_axis choice, the two remaining axes are a different pair of indices, so the panel ends up plotting the wrong two axes, or the model's near-flat forward axis instead of its actual height.

Fix

Both functions now take explicit h_idx/v_idx parameters instead of assuming 0/1, computed from the model's own AxisConfig (side axis horizontal, up axis vertical). compose_image() passes the correct pair through instead of relying on the old assumption.

Testing

Forced up_axis="z" on a real test model (normally up_axis="y") and confirmed the cross-section panel is no longer degenerate, showing a proper cross-sectional silhouette instead of a squashed line. Also regenerated the same model at the default up_axis="y" to confirm the fix doesn't change anything for the common case.

The cross-section cut panels render degenerate or mis-projected content
for any model where the up axis isn't the default "y" (e.g. up_axis="z"
or "x", set via the Orientation controls), a real case since the
Orientation controls exist specifically because some models (e.g.
BeamNG exports) don't follow the default convention.

_draw_rib() and _rib_used_bbox() in compositor.py hardcoded plotting
each cut segment's world-axis index 0 as horizontal and index 1 as
vertical. That's only correct by coincidence for the default
up_axis="y"/forward_axis="z" setup, where the two axes left over after
a forward-axis cut happen to be indices 0 and 1. For any other up_axis
choice, the two remaining axes are a different pair of indices, so the
panel ends up plotting the wrong two axes, or the model's near-flat
forward axis instead of its actual height.

Both functions now take explicit h_idx/v_idx parameters instead of
assuming 0/1, computed from the model's own AxisConfig (side axis
horizontal, up axis vertical). compose_image() passes the correct pair
through instead of relying on the old assumption.

Tested with a real model at up_axis="z" (normally up_axis="y"):
confirmed the cross-section panel is no longer degenerate, showing a
proper cross-sectional silhouette instead of a squashed line. Also
regenerated the same model at the default up_axis="y" to confirm the
fix doesn't change anything for the common case.
dirlligafu added a commit to dirlligafu/Ortho that referenced this pull request Jul 14, 2026
Records the extracted axis-hardcoding fix as PR 6wheel#13, the new
compose_image signature conflict it introduces for template-presets,
and the plan to rebase split-view-export/this branch on top of it.
dirlligafu added a commit to dirlligafu/Ortho that referenced this pull request Jul 14, 2026
Records the extracted axis-hardcoding fix as PR 6wheel#13, the new
compose_image signature conflict it introduces for template-presets,
and the plan to rebase this branch on top of it.
dirlligafu added a commit to dirlligafu/Ortho that referenced this pull request Jul 14, 2026
Records the extracted axis-hardcoding fix as PR 6wheel#13, the new
compose_image signature conflict it introduces for template-presets,
and the plan to rebase this branch on top of it.
dirlligafu added a commit to dirlligafu/Ortho that referenced this pull request Jul 14, 2026
dirlligafu added a commit to dirlligafu/Ortho that referenced this pull request Jul 14, 2026
dirlligafu added a commit to dirlligafu/Ortho that referenced this pull request Jul 14, 2026
Records the extracted axis-hardcoding fix as PR 6wheel#13, the new
compose_image signature conflict it introduces for template-presets,
and the plan to rebase split-view-export/this branch on top of it.
dirlligafu added a commit to dirlligafu/Ortho that referenced this pull request Jul 14, 2026
…ough it

export_split_views() still called _draw_rib() with its old 4-argument
signature after fix-compositor-axis-hardcoding (6wheel#13) made h_idx/v_idx
required, passing line_color where an axis index was expected. This would
crash as soon as a user requested split-view export with a cross-section
cut enabled.

Also generalized the same hardcoded axis-0/axis-1 assumption in the
function's own rib bounding-box math, which had the same latent bug 6wheel#13
fixed in compose_image(): section panels for a non-default up_axis model
would come out mis-projected.

axis_cfg is now a required parameter, matching compose_image()'s own
signature, so a caller can't silently omit it and fall back to the
wrong-by-coincidence default indices.
dirlligafu added a commit to dirlligafu/Ortho that referenced this pull request Jul 14, 2026
Records the extracted axis-hardcoding fix as PR 6wheel#13, the new
compose_image signature conflict it introduces for template-presets,
and the plan to rebase split-view-export/this branch on top of it.
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