Skip to content

sxin-h/3D-Low-Poly-Generator

 
 

Repository files navigation

3D Low Poly Generator / Mesh Decimation Tool

Try it out: 3D Low Poly Generator

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

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!

hi1

hi2

Usage

The 'Triangle Reduction %' slider will adjust the overall amount of decimation. A higher number will result in a higher number of triangles removed.

Example:
Triangle Reduction 30%: 30% of triangles removed
Triangle Reduction 5%: 5% of triangles removed

Commands

Decimate: Updates current mesh with requested triangle reduction
Reset: Resets current mesh to original triangle count
Export STL: Exports an .stl with the current triangle count
Export OBJ: Exports an .obj 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.

Triangle_Count

Read more here: https://3dwithus.com/low-poly-generator-reduce-stl-file-size-and-create-art

About

3D Low Poly Generator / Mesh Decimation Tool

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 78.7%
  • HTML 19.2%
  • CSS 2.1%