Created
December 18, 2018 13:12
-
-
Save miho/f02b6a5eb3b376a00bfe152033a87faa to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package eu.mihosoft.vrl.user; | |
import eu.mihosoft.jcsg.ext.mesh.MeshTools; | |
import eu.mihosoft.jcsg.CSG; | |
@ComponentInfo(name="MeshOptimizer", category="Custom") | |
public class MeshOptimizer implements java.io.Serializable { | |
private static final long serialVersionUID=1L; | |
public CSG optimize( | |
@ParamInfo(name="mesh to optimize", style="default", options="") CSG mesh, | |
@ParamInfo(name="min edge length" , style="default", options="value=0.25") double minEdgeLength, | |
@ParamInfo(name="max edge length" , style="default", options="value=1.5") double maxEdgeLength | |
) { | |
// perform the optimization | |
return MeshTools.optimize( | |
mesh, // csg object to optimize | |
1e-6, // tolerance | |
1e-1, // max tolerance | |
minEdgeLength, // min edge length | |
maxEdgeLength // max edge length | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment