diff options
Diffstat (limited to 'source/blender/bmesh')
-rw-r--r-- | source/blender/bmesh/intern/bmesh_core.c | 4 | ||||
-rw-r--r-- | source/blender/bmesh/intern/bmesh_interp.c | 10 | ||||
-rw-r--r-- | source/blender/bmesh/intern/bmesh_marking.c | 2 | ||||
-rw-r--r-- | source/blender/bmesh/intern/bmesh_mods.c | 10 | ||||
-rw-r--r-- | source/blender/bmesh/intern/bmesh_polygon.c | 14 | ||||
-rw-r--r-- | source/blender/bmesh/intern/bmesh_polygon.h | 6 | ||||
-rw-r--r-- | source/blender/bmesh/intern/bmesh_query.c | 2 | ||||
-rw-r--r-- | source/blender/bmesh/intern/bmesh_query.h | 2 | ||||
-rw-r--r-- | source/blender/bmesh/operators/bmo_normals.c | 2 | ||||
-rw-r--r-- | source/blender/bmesh/operators/bmo_planar_faces.c | 4 | ||||
-rw-r--r-- | source/blender/bmesh/operators/bmo_poke.c | 8 | ||||
-rw-r--r-- | source/blender/bmesh/operators/bmo_similar.c | 2 | ||||
-rw-r--r-- | source/blender/bmesh/tools/bmesh_decimate_collapse.c | 2 | ||||
-rw-r--r-- | source/blender/bmesh/tools/bmesh_intersect.c | 2 | ||||
-rw-r--r-- | source/blender/bmesh/tools/bmesh_path.c | 10 | ||||
-rw-r--r-- | source/blender/bmesh/tools/bmesh_wireframe.c | 4 |
16 files changed, 42 insertions, 42 deletions
diff --git a/source/blender/bmesh/intern/bmesh_core.c b/source/blender/bmesh/intern/bmesh_core.c index c384497e0d1..61cc3fbb683 100644 --- a/source/blender/bmesh/intern/bmesh_core.c +++ b/source/blender/bmesh/intern/bmesh_core.c @@ -1332,9 +1332,9 @@ BMFace *BM_faces_join(BMesh *bm, BMFace **faces, int totface, const bool do_del) float f_center[3]; float (*faces_center)[3] = BLI_array_alloca(faces_center, totface); - BM_face_calc_center_mean(f_new, f_center); + BM_face_calc_center_median(f_new, f_center); for (i = 0; i < totface; i++) { - BM_face_calc_center_mean(faces[i], faces_center[i]); + BM_face_calc_center_median(faces[i], faces_center[i]); } l_iter = l_first = BM_FACE_FIRST_LOOP(f_new); diff --git a/source/blender/bmesh/intern/bmesh_interp.c b/source/blender/bmesh/intern/bmesh_interp.c index e9c92e0d5e4..26c62d1086e 100644 --- a/source/blender/bmesh/intern/bmesh_interp.c +++ b/source/blender/bmesh/intern/bmesh_interp.c @@ -253,7 +253,7 @@ static int compute_mdisp_quad( { float cent[3]; /* computer center */ - BM_face_calc_center_mean(l->f, cent); + BM_face_calc_center_median(l->f, cent); BLI_assert(equals_v3v3(cent, l_f_center)); } #endif @@ -527,8 +527,8 @@ void BM_loop_interp_multires(BMesh *bm, BMLoop *l_dst, const BMFace *f_src) float f_dst_center[3]; float f_src_center[3]; - BM_face_calc_center_mean(l_dst->f, f_dst_center); - BM_face_calc_center_mean(f_src, f_src_center); + BM_face_calc_center_median(l_dst->f, f_dst_center); + BM_face_calc_center_median(f_src, f_src_center); BM_loop_interp_multires_ex(bm, l_dst, f_src, f_dst_center, f_src_center, cd_loop_mdisp_offset); } @@ -555,8 +555,8 @@ void BM_face_interp_multires(BMesh *bm, BMFace *f_dst, const BMFace *f_src) float f_dst_center[3]; float f_src_center[3]; - BM_face_calc_center_mean(f_dst, f_dst_center); - BM_face_calc_center_mean(f_src, f_src_center); + BM_face_calc_center_median(f_dst, f_dst_center); + BM_face_calc_center_median(f_src, f_src_center); BM_face_interp_multires_ex(bm, f_dst, f_src, f_dst_center, f_src_center, cd_loop_mdisp_offset); } diff --git a/source/blender/bmesh/intern/bmesh_marking.c b/source/blender/bmesh/intern/bmesh_marking.c index 1e53180396e..3e30627af0d 100644 --- a/source/blender/bmesh/intern/bmesh_marking.c +++ b/source/blender/bmesh/intern/bmesh_marking.c @@ -828,7 +828,7 @@ void BM_editselection_center(BMEditSelection *ese, float r_center[3]) } else if (ese->htype == BM_FACE) { BMFace *efa = (BMFace *)ese->ele; - BM_face_calc_center_mean(efa, r_center); + BM_face_calc_center_median(efa, r_center); } } diff --git a/source/blender/bmesh/intern/bmesh_mods.c b/source/blender/bmesh/intern/bmesh_mods.c index e95d5239caf..7ce908009cc 100644 --- a/source/blender/bmesh/intern/bmesh_mods.c +++ b/source/blender/bmesh/intern/bmesh_mods.c @@ -299,12 +299,12 @@ BMFace *BM_face_split( float f_dst_center[3]; float f_src_center[3]; - BM_face_calc_center_mean(f_tmp, f_src_center); + BM_face_calc_center_median(f_tmp, f_src_center); - BM_face_calc_center_mean(f, f_dst_center); + BM_face_calc_center_median(f, f_dst_center); BM_face_interp_multires_ex(bm, f, f_tmp, f_dst_center, f_src_center, cd_loop_mdisp_offset); - BM_face_calc_center_mean(f_new, f_dst_center); + BM_face_calc_center_median(f_new, f_dst_center); BM_face_interp_multires_ex(bm, f_new, f_tmp, f_dst_center, f_src_center, cd_loop_mdisp_offset); #if 0 @@ -642,7 +642,7 @@ BMVert *BM_edge_split(BMesh *bm, BMEdge *e, BMVert *v, BMEdge **r_e, float fac) for (i = 0; i < BLI_array_len(oldfaces); i++) { float f_center_old[3]; - BM_face_calc_center_mean(oldfaces[i], f_center_old); + BM_face_calc_center_median(oldfaces[i], f_center_old); for (j = 0; j < 2; j++) { BMEdge *e1 = j ? e_new : e; @@ -660,7 +660,7 @@ BMVert *BM_edge_split(BMesh *bm, BMEdge *e, BMVert *v, BMEdge **r_e, float fac) if (BM_ELEM_API_FLAG_TEST(l->f, _FLAG_OVERLAP)) { float f_center[3]; - BM_face_calc_center_mean(l->f, f_center); + BM_face_calc_center_median(l->f, f_center); BM_face_interp_multires_ex( bm, l->f, oldfaces[i], f_center, f_center_old, cd_loop_mdisp_offset); diff --git a/source/blender/bmesh/intern/bmesh_polygon.c b/source/blender/bmesh/intern/bmesh_polygon.c index 9751c2d8aef..1574a2a97c4 100644 --- a/source/blender/bmesh/intern/bmesh_polygon.c +++ b/source/blender/bmesh/intern/bmesh_polygon.c @@ -108,7 +108,7 @@ static float bm_face_calc_poly_normal_vertex_cos( /** * \brief COMPUTE POLY CENTER (BMFace) */ -static void bm_face_calc_poly_center_mean_vertex_cos( +static void bm_face_calc_poly_center_median_vertex_cos( const BMFace *f, float r_cent[3], float const (*vertexCos)[3]) { @@ -585,7 +585,7 @@ void BM_face_calc_center_bounds(const BMFace *f, float r_cent[3]) /** * computes the center of a face, using the mean average */ -void BM_face_calc_center_mean(const BMFace *f, float r_cent[3]) +void BM_face_calc_center_median(const BMFace *f, float r_cent[3]) { const BMLoop *l_iter, *l_first; @@ -602,7 +602,7 @@ void BM_face_calc_center_mean(const BMFace *f, float r_cent[3]) * computes the center of a face, using the mean average * weighted by edge length */ -void BM_face_calc_center_mean_weighted(const BMFace *f, float r_cent[3]) +void BM_face_calc_center_median_weighted(const BMFace *f, float r_cent[3]) { const BMLoop *l_iter; const BMLoop *l_first; @@ -880,7 +880,7 @@ float BM_face_calc_normal_subset(const BMLoop *l_first, const BMLoop *l_last, fl } /* exact same as 'BM_face_calc_normal' but accepts vertex coords */ -void BM_face_calc_center_mean_vcos( +void BM_face_calc_center_median_vcos( const BMesh *bm, const BMFace *f, float r_cent[3], float const (*vertexCos)[3]) { @@ -888,7 +888,7 @@ void BM_face_calc_center_mean_vcos( BLI_assert((bm->elem_index_dirty & BM_VERT) == 0); (void)bm; - bm_face_calc_poly_center_mean_vertex_cos(f, r_cent, vertexCos); + bm_face_calc_poly_center_median_vertex_cos(f, r_cent, vertexCos); } /** @@ -1103,7 +1103,7 @@ void BM_face_triangulate( } if (cd_loop_mdisp_offset != -1) { - BM_face_calc_center_mean(f, f_center); + BM_face_calc_center_median(f, f_center); } /* loop over calculated triangles and create new geometry */ @@ -1175,7 +1175,7 @@ void BM_face_triangulate( if (cd_loop_mdisp_offset != -1) { float f_new_center[3]; - BM_face_calc_center_mean(f_new, f_new_center); + BM_face_calc_center_median(f_new, f_new_center); BM_face_interp_multires_ex(bm, f_new, f, f_new_center, f_center, cd_loop_mdisp_offset); } } diff --git a/source/blender/bmesh/intern/bmesh_polygon.h b/source/blender/bmesh/intern/bmesh_polygon.h index 1d5fb2cc620..e8d7609fc20 100644 --- a/source/blender/bmesh/intern/bmesh_polygon.h +++ b/source/blender/bmesh/intern/bmesh_polygon.h @@ -53,11 +53,11 @@ void BM_face_calc_tangent_edge_diagonal(const BMFace *f, float r_plane[3]) ATTR void BM_face_calc_tangent_vert_diagonal(const BMFace *f, float r_plane[3]) ATTR_NONNULL(); void BM_face_calc_tangent_auto(const BMFace *f, float r_plane[3]) ATTR_NONNULL(); void BM_face_calc_center_bounds(const BMFace *f, float center[3]) ATTR_NONNULL(); -void BM_face_calc_center_mean(const BMFace *f, float center[3]) ATTR_NONNULL(); -void BM_face_calc_center_mean_vcos( +void BM_face_calc_center_median(const BMFace *f, float center[3]) ATTR_NONNULL(); +void BM_face_calc_center_median_vcos( const BMesh *bm, const BMFace *f, float r_cent[3], float const (*vertexCos)[3]) ATTR_NONNULL(); -void BM_face_calc_center_mean_weighted(const BMFace *f, float center[3]) ATTR_NONNULL(); +void BM_face_calc_center_median_weighted(const BMFace *f, float center[3]) ATTR_NONNULL(); void BM_face_calc_bounds_expand(const BMFace *f, float min[3], float max[3]); diff --git a/source/blender/bmesh/intern/bmesh_query.c b/source/blender/bmesh/intern/bmesh_query.c index 78fb28bda2f..b34cfe4120c 100644 --- a/source/blender/bmesh/intern/bmesh_query.c +++ b/source/blender/bmesh/intern/bmesh_query.c @@ -1860,7 +1860,7 @@ float BM_vert_calc_shell_factor_ex(const BMVert *v, const float no[3], const cha * \note quite an obscure function. * used in bmesh operators that have a relative scale options, */ -float BM_vert_calc_mean_tagged_edge_length(const BMVert *v) +float BM_vert_calc_median_tagged_edge_length(const BMVert *v) { BMIter iter; BMEdge *e; diff --git a/source/blender/bmesh/intern/bmesh_query.h b/source/blender/bmesh/intern/bmesh_query.h index 17bf0f38d0c..0572a6c013a 100644 --- a/source/blender/bmesh/intern/bmesh_query.h +++ b/source/blender/bmesh/intern/bmesh_query.h @@ -132,7 +132,7 @@ float BM_vert_calc_edge_angle(const BMVert *v) ATTR_WARN_UNUSED_RESULT ATTR_NO float BM_vert_calc_edge_angle_ex(const BMVert *v, const float fallback) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(); float BM_vert_calc_shell_factor(const BMVert *v) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(); float BM_vert_calc_shell_factor_ex(const BMVert *v, const float no[3], const char hflag) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(); -float BM_vert_calc_mean_tagged_edge_length(const BMVert *v) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(); +float BM_vert_calc_median_tagged_edge_length(const BMVert *v) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(); BMLoop *BM_face_find_shortest_loop(BMFace *f) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(); BMLoop *BM_face_find_longest_loop(BMFace *f) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(); diff --git a/source/blender/bmesh/operators/bmo_normals.c b/source/blender/bmesh/operators/bmo_normals.c index 78094d3279c..212ff315801 100644 --- a/source/blender/bmesh/operators/bmo_normals.c +++ b/source/blender/bmesh/operators/bmo_normals.c @@ -107,7 +107,7 @@ static int recalc_face_normals_find_index(BMesh *bm, BMFace **faces, const int f for (i = 0; i < faces_len; i++) { float f_cent[3]; const float f_area = BM_face_calc_area(faces[i]); - BM_face_calc_center_mean_weighted(faces[i], f_cent); + BM_face_calc_center_median_weighted(faces[i], f_cent); madd_v3_v3fl(cent, f_cent, cent_fac * f_area); cent_area_accum += f_area; diff --git a/source/blender/bmesh/operators/bmo_planar_faces.c b/source/blender/bmesh/operators/bmo_planar_faces.c index a0951455fb4..a6d92301250 100644 --- a/source/blender/bmesh/operators/bmo_planar_faces.c +++ b/source/blender/bmesh/operators/bmo_planar_faces.c @@ -67,7 +67,7 @@ void bmo_planar_faces_exec(BMesh *bm, BMOperator *op) continue; } - BM_face_calc_center_mean_weighted(f, faces_center[i]); + BM_face_calc_center_median_weighted(f, faces_center[i]); l_iter = l_first = BM_FACE_FIRST_LOOP(f); do { @@ -101,7 +101,7 @@ void bmo_planar_faces_exec(BMesh *bm, BMOperator *op) /* keep original face data (else we 'move' the face) */ #if 0 BM_face_normal_update(f); - BM_face_calc_center_mean_weighted(f, f_center); + BM_face_calc_center_median_weighted(f, f_center); #endif plane_from_point_normal_v3(plane, faces_center[i], f->no); diff --git a/source/blender/bmesh/operators/bmo_poke.c b/source/blender/bmesh/operators/bmo_poke.c index 32ad25b7b82..3d9b2edd135 100644 --- a/source/blender/bmesh/operators/bmo_poke.c +++ b/source/blender/bmesh/operators/bmo_poke.c @@ -58,13 +58,13 @@ void bmo_poke_exec(BMesh *bm, BMOperator *op) switch (center_mode) { case BMOP_POKE_MEAN_WEIGHTED: - bm_face_calc_center_fn = BM_face_calc_center_mean_weighted; + bm_face_calc_center_fn = BM_face_calc_center_median_weighted; break; case BMOP_POKE_BOUNDS: bm_face_calc_center_fn = BM_face_calc_center_bounds; break; case BMOP_POKE_MEAN: - bm_face_calc_center_fn = BM_face_calc_center_mean; + bm_face_calc_center_fn = BM_face_calc_center_median; break; default: BLI_assert(0); @@ -94,7 +94,7 @@ void bmo_poke_exec(BMesh *bm, BMOperator *op) copy_v3_v3(f_center_mean, f_center); } else { - BM_face_calc_center_mean(f, f_center_mean); + BM_face_calc_center_median(f, f_center_mean); } } @@ -132,7 +132,7 @@ void bmo_poke_exec(BMesh *bm, BMOperator *op) if (cd_loop_mdisp_offset != -1) { float f_new_center[3]; - BM_face_calc_center_mean(f_new, f_new_center); + BM_face_calc_center_median(f_new, f_new_center); BM_face_interp_multires_ex(bm, f_new, f, f_new_center, f_center, cd_loop_mdisp_offset); } diff --git a/source/blender/bmesh/operators/bmo_similar.c b/source/blender/bmesh/operators/bmo_similar.c index 454d6d8c6c8..e2da05e210e 100644 --- a/source/blender/bmesh/operators/bmo_similar.c +++ b/source/blender/bmesh/operators/bmo_similar.c @@ -155,7 +155,7 @@ void bmo_similar_faces_exec(BMesh *bm, BMOperator *op) case SIMFACE_COPLANAR: /* compute the center of the polygon */ - BM_face_calc_center_mean(f_ext[i].f, f_ext[i].c); + BM_face_calc_center_median(f_ext[i].f, f_ext[i].c); /* compute the plane distance */ f_ext[i].d = dot_v3v3(f_ext[i].f->no, f_ext[i].c); diff --git a/source/blender/bmesh/tools/bmesh_decimate_collapse.c b/source/blender/bmesh/tools/bmesh_decimate_collapse.c index 2faf6b81461..e7e42e4bd01 100644 --- a/source/blender/bmesh/tools/bmesh_decimate_collapse.c +++ b/source/blender/bmesh/tools/bmesh_decimate_collapse.c @@ -100,7 +100,7 @@ static void bm_decim_build_quadrics(BMesh *bm, Quadric *vquadrics) double plane_db[4]; Quadric q; - BM_face_calc_center_mean(f, center); + BM_face_calc_center_median(f, center); copy_v3db_v3fl(plane_db, f->no); plane_db[3] = -dot_v3db_v3fl(plane_db, center); diff --git a/source/blender/bmesh/tools/bmesh_intersect.c b/source/blender/bmesh/tools/bmesh_intersect.c index 6da32f5e874..a5a33c834a6 100644 --- a/source/blender/bmesh/tools/bmesh_intersect.c +++ b/source/blender/bmesh/tools/bmesh_intersect.c @@ -1588,7 +1588,7 @@ bool BM_mesh_intersect( BLI_assert(ELEM(side, 0, 1)); side = !side; - // BM_face_calc_center_mean(f, co); + // BM_face_calc_center_median(f, co); BM_face_calc_point_in_face(f, co); hits = isect_bvhtree_point_v3(tree_pair[side], looptri_coords, co); diff --git a/source/blender/bmesh/tools/bmesh_path.c b/source/blender/bmesh/tools/bmesh_path.c index cc5ac6dd8ce..ab1e0df6cb7 100644 --- a/source/blender/bmesh/tools/bmesh_path.c +++ b/source/blender/bmesh/tools/bmesh_path.c @@ -215,7 +215,7 @@ static float edgetag_cut_cost_face(BMEdge *e_a, BMEdge *e_b, BMFace *f) mid_v3_v3v3(e_a_cent, e_a->v1->co, e_a->v1->co); mid_v3_v3v3(e_b_cent, e_b->v1->co, e_b->v1->co); - BM_face_calc_center_mean_weighted(f, f_cent); + BM_face_calc_center_median_weighted(f, f_cent); return step_cost_3_v3(e_a_cent, e_b_cent, f_cent); } @@ -380,8 +380,8 @@ static float facetag_cut_cost_edge(BMFace *f_a, BMFace *f_b, BMEdge *e, const vo float f_b_cent[3]; float e_cent[3]; - BM_face_calc_center_mean_weighted(f_a, f_a_cent); - BM_face_calc_center_mean_weighted(f_b, f_b_cent); + BM_face_calc_center_median_weighted(f_a, f_a_cent); + BM_face_calc_center_median_weighted(f_b, f_b_cent); #if 0 mid_v3_v3v3(e_cent, e->v1->co, e->v2->co); #else @@ -412,8 +412,8 @@ static float facetag_cut_cost_vert(BMFace *f_a, BMFace *f_b, BMVert *v, const vo float f_a_cent[3]; float f_b_cent[3]; - BM_face_calc_center_mean_weighted(f_a, f_a_cent); - BM_face_calc_center_mean_weighted(f_b, f_b_cent); + BM_face_calc_center_median_weighted(f_a, f_a_cent); + BM_face_calc_center_median_weighted(f_b, f_b_cent); return step_cost_3_v3_ex( f_a_cent, v->co, f_b_cent, diff --git a/source/blender/bmesh/tools/bmesh_wireframe.c b/source/blender/bmesh/tools/bmesh_wireframe.c index 57e0e0b44ca..22ba5a742cb 100644 --- a/source/blender/bmesh/tools/bmesh_wireframe.c +++ b/source/blender/bmesh/tools/bmesh_wireframe.c @@ -269,7 +269,7 @@ void BM_mesh_wireframe( if (verts_relfac) { if (use_relative_offset) { - verts_relfac[i] = BM_vert_calc_mean_tagged_edge_length(v_src); + verts_relfac[i] = BM_vert_calc_median_tagged_edge_length(v_src); } else { verts_relfac[i] = 1.0f; @@ -315,7 +315,7 @@ void BM_mesh_wireframe( verts_pos[i] = NULL; } - /* conflicts with BM_vert_calc_mean_tagged_edge_length */ + /* conflicts with BM_vert_calc_median_tagged_edge_length */ if (use_relative_offset == false) { BM_elem_flag_disable(v_src, BM_ELEM_TAG); } |