Skip to content

Instantly share code, notes, and snippets.

@FennelFetish
Created March 7, 2020 11:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FennelFetish/da93255b901f6ddc9d2999431c81ea81 to your computer and use it in GitHub Desktop.
Save FennelFetish/da93255b901f6ddc9d2999431c81ea81 to your computer and use it in GitHub Desktop.
private Geometry generate()
{
HeMesh mesh = new HeMesh();
BaseShape base = new BaseShape();
base.radius = 1.6f;
base.numSides = 7;
base.apply(mesh);
Face back = base.getBack();
//new Extrusion().apply(mesh, back);
new Translation(0, 0, 2.5f).apply(mesh, back);
//new Scale(0.01f, 0.01f).apply(mesh, back);
Fan fan = new Fan();
fan.apply(mesh, back);
for(Face fanface : fan.getResultFaces())
{
new Extrusion().apply(mesh, fanface);
new Scale(0.35f, 0.35f).apply(mesh, fanface);
new Translation(0, 0, 1.4f).apply(mesh, fanface);
new Extrusion().apply(mesh, fanface);
new Translation(0, 0, 1.2f).apply(mesh, fanface);
new Ripples(0.1f, 0.7f, 1.4f, 3).apply(mesh, fanface);
new Translation(0, 0, 0.6f).apply(mesh, fanface);
new Ripples(0.1f, 0.7f, 1.4f, 3).apply(mesh, fanface);
new Translation(0, 0, 1.2f).apply(mesh, fanface);
new Scale(0.4f, 0.4f).apply(mesh, fanface);
}
Face f = base.getFront();
/*EdgeSplit split = new EdgeSplit(0.5f);
split.apply(mesh, f.edge.opposite);
split.getResultVertex().v.addLocal(-2, 0, 0);*/
/*Ripples ripples = new Ripples(0.1f, 0.7f, 1.1f, 6);
ripples.apply(mesh, f);
new Translation(0, 0, 2.5f).apply(mesh, f);
new Scale(0.01f, 0.01f).apply(mesh, f);*/
Extrusion ex = new Extrusion();
ex.setTransformOperator(new Translation(0, 0, 0.8f));
ex.apply(mesh, f);
ex.setTransformOperator(new Translation(0, 0, 4.0f));
ex.setSideFaceOperator(new BeveledBox(0.5f, 0.26f));
ex.apply(mesh, f);
ex.setTransformOperator(new Translation(0, 0, 0.8f));
ex.setSideFaceOperator(null);
ex.apply(mesh, f);
Extrusion childEx = new Extrusion();
childEx.setTransformOperator(wingOp());
Extrusion ex2 = new Extrusion();
ex2.setTransformOperator(new Translation(0, 0, 1.2f));
ex2.setSideFaceOperator(childEx);
ex2.apply(mesh, f);
ex.apply(mesh, f);
ex2.setSideFaceOperator(null);
ex2.apply(mesh, f);
ex.setTransformOperator(new Translation(0, 0, 1.8f));
ex.apply(mesh, f);
Scale sc = new Scale(0.5f, 0.5f);
sc.apply(mesh, f);
new Translation(0, 0, 0.2f).apply(mesh, f);
new Extrusion().apply(mesh, f);
//new Translation(0, 0, 6.0f).apply(mesh, f);
new Spiral(7.0f, 40, 180.0f).apply(mesh, f);
Ripples ripples = new Ripples(0.1f, 0.7f, 1.2f, 6);
ripples.apply(mesh, f);
new Extrusion().apply(mesh, f);
new Scale(0.6f, 0.6f).apply(mesh, f);
new Extrusion().apply(mesh, f);
new Translation(0, 0, -10.0f).apply(mesh, f);
//HeNavigationAppState navig = new HeNavigationAppState(mesh, rootNode);
//stateManager.attach(navig);
Geometry geom = buildMesh(mesh);
return geom;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment