MCPcopy Create free account
hub / github.com/cutdigital/mcut / makeQuad_xy

Function makeQuad_xy

tests/source/intersectionType.cpp:258–311  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

256}
257
258Mesh makeQuad_xy(
259 McDouble halfExtent, McDouble translX, McDouble translY, McDouble translZ)
260{
261 const McDouble h = halfExtent;
262 Mesh m;
263 m.numVertices = 4;
264 m.numFaces = 1;
265 std::vector<McDouble>& verts = m.vertices;
266
267 verts.resize((McSize)m.numVertices * 3);
268
269 McInt32 i = 0;
270
271 verts[i++] = -h; // x
272 verts[i++] = h; // y
273 verts[i++] = 0; // z
274
275 verts[i++] = h; // x
276 verts[i++] = h; // y
277 verts[i++] = 0; // z
278
279 verts[i++] = h; // x
280 verts[i++] = -h; // y
281 verts[i++] = 0; // z
282
283 verts[i++] = -h; // x
284 verts[i++] = -h; // y
285 verts[i++] = 0; // z
286
287 for (McInt32 j = 0; j < 4; ++j)
288 {
289 verts[(McSize)j * 3 + 0] += translX;
290 verts[(McSize)j * 3 + 1] += translY;
291 verts[(McSize)j * 3 + 2] += translZ;
292 }
293
294 std::vector<McIndex>& faces = m.faceIndices;
295 faces.resize((McSize)m.numFaces * 4);
296
297 i = 0;
298 // front
299 faces[i++] = 0;
300 faces[i++] = 1;
301 faces[i++] = 2;
302 faces[i++] = 3;
303
304 m.faceSizes.resize(m.numFaces);
305 for(McUint32 j = 0; j < m.numFaces; ++j)
306 {
307 m.faceSizes[j] = 4;
308 }
309
310 return m;
311}
312
313// Watertight cut-mesh INSIDE watertight source-mesh
314UTEST_F(IntersectionType, watertightCutMeshInsideWatertightSourceMesh)

Callers 1

UTEST_FFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected