Search in sources :

Example 1 with NURBSMesh

use of maspack.geometry.NURBSMesh in project artisynth_core by artisynth.

the class NURBSViewer method addNURBSWithMesh.

public void addNURBSWithMesh(NURBSObject nurbs) {
    addNURBS(nurbs);
    if (nurbs instanceof NURBSSurface) {
        NURBSMesh mesh = new NURBSMesh();
        mesh.set((NURBSSurface) nurbs, /* triangular= */
        true);
        // mesh.setRenderEdges (true);
        Color gold = new Color(0.93f, 0.8f, 0.063f);
        RenderProps.setFaceColor(mesh, gold);
        meshTable.put(nurbs, mesh);
        System.out.println("mesh.numVerts=" + mesh.numVertices());
        viewer.addRenderable(mesh);
    }
}
Also used : Color(java.awt.Color) NURBSMesh(maspack.geometry.NURBSMesh) NURBSSurface(maspack.geometry.NURBSSurface)

Aggregations

Color (java.awt.Color)1 NURBSMesh (maspack.geometry.NURBSMesh)1 NURBSSurface (maspack.geometry.NURBSSurface)1