diff options
Diffstat (limited to 'source/blender/bmesh')
23 files changed, 61 insertions, 52 deletions
diff --git a/source/blender/bmesh/bmesh_class.h b/source/blender/bmesh/bmesh_class.h index 8349dee06e2..1393e24e48e 100644 --- a/source/blender/bmesh/bmesh_class.h +++ b/source/blender/bmesh/bmesh_class.h @@ -23,7 +23,7 @@ /* bmesh data structures */ -/* dissable holes for now, +/* disable holes for now, * these are ifdef'd because they use more memory and cant be saved in DNA currently */ // #define USE_BMESH_HOLES diff --git a/source/blender/bmesh/intern/bmesh_construct.c b/source/blender/bmesh/intern/bmesh_construct.c index 224f6ad1e5c..760b0aa00ae 100644 --- a/source/blender/bmesh/intern/bmesh_construct.c +++ b/source/blender/bmesh/intern/bmesh_construct.c @@ -487,7 +487,7 @@ static void bm_vert_attrs_copy(BMesh *source_mesh, uint64_t cd_mask) { if ((source_mesh == target_mesh) && (source_vertex == target_vertex)) { - BLI_assert(!"BMVert: source and targer match"); + BLI_assert(!"BMVert: source and target match"); return; } if ((cd_mask & CD_MASK_NORMAL) == 0) { @@ -507,7 +507,7 @@ static void bm_edge_attrs_copy(BMesh *source_mesh, uint64_t UNUSED(cd_mask)) { if ((source_mesh == target_mesh) && (source_edge == target_edge)) { - BLI_assert(!"BMEdge: source and targer match"); + BLI_assert(!"BMEdge: source and target match"); return; } CustomData_bmesh_free_block_data(&target_mesh->edata, target_edge->head.data); @@ -522,7 +522,7 @@ static void bm_loop_attrs_copy(BMesh *source_mesh, uint64_t UNUSED(cd_mask)) { if ((source_mesh == target_mesh) && (source_loop == target_loop)) { - BLI_assert(!"BMLoop: source and targer match"); + BLI_assert(!"BMLoop: source and target match"); return; } CustomData_bmesh_free_block_data(&target_mesh->ldata, target_loop->head.data); @@ -537,7 +537,7 @@ static void bm_face_attrs_copy(BMesh *source_mesh, uint64_t cd_mask) { if ((source_mesh == target_mesh) && (source_face == target_face)) { - BLI_assert(!"BMFace: source and targer match"); + BLI_assert(!"BMFace: source and target match"); return; } if ((cd_mask & CD_MASK_NORMAL) == 0) { diff --git a/source/blender/bmesh/intern/bmesh_core.c b/source/blender/bmesh/intern/bmesh_core.c index 6ece32e57e8..68b30912041 100644 --- a/source/blender/bmesh/intern/bmesh_core.c +++ b/source/blender/bmesh/intern/bmesh_core.c @@ -209,7 +209,7 @@ BMEdge *BM_edge_create( /** * \note In most cases a \a l_example should be NULL, - * since this is a low level API and we shouldn't attempt to be clever and guess whats intended. + * since this is a low level API and we shouldn't attempt to be clever and guess what's intended. * In cases where copying adjacent loop-data is useful, see #BM_face_copy_shared. */ static BMLoop *bm_loop_create(BMesh *bm, diff --git a/source/blender/bmesh/intern/bmesh_interp.c b/source/blender/bmesh/intern/bmesh_interp.c index c58521297dd..48d6bcd7b03 100644 --- a/source/blender/bmesh/intern/bmesh_interp.c +++ b/source/blender/bmesh/intern/bmesh_interp.c @@ -39,7 +39,7 @@ #include "bmesh.h" #include "intern/bmesh_private.h" -/* edge and vertex share, currently theres no need to have different logic */ +/* edge and vertex share, currently there's no need to have different logic */ static void bm_data_interp_from_elem(CustomData *data_layer, const BMElem *ele_src_1, const BMElem *ele_src_2, @@ -461,7 +461,7 @@ typedef struct BMLoopInterpMultiresData { static void loop_interp_multires_cb(void *__restrict userdata, const int ix, - const ParallelRangeTLS *__restrict UNUSED(tls)) + const TaskParallelTLS *__restrict UNUSED(tls)) { BMLoopInterpMultiresData *data = userdata; @@ -561,7 +561,7 @@ void BM_loop_interp_multires_ex(BMesh *UNUSED(bm), .res = res, .d = 1.0f / (float)(res - 1), }; - ParallelRangeSettings settings; + TaskParallelSettings settings; BLI_parallel_range_settings_defaults(&settings); settings.use_threading = (res > 5); BLI_task_parallel_range(0, res, &data, loop_interp_multires_cb, &settings); diff --git a/source/blender/bmesh/intern/bmesh_marking.c b/source/blender/bmesh/intern/bmesh_marking.c index bb55365f619..5aec59ccd5d 100644 --- a/source/blender/bmesh/intern/bmesh_marking.c +++ b/source/blender/bmesh/intern/bmesh_marking.c @@ -884,8 +884,8 @@ void BM_editselection_plane(BMEditSelection *ese, float r_plane[3]) sub_v3_v3v3(r_plane, vec, eve->co); } else { - /* make a fake plane thats at rightangles to the normal - * we cant make a crossvec from a vec thats the same as the vec + /* make a fake plane that's at rightangles to the normal + * we can't make a crossvec from a vec that's the same as the vec * unlikely but possible, so make sure if the normal is (0, 0, 1) * that vec isn't the same or in the same direction even. */ if (eve->no[0] < 0.5f) { diff --git a/source/blender/bmesh/intern/bmesh_mesh.c b/source/blender/bmesh/intern/bmesh_mesh.c index c796bdea688..f44b758ef6b 100644 --- a/source/blender/bmesh/intern/bmesh_mesh.c +++ b/source/blender/bmesh/intern/bmesh_mesh.c @@ -1345,7 +1345,7 @@ void BM_normals_loops_edges_tag(BMesh *bm, const bool do_edges) } /** - * Auxillary function only used by rebuild to detect if any spaces were not marked as invalid. + * Auxiliary function only used by rebuild to detect if any spaces were not marked as invalid. * Reports error if any of the lnor spaces change after rebuilding, meaning that all the possible * lnor spaces to be rebuilt were not correctly marked. */ diff --git a/source/blender/bmesh/intern/bmesh_mods.c b/source/blender/bmesh/intern/bmesh_mods.c index c28d748b2eb..53f68804bd3 100644 --- a/source/blender/bmesh/intern/bmesh_mods.c +++ b/source/blender/bmesh/intern/bmesh_mods.c @@ -1029,7 +1029,7 @@ BMEdge *BM_edge_rotate(BMesh *bm, BMEdge *e, const bool ccw, const short check_f /* Rotate The Edge */ /* first create the new edge, this is so we can copy the customdata from the old one - * if splice if disabled, always add in a new edge even if theres one there. */ + * if splice if disabled, always add in a new edge even if there's one there. */ e_new = BM_edge_create( bm, v1, v2, e, (check_flag & BM_EDGEROT_CHECK_SPLICE) ? BM_CREATE_NO_DOUBLE : BM_CREATE_NOP); diff --git a/source/blender/bmesh/intern/bmesh_opdefines.c b/source/blender/bmesh/intern/bmesh_opdefines.c index 2114f9ebd3d..e8b35afdcb1 100644 --- a/source/blender/bmesh/intern/bmesh_opdefines.c +++ b/source/blender/bmesh/intern/bmesh_opdefines.c @@ -1545,7 +1545,7 @@ static BMOpDefine bmo_split_edges_def = { "split_edges", /* slots_in */ {{"edges", BMO_OP_SLOT_ELEMENT_BUF, {BM_EDGE}}, /* input edges */ - /* needed for vertex rip so we can rip only half an edge at a boundary wich would otherwise split off */ + /* needed for vertex rip so we can rip only half an edge at a boundary which would otherwise split off */ {"verts", BMO_OP_SLOT_ELEMENT_BUF, {BM_VERT}}, /* optional tag verts, use to have greater control of splits */ {"use_verts", BMO_OP_SLOT_BOOL}, /* use 'verts' for splitting, else just find verts to split from edges */ {{'\0'}}, diff --git a/source/blender/bmesh/intern/bmesh_operator_api.h b/source/blender/bmesh/intern/bmesh_operator_api.h index f06a5fb8b13..2039289dcd7 100644 --- a/source/blender/bmesh/intern/bmesh_operator_api.h +++ b/source/blender/bmesh/intern/bmesh_operator_api.h @@ -100,7 +100,7 @@ BLI_INLINE BMFlagLayer *BMO_elem_flag_from_header(BMHeader *ele_head) _bmo_elem_flag_toggle( \ bm, (BM_CHECK_TYPE_ELEM_NONCONST(ele), BMO_elem_flag_from_header(&(ele)->head)), oflag) -/* take care not to instansiate args multiple times */ +/* take care not to instantiate args multiple times */ #ifdef __GNUC___ # define _BMO_CAST_V_CONST(e) \ ({ \ @@ -203,7 +203,7 @@ typedef enum eBMOpSlotType { /* normally store pointers to object, scene, * _never_ store arrays corresponding to mesh elements with this */ - BMO_OP_SLOT_PTR = 4, /* requres subtype BMO_OP_SLOT_SUBTYPE_PTR_xxx */ + BMO_OP_SLOT_PTR = 4, /* requires subtype BMO_OP_SLOT_SUBTYPE_PTR_xxx */ BMO_OP_SLOT_MAT = 5, BMO_OP_SLOT_VEC = 8, @@ -212,7 +212,7 @@ typedef enum eBMOpSlotType { * * it's very important this remain a power of two */ BMO_OP_SLOT_ELEMENT_BUF = 9, /* list of verts/edges/faces */ - BMO_OP_SLOT_MAPPING = 10 /* simple hash map, requres subtype BMO_OP_SLOT_SUBTYPE_MAP_xxx */ + BMO_OP_SLOT_MAPPING = 10 /* simple hash map, requires subtype BMO_OP_SLOT_SUBTYPE_MAP_xxx */ } eBMOpSlotType; #define BMO_OP_SLOT_TOTAL_TYPES 11 diff --git a/source/blender/bmesh/intern/bmesh_polygon_edgenet.c b/source/blender/bmesh/intern/bmesh_polygon_edgenet.c index 14b73693b03..83ac7df058a 100644 --- a/source/blender/bmesh/intern/bmesh_polygon_edgenet.c +++ b/source/blender/bmesh/intern/bmesh_polygon_edgenet.c @@ -495,13 +495,16 @@ bool BM_face_split_edgenet(BMesh *bm, return false; } + /* These arrays used to be stack memory, however they can be + * large for single faces with complex edgenets, see: T65980. */ + /* over-alloc (probably 2-4 is only used in most cases), for the biggest-fan */ - edge_order = BLI_array_alloca(edge_order, edge_order_len); + edge_order = MEM_mallocN(sizeof(*edge_order) * edge_order_len, __func__); /* use later */ - face_verts = BLI_array_alloca(face_verts, edge_net_len + f->len); + face_verts = MEM_mallocN(sizeof(*face_verts) * (edge_net_len + f->len), __func__); - vert_queue = BLI_array_alloca(vert_queue, edge_net_len + f->len); + vert_queue = MEM_mallocN(sizeof(vert_queue) * (edge_net_len + f->len), __func__); STACK_INIT(vert_queue, f->len + edge_net_len); BLI_assert(BM_ELEM_API_FLAG_TEST(f, FACE_NET) == 0); @@ -687,6 +690,10 @@ bool BM_face_split_edgenet(BMesh *bm, } } + MEM_freeN(edge_order); + MEM_freeN(face_verts); + MEM_freeN(vert_queue); + return true; } @@ -758,8 +765,8 @@ struct EdgeGroupIsland { /* Set the following vars once we have >1 groups */ - /* when when an edge in a previous group connects to this one, - * so theres no need to create one pointing back. */ + /* when an edge in a previous group connects to this one, + * so there's no need to create one pointing back. */ uint has_prev_edge : 1; /* verts in the group which has the lowest & highest values, @@ -993,7 +1000,7 @@ static int bm_face_split_edgenet_find_connection(const struct EdgeGroup_FindConn * until a vertex is found which isn't blocked by an edge. * * \note It's possible none of the verts can be accessed (with self-intersecting lines). - * In that case theres no right answer (without subdividing edges), + * In that case there's no right answer (without subdividing edges), * so return a fall-back vertex in that case. */ @@ -1247,7 +1254,7 @@ bool BM_face_split_edgenet_connect_islands(BMesh *bm, */ const uint edge_arr_len = (uint)edge_net_init_len + (uint)f->len; - BMEdge **edge_arr = BLI_array_alloca(edge_arr, edge_arr_len); + BMEdge **edge_arr = BLI_memarena_alloc(mem_arena, sizeof(*edge_arr) * edge_arr_len); bool ok = false; uint edge_net_new_len = (uint)edge_net_init_len; @@ -1342,7 +1349,7 @@ bool BM_face_split_edgenet_connect_islands(BMesh *bm, BM_elem_flag_disable(e_iter, EDGE_NOT_IN_STACK); unique_edges_in_group++; - BLI_linklist_prepend_alloca(&edge_links, e_iter); + BLI_linklist_prepend_arena(&edge_links, e_iter, mem_arena); BMVert *v_other = BM_edge_other_vert(e_iter, v_iter); if (BM_elem_flag_test(v_other, VERT_NOT_IN_STACK)) { @@ -1353,7 +1360,7 @@ bool BM_face_split_edgenet_connect_islands(BMesh *bm, } while ((e_iter = BM_DISK_EDGE_NEXT(e_iter, v_iter)) != v_iter->e); } - struct EdgeGroupIsland *g = alloca(sizeof(*g)); + struct EdgeGroupIsland *g = BLI_memarena_alloc(mem_arena, sizeof(*g)); g->vert_len = unique_verts_in_group; g->edge_len = unique_edges_in_group; edge_in_group_tot += unique_edges_in_group; @@ -1474,7 +1481,7 @@ bool BM_face_split_edgenet_connect_islands(BMesh *bm, if (!BM_elem_flag_test(v_iter, VERT_IN_ARRAY)) { BM_elem_flag_enable(v_iter, VERT_IN_ARRAY); - /* not nice, but alternatives arent much better :S */ + /* not nice, but alternatives aren't much better :S */ { copy_v3_v3(vert_coords_backup[v_index], v_iter->co); diff --git a/source/blender/bmesh/intern/bmesh_structure.h b/source/blender/bmesh/intern/bmesh_structure.h index 7ae55a5fa6f..38c75dec354 100644 --- a/source/blender/bmesh/intern/bmesh_structure.h +++ b/source/blender/bmesh/intern/bmesh_structure.h @@ -34,7 +34,7 @@ /* LOOP CYCLE MANAGEMENT */ bool bmesh_loop_validate(BMFace *f) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(); -/* DISK CYCLE MANAGMENT */ +/* DISK CYCLE MANAGEMENT */ void bmesh_disk_edge_append(BMEdge *e, BMVert *v) ATTR_NONNULL(); void bmesh_disk_edge_remove(BMEdge *e, BMVert *v) ATTR_NONNULL(); BLI_INLINE BMEdge *bmesh_disk_edge_next_safe(const BMEdge *e, @@ -60,7 +60,7 @@ BMLoop *bmesh_disk_faceloop_find_first_visible(const BMEdge *e, BMEdge *bmesh_disk_faceedge_find_next(const BMEdge *e, const BMVert *v) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(); -/* RADIAL CYCLE MANAGMENT */ +/* RADIAL CYCLE MANAGEMENT */ void bmesh_radial_loop_append(BMEdge *e, BMLoop *l) ATTR_NONNULL(); void bmesh_radial_loop_remove(BMEdge *e, BMLoop *l) ATTR_NONNULL(); void bmesh_radial_loop_unlink(BMLoop *l) ATTR_NONNULL(); diff --git a/source/blender/bmesh/intern/bmesh_walkers_impl.c b/source/blender/bmesh/intern/bmesh_walkers_impl.c index 20042e65287..ade6fdfcbed 100644 --- a/source/blender/bmesh/intern/bmesh_walkers_impl.c +++ b/source/blender/bmesh/intern/bmesh_walkers_impl.c @@ -805,7 +805,7 @@ static void *bmw_IslandWalker_step_ex(BMWalker *walker, bool only_manifold) continue; } - /* saves checking BLI_gset_haskey below (manifold edges theres a 50% chance) */ + /* saves checking BLI_gset_haskey below (manifold edges there's a 50% chance) */ if (f == iwalk->cur) { continue; } diff --git a/source/blender/bmesh/operators/bmo_bridge.c b/source/blender/bmesh/operators/bmo_bridge.c index 7ec73412373..5403043efb4 100644 --- a/source/blender/bmesh/operators/bmo_bridge.c +++ b/source/blender/bmesh/operators/bmo_bridge.c @@ -59,7 +59,7 @@ static void bm_bridge_splice_loops(BMesh *bm, /* get the 2 loops matching 2 verts. * first attempt to get the face corners that use the edge defined by v1 & v2, - * if that fails just get any loop thats on the vert (the first one) */ + * if that fails just get any loop that's on the vert (the first one) */ static void bm_vert_loop_pair(BMesh *bm, BMVert *v1, BMVert *v2, BMLoop **l1, BMLoop **l2) { BMEdge *e = BM_edge_exists(v1, v2); @@ -515,7 +515,7 @@ static void bridge_loop_pair(BMesh *bm, } BMO_op_exec(bm, &op_sub); - /* there may also be tagged faces that didnt rotate, mark input */ + /* there may also be tagged faces that didn't rotate, mark input */ if (use_edgeout) { BMOIter siter; diff --git a/source/blender/bmesh/operators/bmo_dupe.c b/source/blender/bmesh/operators/bmo_dupe.c index 6dd361d62b3..d9a7aa626e4 100644 --- a/source/blender/bmesh/operators/bmo_dupe.c +++ b/source/blender/bmesh/operators/bmo_dupe.c @@ -449,7 +449,7 @@ void bmo_split_exec(BMesh *bm, BMOperator *op) } } - /* connect outputs of dupe to delete, exluding keep geometry */ + /* connect outputs of dupe to delete, excluding keep geometry */ BMO_mesh_delete_oflag_context(bm, SPLIT_INPUT, DEL_FACES); /* now we make our outputs by copying the dupe output */ diff --git a/source/blender/bmesh/operators/bmo_edgenet.c b/source/blender/bmesh/operators/bmo_edgenet.c index 7ab8406a3ec..d38a1be7a8d 100644 --- a/source/blender/bmesh/operators/bmo_edgenet.c +++ b/source/blender/bmesh/operators/bmo_edgenet.c @@ -132,7 +132,7 @@ void bmo_edgenet_prepare_exec(BMesh *bm, BMOperator *op) } } - /* we don't have valid edge layouts, retur */ + /* we don't have valid edge layouts, return */ if (!ok) { return; } diff --git a/source/blender/bmesh/operators/bmo_inset.c b/source/blender/bmesh/operators/bmo_inset.c index 323bb5a7748..f23c420295b 100644 --- a/source/blender/bmesh/operators/bmo_inset.c +++ b/source/blender/bmesh/operators/bmo_inset.c @@ -549,7 +549,7 @@ void bmo_inset_region_exec(BMesh *bm, BMOperator *op) SplitEdgeInfo *es; /* Interpolation Vars */ - /* an array alligned with faces but only fill items which are used. */ + /* an array aligned with faces but only fill items which are used. */ InterpFace **iface_array = NULL; int iface_array_len; MemArena *interp_arena = NULL; diff --git a/source/blender/bmesh/operators/bmo_primitive.c b/source/blender/bmesh/operators/bmo_primitive.c index cf3d6b8bf56..287a7e93470 100644 --- a/source/blender/bmesh/operators/bmo_primitive.c +++ b/source/blender/bmesh/operators/bmo_primitive.c @@ -807,6 +807,7 @@ void BM_mesh_calc_uvs_grid(BMesh *bm, const float dx = 1.0f / (float)(x_segments - 1); const float dy = 1.0f / (float)(y_segments - 1); + const float dx_wrap = 1.0 - (dx / 2.0f); float x = 0.0f; float y = dy; @@ -844,7 +845,7 @@ void BM_mesh_calc_uvs_grid(BMesh *bm, } x += dx; - if (x >= 1.0f) { + if (x >= dx_wrap) { x = 0.0f; y += dy; } @@ -1091,7 +1092,7 @@ static void bm_mesh_calc_uvs_sphere_face(BMFace *f, const int cd_loop_uv_offset) float z = l->v->co[2]; float len = len_v3(l->v->co); - /* Use neigboring point to compute angle for poles. */ + /* Use neighboring point to compute angle for poles. */ float theta; if (f->len == 3 && fabsf(x) < 0.0001f && fabsf(y) < 0.0001f) { theta = atan2f(avgy, avgx); diff --git a/source/blender/bmesh/operators/bmo_subdivide.c b/source/blender/bmesh/operators/bmo_subdivide.c index 74635be4681..41f65dd6f5a 100644 --- a/source/blender/bmesh/operators/bmo_subdivide.c +++ b/source/blender/bmesh/operators/bmo_subdivide.c @@ -138,7 +138,7 @@ static BMEdge *connect_smallest_face(BMesh *bm, BMVert *v_a, BMVert *v_b, BMFace * multiple faces yet. that might require a convexity test to figure out which * face is "best" and who knows what for non-manifold conditions. * - * note: we allow adjacent here, since theres no chance this happens. + * note: we allow adjacent here, since there's no chance this happens. */ f = BM_vert_pair_share_face_by_len(v_a, v_b, &l_a, &l_b, true); diff --git a/source/blender/bmesh/operators/bmo_subdivide_edgering.c b/source/blender/bmesh/operators/bmo_subdivide_edgering.c index 6baf56f1723..cfbff105d70 100644 --- a/source/blender/bmesh/operators/bmo_subdivide_edgering.c +++ b/source/blender/bmesh/operators/bmo_subdivide_edgering.c @@ -1145,7 +1145,7 @@ void bmo_subdivide_edgering_exec(BMesh *bm, BMOperator *op) } else if (count == 2) { /* this case could be removed, - * but simple to avoid 'bm_edgering_pair_calc' in this case since theres only one. */ + * but simple to avoid 'bm_edgering_pair_calc' in this case since there's only one. */ struct BMEdgeLoopStore *el_store_a = eloops_rim.first; struct BMEdgeLoopStore *el_store_b = eloops_rim.last; LoopPairStore *lpair; diff --git a/source/blender/bmesh/tools/bmesh_bevel.c b/source/blender/bmesh/tools/bmesh_bevel.c index 90df3cd225e..94935f2090b 100644 --- a/source/blender/bmesh/tools/bmesh_bevel.c +++ b/source/blender/bmesh/tools/bmesh_bevel.c @@ -1357,7 +1357,7 @@ static void set_profile_params(BevelParams *bp, BevVert *bv, BoundVert *bndv) copy_v3_v3(pro->plane_co, co1); } else if (bndv->is_arc_start) { - /* assume pro->midco was alredy set */ + /* assume pro->midco was already set */ copy_v3_v3(pro->coa, co1); copy_v3_v3(pro->cob, co2); pro->super_r = PRO_CIRCLE_R; @@ -2295,7 +2295,7 @@ static void build_boundary_terminal_edge(BevelParams *bp, else { adjust_bound_vert(e->rightv, co); } - /* make artifical extra point along unbeveled edge, and form triangle */ + /* make artificial extra point along unbeveled edge, and form triangle */ slide_dist(e->next, bv->v, e->offset_l, co); if (construct) { v = add_new_bound_vert(mem_arena, vm, co); @@ -3837,7 +3837,7 @@ static VMesh *make_cube_corner_adj_vmesh(BevelParams *bp) /* Is this a good candidate for using tri_corner_adj_vmesh? */ static int tri_corner_test(BevelParams *bp, BevVert *bv) { - float ang, totang, angdiff; + float ang, absang, totang, angdiff; EdgeHalf *e; int i; int in_plane_e = 0; @@ -3852,10 +3852,11 @@ static int tri_corner_test(BevelParams *bp, BevVert *bv) for (i = 0; i < bv->edgecount; i++) { e = &bv->edges[i]; ang = BM_edge_calc_face_angle_signed_ex(e->e, 0.0f); - if (ang <= M_PI_4) { + absang = fabsf(ang); + if (absang <= M_PI_4) { in_plane_e++; } - else if (ang >= 3.0f * (float)M_PI_4) { + else if (absang >= 3.0f * (float)M_PI_4) { return -1; } totang += ang; @@ -3863,7 +3864,7 @@ static int tri_corner_test(BevelParams *bp, BevVert *bv) if (in_plane_e != bv->edgecount - 3) { return -1; } - angdiff = fabsf(totang - 3.0f * (float)M_PI_2); + angdiff = fabsf(fabsf(totang) - 3.0f * (float)M_PI_2); if ((bp->pro_super_r == PRO_SQUARE_R && angdiff > (float)M_PI / 16.0f) || (angdiff > (float)M_PI_4)) { return -1; diff --git a/source/blender/bmesh/tools/bmesh_decimate_collapse.c b/source/blender/bmesh/tools/bmesh_decimate_collapse.c index da525becc78..e32a9334343 100644 --- a/source/blender/bmesh/tools/bmesh_decimate_collapse.c +++ b/source/blender/bmesh/tools/bmesh_decimate_collapse.c @@ -698,7 +698,7 @@ static void bm_edge_collapse_loop_customdata( const bool is_manifold = BM_edge_is_manifold(l->e); int side; - /* first find the loop of 'v_other' thats attached to the face of 'l' */ + /* first find the loop of 'v_other' that's attached to the face of 'l' */ if (l->v == v_clear) { l_clear = l; l_other = l->next; @@ -882,7 +882,7 @@ static bool bm_edge_collapse_is_degenerate_topology(BMEdge *e_first) bm_edge_tag_enable(e_iter); } while ((e_iter = bmesh_disk_edge_next(e_iter, e_first->v1)) != e_first); - /* ... except for the edge we will collapse, we know thats shared, + /* ... except for the edge we will collapse, we know that's shared, * disable this to avoid false positive. We could be smart and never enable these * face/edge tags in the first place but easier to do this */ // bm_edge_tag_disable(e_first); diff --git a/source/blender/bmesh/tools/bmesh_path_region.c b/source/blender/bmesh/tools/bmesh_path_region.c index 8b139e6a5ff..841109a251f 100644 --- a/source/blender/bmesh/tools/bmesh_path_region.c +++ b/source/blender/bmesh/tools/bmesh_path_region.c @@ -224,7 +224,7 @@ static LinkNode *mesh_calc_path_region_elem(BMesh *bm, #endif /* USE_EDGE_CHAIN */ /* Keep walking over connected geometry until we find all the vertices in - * `ele_verts[side_other]`, or exit the loop when theres no connection. */ + * `ele_verts[side_other]`, or exit the loop when there's no connection. */ found_all = false; for (pass = 1; (STACK_SIZE(stack) != 0); pass++) { while (STACK_SIZE(stack) != 0) { @@ -268,7 +268,7 @@ static LinkNode *mesh_calc_path_region_elem(BMesh *bm, } while ((e = BM_DISK_EDGE_NEXT(e, v_a)) != v_a->e); } - /* Stop searching once theres none left. + /* Stop searching once there's none left. * Note that this looks in-efficient, however until the target elements reached, * it will exit immediately. * After that, it takes as many passes as the element has edges to finish off. */ diff --git a/source/blender/bmesh/tools/bmesh_region_match.c b/source/blender/bmesh/tools/bmesh_region_match.c index 8b9a9de3988..943f7532960 100644 --- a/source/blender/bmesh/tools/bmesh_region_match.c +++ b/source/blender/bmesh/tools/bmesh_region_match.c @@ -43,7 +43,7 @@ #include "bmesh.h" -#include "tools/bmesh_region_match.h" /* own incldue */ +#include "tools/bmesh_region_match.h" /* own include */ /* avoid re-creating ghash and pools for each search */ #define USE_WALKER_REUSE @@ -95,13 +95,13 @@ typedef struct UUIDWalk { BLI_mempool *step_pool; BLI_mempool *step_pool_items; - /* Optionaly use face-tag to isolate search */ + /* Optionally use face-tag to isolate search */ bool use_face_isolate; /* Increment for each pass added */ UUID_Int pass; - /* runtime vars, aviod re-creating each pass */ + /* runtime vars, avoid re-creating each pass */ struct { GHash *verts_uuid; /* BMVert -> UUID */ GSet *faces_step; /* BMFace */ |