MCPcopy Create free account
hub / github.com/GeometryCollective/ddg-exercises / addCheckerboard

Function addCheckerboard

projects/parameterization/src/main.cpp:150–161  ·  view source on GitHub ↗

* Add checkerboard pattern to mesh */

Source from the content-addressed store, hash-verified

148 * Add checkerboard pattern to mesh
149 */
150void addCheckerboard(VertexData<Vector2>& flattening) {
151
152 std::vector<std::array<double, 2>> V_uv(mesh->nVertices());
153 for (Vertex v : mesh->vertices()) {
154 V_uv[v.getIndex()] = {flattening[v][0], flattening[v][1]};
155 }
156 checkerboard = psMesh->addVertexParameterizationQuantity("checkerboard", V_uv);
157 checkerboard->setEnabled(true);
158 checkerboard->setStyle(polyscope::ParamVizStyle::CHECKER);
159 checkerboard->setCheckerColors(std::make_pair(glm::vec3{1.0, 0.45, 0.0}, glm::vec3{0.55, 0.27, 0.07}));
160 checkerboard->setCheckerSize(0.002);
161}
162
163// Initalize objects for parameterization -- done once on program startup
164void initializeParameterizations() {

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected