diff options
author | Campbell Barton <campbell@blender.org> | 2022-03-30 09:26:42 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-03-30 10:01:22 +0300 |
commit | a8ec7845e0bdb9e63e9d3dbd7f4cd7caad36b5a2 (patch) | |
tree | 4531232281ddc4cda4df3fb1ccc0822018fe5682 /source/blender/blenlib/intern/mesh_boolean.cc | |
parent | af3aaf80344e745e6c207102941513cb631194c3 (diff) |
Cleanup: use "num" as a suffix in: source/blender/blenlib
Also replace "num" with:
- "number" when it's not used to denote the number of items.
- "digits" when digits in a string are being manipulated.
Diffstat (limited to 'source/blender/blenlib/intern/mesh_boolean.cc')
-rw-r--r-- | source/blender/blenlib/intern/mesh_boolean.cc | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/source/blender/blenlib/intern/mesh_boolean.cc b/source/blender/blenlib/intern/mesh_boolean.cc index 70030fc2bdf..700c126ca4c 100644 --- a/source/blender/blenlib/intern/mesh_boolean.cc +++ b/source/blender/blenlib/intern/mesh_boolean.cc @@ -171,9 +171,9 @@ TriMeshTopology::TriMeshTopology(const IMesh &tm) /* If everything were manifold, `F+V-E=2` and `E=3F/2`. * So an likely overestimate, allowing for non-manifoldness, is `E=2F` and `V=F`. */ const int estimate_num_edges = 2 * tm.face_size(); - const int estimate_num_verts = tm.face_size(); + const int estimate_verts_num = tm.face_size(); edge_tri_.reserve(estimate_num_edges); - vert_edges_.reserve(estimate_num_verts); + vert_edges_.reserve(estimate_verts_num); for (int t : tm.face_index_range()) { const Face &tri = *tm.face(t); BLI_assert(tri.is_tri()); @@ -2607,18 +2607,18 @@ static void test_tri_inside_shapes(const IMesh &tm, * Perturb their directions slightly to make it less likely to hit a seam. * Ray-cast assumes they have unit length, so use r1 near 1 and * ra near 0.5, and rb near .01, but normalized so `sqrt(r1^2 + ra^2 + rb^2) == 1`. */ - constexpr int num_rays = 6; + constexpr int rays_num = 6; constexpr float r1 = 0.9987025295199663f; constexpr float ra = 0.04993512647599832f; constexpr float rb = 0.009987025295199663f; - const float test_rays[num_rays][3] = { + const float test_rays[rays_num][3] = { {r1, ra, rb}, {-r1, -ra, -rb}, {rb, r1, ra}, {-rb, -r1, -ra}, {ra, rb, r1}, {-ra, -rb, -r1}}; InsideShapeTestData data(tm, shape_fn, nshapes); data.hit_parity = Array<int>(nshapes, 0); Array<int> count_insides(nshapes, 0); const float co[3] = { float(offset_test_point[0]), float(offset_test_point[1]), float(offset_test_point[2])}; - for (int i = 0; i < num_rays; ++i) { + for (int i = 0; i < rays_num; ++i) { if (dbg_level > 0) { std::cout << "shoot ray " << i << "(" << test_rays[i][0] << "," << test_rays[i][1] << "," << test_rays[i][2] << ")\n"; @@ -2643,7 +2643,7 @@ static void test_tri_inside_shapes(const IMesh &tm, in_shape[j] = 1.0f; /* Let's say a shape is always inside itself. */ } else { - in_shape[j] = float(count_insides[j]) / float(num_rays); + in_shape[j] = float(count_insides[j]) / float(rays_num); } if (dbg_level > 0) { std::cout << "shape " << j << " inside = " << in_shape[j] << "\n"; @@ -3400,19 +3400,19 @@ static void dissolve_verts(IMesh *imesh, const Array<bool> dissolve, IMeshArena for (int f : imesh->face_index_range()) { const Face &face = *imesh->face(f); face_pos_erase.clear(); - int num_erase = 0; + int erase_num = 0; for (const Vert *v : face) { int v_index = imesh->lookup_vert(v); BLI_assert(v_index != NO_INDEX); if (dissolve[v_index]) { face_pos_erase.append(true); - ++num_erase; + ++erase_num; } else { face_pos_erase.append(false); } } - if (num_erase > 0) { + if (erase_num > 0) { any_faces_erased |= imesh->erase_face_positions(f, face_pos_erase, arena); } } @@ -3475,8 +3475,8 @@ static IMesh polymesh_from_trimesh_with_dissolve(const IMesh &tm_out, if (dbg_level > 1) { std::cout << "merge tris for face " << in_f << "\n"; } - int num_out_tris_for_face = face_output_tris.size(); - if (num_out_tris_for_face == 0) { + int out_tris_for_face_num = face_output_tris.size(); + if (out_tris_for_face_num == 0) { continue; } face_output_face[in_f] = merge_tris_for_face(face_output_tris[in_f], tm_out, imesh_in, arena); |