Skip to content

Instantly share code, notes, and snippets.

@miho
Created July 10, 2018 19:21
Show Gist options
  • Save miho/9a8cd289d36bf9e01ae410013b52720c to your computer and use it in GitHub Desktop.
Save miho/9a8cd289d36bf9e01ae410013b52720c to your computer and use it in GitHub Desktop.
JCSG Mesh Extension Component for VRL-Studio
package eu.mihosoft.vrl.user;
import eu.mihosoft.jcsg.*;
import eu.mihosoft.jcsg.ext.mesh.MeshTools;
@ComponentInfo(name="MeshOptimizer", category="Custom")
public class MeshOptimizer implements java.io.Serializable {
private static final long serialVersionUID=1L;
public CSG optimize(
CSG csg,
@ParamInfo(name="TOL", style="default", options="1e-6") double tol,
@ParamInfo(name="max TOL", style="default", options="1e-4") double maxTol,
@ParamInfo(name="min edge length", style="default", options="0.25") double minEdgeLength,
@ParamInfo(name="min edge length", style="default", options="1.5") double maxEdgeLength) {
return MeshTools.optimize(
csg, // csg object to optimize
tol, // tolerance
maxTol, // 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