Skip to content

gonnavis/3D-Low-Poly-Generator

 
 

Repository files navigation

3D Low Poly Generator / Mesh Decimation Tool

Try it out: 3D Low Poly Generator

The 3D Low Poly Generator lets you import an .STL file and create a low poly masterpiece of your own, perfect for 3D printing! The entire process is done in-browser using three.js, so there's no additional software to load or learn. Just upload a file and start experimenting!

Deci1 Deci2

Usage

The 'Decimation Percentage' variable will adjust the overall amount of decimation. A higher number will result in a high number of triangles removed.

Example:
Decimation Percentage: .3 = 30% of triangles removed
Decimation Percentage: .05 = 5% of triangles removed

Commands

Update: Updates current mesh with requested triangle reduction
Reset: Resets current mesh to original triangle count
Export: Exports an .STL with the current triangle count

How it works

The 3D Low Poly Generator uses the Simplifymodifier.js class to reduce a mesh by a set number of triangles.

Time Estimation

The implementation of a time estimate was my wife's idea (thanks Erica!), and it makes the whole project feel more complete. Because the interface becomes unresponsive during processing and there is no progress bar, the time estimation can be used to know if a mesh should be finished after a certain amount of time.

Deci4

I ran the 3D Low Poly Generator using several different models at various levels of triangle reduction, and logged the time and number of triangles reduced. The average I calculated was .00267 seconds per triangle removed.

This variable is used to calculate the overall amount of time required to reduce a mesh by a given number of triangles.

var currentTri = currentTriangles
var targetTri = currentTriangles - (Math.floor((decimatePercentage* currentTriangles)))
var time = Math.floor((decimatePercentage * currentTriangles) * .00267)

It's not 100% accurate, but it is able to give a good indication of the general amount of time required to process a mesh, as well as estimating how many triangles will be removed.

Deci5

Find this project useful? You can buy me a coffee on Ko-Fi!

About

3D Low Poly Generator / Mesh Decimation Tool

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 73.8%
  • HTML 22.7%
  • CSS 3.5%