Skip to content

Fix cross-section cut marker positions in composite render#11

Open
dirlligafu wants to merge 1 commit into
6wheel:mainfrom
dirlligafu:fix-rib-marker-position
Open

Fix cross-section cut marker positions in composite render#11
dirlligafu wants to merge 1 commit into
6wheel:mainfrom
dirlligafu:fix-rib-marker-position

Conversation

@dirlligafu

Copy link
Copy Markdown

What this fixes

When N cross-section cuts are requested, the composite render divides the model into N+1 intervals with dashed marker lines. The outermost intervals (before cut 1 and after cut N) were measurably narrower than the interior ones, causing the markers to not coincide with the actual section positions.

Root cause

In compose_image(), fracs_for_view was applied against the padded view bbox (pad_frac=0.05 by default). The model content starts 5% inside the padded area on each side, so the markers were stretched across the full padded span instead of the model's actual extent.

Fix

Remap each fraction from content-space to padded-bbox-space before drawing, using the unpadded bbox as reference. All N+1 intervals are now equal, and each marker lands at exactly k/(N+1) of the model's actual depth.

Fixes #10.

Screenshots

All sections are now of equal size:
image

Section 1 now matches the profile image
image
image

The dashed cut lines were positioned by applying raw fractional positions
to the padded view bbox (pad_frac=0.05 by default). Since the model
content starts 5% inside the padded area on each side, markers were
stretched across the full padded span rather than the model's actual
extent -- making the outermost intervals visibly narrower than the
interior ones.

Fix: remap each fraction from content-space to padded-bbox-space before
drawing, using the unpadded bbox width as the reference. All N+1
intervals are now equal, and each marker lands at exactly k/(N+1) of
the model's actual depth. Closes 6wheel#10.
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.

Cross-section cut marker lines don't match actual section positions

2 participants