Skip to content

[hist3d] opt out extremely small line segments, use eps for faces flipping#20143

Merged
linev merged 2 commits intoroot-project:masterfrom
linev:hist3d_epsilon
Oct 23, 2025
Merged

[hist3d] opt out extremely small line segments, use eps for faces flipping#20143
linev merged 2 commits intoroot-project:masterfrom
linev:hist3d_epsilon

Conversation

@linev
Copy link
Copy Markdown
Member

@linev linev commented Oct 20, 2025

In two places of lego/surface plots output result may differs because of float arithmetic deviations on different platforms.

  1. Exclude painting of extremely short (1e-9) line segments. Such segments may appears after clipping of normal line, but never will lead to real pixel painting.
  2. In SURF1 draw option flip order of painting of two triangles (faces) only if calculated Z value differs by epsilon (1e-12). This ensures always same order on different platforms and exclude float arithmetic errors.

Both changes allows to produce similar SVG/PS/PDF output for majority of 3d plots produced by ROOT graphics.

linev added 2 commits October 20, 2025 10:49
On some platforms FindVisibleDraw returns
different result for same data.
Either line is not visible at all or extremly small
segment from the line is visible.
In last case do not call paint for gPad

Has effect on 3D axis grid painter and lego painter for
several stressGraphics tests - but only when checking
PS/SVG/PDF content, size reduction is very small
There order of triangles drawing defined by calculated Z value.
For many triangles such Z value is very close to each other and "flip"
on different platforms because of float precision.

To exclude such flipping, add minimal epsilon in Z comparasion.
When both Z are close to each other render order of triangles is not important
@linev linev requested a review from couet October 20, 2025 08:57
@linev linev self-assigned this Oct 20, 2025
@linev linev requested a review from lmoneta as a code owner October 20, 2025 08:57
@github-actions
Copy link
Copy Markdown

github-actions bot commented Oct 20, 2025

Test Results

    21 files      21 suites   3d 14h 24m 41s ⏱️
 3 692 tests  3 691 ✅ 0 💤 1 ❌
75 641 runs  75 639 ✅ 0 💤 2 ❌

For more details on these failures, see this check.

Results for commit 7951cda.

♻️ This comment has been updated with latest results.

@linev linev closed this Oct 21, 2025
@linev linev reopened this Oct 21, 2025
@linev linev merged commit 89051d5 into root-project:master Oct 23, 2025
46 of 57 checks passed
@linev linev deleted the hist3d_epsilon branch October 23, 2025 07:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants