Skip to content

assets: project logo, marketplace featured image, and generator scripts - #277

Open
kmarchais wants to merge 5 commits into
mainfrom
assets/mmgpy-logo
Open

assets: project logo, marketplace featured image, and generator scripts#277
kmarchais wants to merge 5 commits into
mainfrom
assets/mmgpy-logo

Conversation

@kmarchais

Copy link
Copy Markdown
Owner

Summary

Two ready-to-use marketing assets for the Blender marketplace listing (and general project branding), plus the scripts that produce them so they can be regenerated or tweaked without re-doing the work by hand.

Assets

Logo (assets/mmgpy-logo.svg + .png)

Wireframe icosphere with a top-heavy density gradient — communicates "remeshing" without copying MMG's panda mark. Single Blender-orange stroke (#E87D0D), transparent fill, so the mark reads on both light and dark backgrounds.

  • mmgpy-logo.svg — vector master (scales to any size)
  • mmgpy-logo.png — 256x256 raster for the marketplace icon slot

Featured image (assets/featured-image.png, 1920x1080)

One Suzanne, split down the middle: left half is the stock triangulation, right half is the same surface remeshed via pv.PolyData.mmg.remesh. Per-triangle colouring with MMG's in-radius-ratio quality on a RdYlBu colormap (red = thin triangle, blue = equilateral), windowed to [0.5, 1.0] so the warm tones stay visible on the original side. Each half has a quality-distribution histogram (bars sharing the same colormap as the surface) with a mean marker.

Rendered with Cycles at 256 samples, denoised. Three-point area lighting (key + fill + rim) with matte PBR Principled BSDF on a low-ambient backdrop.

Scripts

scripts/generate_logo.py

Pure-Python icosahedron-subdivider + 2D-projection SVG writer; no Blender dependency. Density gradient is implemented as selective per-face subdivision based on Y. Run with uv run --no-project python scripts/generate_logo.py. Edit colour constants at the top to retheme.

scripts/render_featured_image.py

End-to-end Suzanne render using bpy + mmgpy==0.14.0 + pyvista:

  • Adds Suzanne, triangulates, runs MMG twice for best mesh quality (mean q lifts from 0.75 to 0.95)
  • Splits at x=0 and stitches the original-left / remeshed-right halves into one rendered object
  • Per-face PBR colouring keyed off the in-radius-ratio quality
  • PIL composite for title, half-labels, per-half histograms, and bottom tagline

Run with the command in the script's module docstring. Cycles render takes ~30 seconds; bpy is a ~370 MB one-time download.

Notes

  • pyproject.toml: extended the scripts/**/*.py ruff ignore set so render scripts can use whatever idioms make sense locally (longer lines, kwargs bags, render-time import ordering).
  • Both scripts are reproducible: rerun and get the same output. Edit a constant near the top of either file to adjust colour, density gradient, MMG params, or sigmoid window.

@github-actions

Copy link
Copy Markdown
Contributor

📖 Docs preview: https://kmarchais.github.io/mmgpy/pr-277/

@codecov

codecov Bot commented May 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.19%. Comparing base (b2341cd) to head (cd0dc22).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #277   +/-   ##
=======================================
  Coverage   86.19%   86.19%           
=======================================
  Files          29       29           
  Lines        3832     3832           
  Branches      692      692           
=======================================
  Hits         3303     3303           
  Misses        326      326           
  Partials      203      203           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@github-actions

github-actions Bot commented May 16, 2026

Copy link
Copy Markdown
Contributor

Benchmark Results Summary

Group Benchmarks Mean Time Range
duplicate-detection 2 5.82ms - 70.94ms
operations 6 0.14ms - 58.81ms
remesh-2d 3 187.48ms - 188.70ms
remesh-3d 3 3002.32ms - 10585.38ms
remesh-surface 4 208.84ms - 486.23ms

Total: 18 benchmarks


Benchmark Comparison Results

Status: ✅ PASS
Compared: 18 benchmarks (threshold: 1.3x)

18 benchmarks passed
Benchmark Baseline Current Ratio
test_surface_adaptive_hmin_hgrad 198.55ms 208.84ms 1.05x
test_construction_3d 31.00ms 32.17ms 1.04x
test_3d_metric_hgrad 10.25s 10.59s 1.03x
test_3d_optimize 2.94s 3.00s 1.02x
test_pyvista_roundtrip_3d 35.53ms 36.23ms 1.02x
test_metric_field_set_get 140.9us 142.7us 1.01x
test_duplicate_detection_100k 70.26ms 70.94ms 1.01x
test_surface_uniform 354.88ms 358.10ms 1.01x
test_validate_3d 13.42ms 13.55ms 1.01x
test_surface_optimize 479.32ms 482.44ms 1.01x
test_3d_adaptive_hmin_hmax_hausd 8.54s 8.58s 1.00x
test_surface_metric_hmax_hausd_angle 484.02ms 486.23ms 1.00x
test_2d_metric_hmin_hausd 188.00ms 188.70ms 1.00x
test_quality_3d 295.1us 295.4us 1.00x
test_duplicate_detection_10k 5.82ms 5.82ms 1.00x
test_2d_adaptive_hmax_hgrad_angle 187.82ms 187.48ms 1.00x
test_2d_uniform_angle 188.21ms 187.57ms 1.00x
test_io_roundtrip_3d 59.63ms 58.81ms 0.99x

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