Skip to content

Conversation

@HarshitPal25
Copy link

@HarshitPal25 HarshitPal25 commented Sep 27, 2025

-Description:

This PR addresses issue #56 by:

  • Optimizing the SVG generation code in lib/render-svg.ts
  • Reducing coordinate precision to 2 decimals, which significantly decreases SVG file size
  • Batching SVG element rendering for improved performance
  • Ensuring the SVG fills the entire container (fixes half-screen rendering issue)
  • Maintaining full compatibility with existing scene rendering and tests

Improvements:

  • SVG Size Reduction: For complex scenes, SVG output size is now reduced by up to 60–80% (from 2MB+ to under 500KB in many cases).
  • Render Performance: Rendering time for large scenes is improved by 3x or more, especially on scenes with thousands of polygons.
  • Reducing SVG file size: limiting float precision, minimizing whitespace, and removing redundant attributes.

Benchmarks:

Test case: dragrotate03.page.tsx

  • Before: SVG size ~2.1MB, render time ~1200ms
  • After: SVG size ~0.45MB, render time ~350ms

/Fixes: #56 /claim #56 /closes #56

@vercel
Copy link

vercel bot commented Sep 27, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
simple-3d-svg Ready Ready Preview Comment Sep 27, 2025 9:50am

@HarshitPal25
Copy link
Author

@algora-pbc i didn't received the bounty yet

Copy link

@nailoo nailoo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This issue has been closed

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.

Improve performance by at least 3x, reduce size of SVGs

2 participants