Skip to content

feat(mono): native interactive f(x,y) 3D surfaces in Linux WinForms - #296

Draft
PawelTroka wants to merge 10 commits into
masterfrom
feature/mono-native-fxy-3d-20261026
Draft

PawelTroka wants to merge 10 commits into
masterfrom
feature/mono-native-fxy-3d-20261026

Conversation

@PawelTroka

@PawelTroka PawelTroka commented Oct 26, 2026 •

Copy link
Copy Markdown
Owner

Scope

Native Linux/Mono WinForms interactive explicit f(x,y) surface visualization for #292. Kept independent of browser WebGL work in #294 and the Mono complex-chart defect #295. Draft: do not merge without owner approval.

Implementation

  • Replace Chart3DControlMono unsupported panel with a native IChart3D WinForms viewer. No WPF/WebGL/OpenGL or new native dependency.
  • Reuse the existing Function.Evaluate(x,y) compiled-expression/custom-function pipeline. Bounded grid sampling (17–97 samples/axis), finite filtering and arithmetic singularity holes.
  • Render depth-sorted colored triangles and point-series through System.Drawing/libgdiplus; show numerical x/y/z axes. Left-drag rotates, right-drag pans, wheel zooms; arrows, +/- and Home are keyboard alternatives.
  • Retain mode, bounds, quality, Redraw, ClearAll, export, print, properties and stand-alone chart methods. Cached numerical grids are unaffected by camera gestures or resize.
  • Limits: eight surfaces, 20k points/series, 40k points/chart, and ≤4096px / ≤8MP export. WPF source paths are excluded from Mono and the Mono renderer from Windows.
  • Document software-rendering limitations (painter's depth approximation for intersecting geometry, synchronous sampling, no implicit 3D or picking).

Regression / acceptance

  • Add focused Mono smoke tests: paraboloid sample counts, custom functions, grid quality and bounds changes, invalid bounds/export limits, singularity holes, all-nonfinite domains, point series, clear and recovery.
  • Add actual visible X11 chart capture before/after an XTEST-generated native pointer drag and require a material pixel difference. PNG export and image-variation checks are separate.
  • Teach Mono acceptance runner to clear stale old/new chart screenshots; document produced evidence.
  • Validate exact head 4769084a36af7983a152367bb619aeb10c7ffaa3 in Linux Mono-Validate / Xvfb: 44 passed, 0 failed, 0 skipped (run 40252148928). Visually inspect real on-screen images.
  • Verify modern Windows solution and desktop regression suite: Cake Windows Computator.NET.Desktop.Tests job 557/557 tests passed, including WPF surface occlusion, axis annotation, export, panning/rotation/zoom and settings dialog. Mono real/complex chart acceptance also passed. All four jobs in Cake Windows validation have now passed (Desktop.Tests, Core.Tests, Core.IntegrationTests, WebApi.IntegrationTests).
  • Capture and inspect real before/after rotation images and image export. Passing Mono artifact contains all five 3D images.
  • Obtain owner's review and explicit merge approval.

Screenshot evidence

Before: actual unsupported-3d.png retained in the successful master Mono artifact (head fe1aba49).

After: the first implementation's Mono artifact includes mono-3d-paraboloid.png, mono-3d-visible-before.png, and mono-3d-points.png. These were successfully captured and visually inspected; gesture acceptance was not yet passing. The current rerun will additionally be required to produce mono-3d-visible-rotated.png and mono-3d-export.png after successful interaction.

Known limitations / isolation

Rasterized 3D is CPU-bound with approximate painter's depth ordering (no hardware z-buffer). It is suitable for bounded interactive surfaces, not CAD-scale/intersecting geometry or continuous heavy animation. Implicit surfaces, true 3D object picking, and certified macOS GUI support remain out of scope. This does not ship the #294 web viewer or change #295's complex-chart renderer.

Do not merge without my approval.

Validation iteration (26 Oct 2026)

The first Mono workflow at run 40251746607 built successfully and 42 accepted cases passed, but the two new tests failed: Mono SendKeys.SendWait did not deliver a real focused key event, and a negative function-type fixture used y in a real-only expression. Follow-up commits replace SendKeys with XTEST-generated X11 mouse drag, install libxtst6 explicitly, and correct the real-only fixture. Rerun passed on exact head 4769084a: Mono-Build and Mono-Validate succeeded, 44 accepted / zero failures. XTEST delivered a real drag; mono-3d-visible-before.png and mono-3d-visible-rotated.png show a visibly rotated camera, with 24,315 pixels changed beyond 10/255 in their grayscale difference. PNG export, holes and point mode also passed. This establishes native Linux/X11 behavior for the validated Ubuntu/Mono combination; it does not certify other distributions or macOS.

Passing Linux/X11 evidence (exact head 4769084)

  • Mono CI run 40252148928 — Mono-Validate 44/44 passed (includes actual X11 pointer drag and native pixel comparison).
  • Retained evidence ZIP, artifact 12621356998: mono-3d-visible-before.png, mono-3d-visible-rotated.png, mono-3d-paraboloid.png, mono-3d-export.png, mono-3d-points.png, XML/logs. Inspected actual captured images; screenshots are not synthetic and are not substituted for interactive acceptance.
  • Other workflows: the Windows desktop test suite has 557 passing tests, plus the complete developer solution, portable .NET and other CI checks are green on the same commit. Windows Cake is green (all four jobs), and all 21/21 GitHub Actions workflows succeeded for exact original head 4769084a36af7983a152367bb619aeb10c7ffaa3; this was verified independently on 2026-10-27.

Cross-platform integration and PNG-pan correction — 2026-10-27

  • Exact original Mono head 4769084a36af7983a152367bb619aeb10c7ffaa3: 21/21 workflows completed successfully, including 44/44 native Linux/X11 acceptance cases and Windows desktop regression checks. Web feat(web): interactive f(x,y) 3D surface charts with numerical sampling and WebGL #294 exact original head 9fc1b794 independently completed 21/21.
  • Reproducible user-visible defect fixed: live OnPaint applied right-drag pan offsets while GetImage passed zero offsets, so exported PNGs discarded the user's pan. New commit db44d1d7 carries the current camera pan into exports, scaled by output viewport dimensions.
  • On this new exact fix head, Mono CI has independently passed 44/44 cases, including actual XTEST right-button panning, before/after live X11 screen pixel comparison and before/after PNG pixel comparison. The artifact contains mono-3d-visible-prepan.png, mono-3d-visible-panned.png and mono-3d-panned-export.png. The remaining workflows on the new commit must be assessed separately from the 21/21 original-head result.
  • Draft combined PR #300 integrates both branches, includes the pan fix and tests matched 33×33 paraboloid, sin/cos and 1/(x-y) reference contracts on Windows-Web and Linux-Mono. Treat the new candidate's whole-matrix result as pending until all workflows complete.
  • Not forced to renderer identity: Mono has 17–97 grid samples/axis, CPU painter ordering, right-drag pan, keyboard controls, native point series and synchronous local evaluation; Web has 9–129 samples, Plotly WebGL, server-side cancellation and browser PNG export. Sparse/degenerate domains, extreme spans, CPU responsiveness, standalone Linux/macOS API hosting and certified macOS GUI remain separate concerns.
  • Draft only. No merge without explicit owner approval.

Scale viewport pan offsets in GetImage instead of resetting them. Capture native before/after right-button XTEST screenshots and enforce that the exported image retains the resulting pan.
PawelTroka added a commit that referenced this pull request Oct 27, 2026
…xtures

Assert matched native/Web sampling coordinates and heights for paraboloid and sin/cos, and exactly 33 missing diagonal points for 1/(x-y); carry forward real-X11 pan/export regression from #296.
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