Commit Graph

36 Commits

Author SHA1 Message Date
2a14ab998a Fix T87259: Un-Subdivide creates duplicate faces
Add argument to BM_vert_collapse_faces to remove any faces that become
duplicate as result of the collapse.
2021-04-12 14:24:09 +10:00
8f30a88e63 Cleanup: Grammar: "Allow to" vs gerund
In cases where "Allow" is followed by an infinitive, a noun needs
to directly follow it. But it makes more sense to follow it with a
gerund instead.
2020-11-18 16:14:48 -05:00
2115232a16 Cleanup: Clang-Tidy readability-inconsistent-declaration-parameter-name fix
No functional changes
2020-09-04 21:04:16 +02:00
91694b9b58 Code Style: use "#pragma once" in source directory
This replaces header include guards with `#pragma once`.
A couple of include guards are not removed yet (e.g. `__RNA_TYPES_H__`),
because they are used in other places.

This patch has been generated by P1561 followed by `make format`.

Differential Revision: https://developer.blender.org/D8466
2020-08-07 09:50:34 +02:00
545610d3aa Cleanup: un-wrap lines in headers, use doxy comments 2019-06-26 12:44:22 +10:00
e12c08e8d1 ClangFormat: apply to source, most of intern
Apply clang format as proposed in T53211.

For details on usage and instructions for migrating branches
without conflicts, see:

https://wiki.blender.org/wiki/Tools/ClangFormat
2019-04-17 06:21:24 +02:00
dbc058301b Cleanup: trailing commas 2019-04-16 16:40:47 +02:00
ef04513925 BMesh: utility function to swap edge verts
Needed so we can control the winding of extruded faces.
2019-03-13 19:12:26 +11:00
de13d0a80c doxygen: add newline after \file
While \file doesn't need an argument, it can't have another doxy
command after it.
2019-02-18 08:22:12 +11:00
eef4077f18 Cleanup: remove redundant doxygen \file argument
Move \ingroup onto same line to be more compact and
make it clear the file is in the group.
2019-02-06 15:45:22 +11:00
65ec7ec524 Cleanup: remove redundant, invalid info from headers
BF-admins agree to remove header information that isn't useful,
to reduce noise.

- BEGIN/END license blocks

  Developers should add non license comments as separate comment blocks.
  No need for separator text.

- Contributors

  This is often invalid, outdated or misleading
  especially when splitting files.

  It's more useful to git-blame to find out who has developed the code.

See P901 for script to perform these edits.
2019-02-02 01:36:28 +11:00
6521307dcd BMesh: rename cryptic functions
Use expanded names for bmesh primitive operations
(urmv jvke semv jfke).

Use 'bmesh_kernel_' prefix,
these functions aren't intended for wide use so favor readability.

Remove BM_face_vert_separate,
it wasn't used and only skipped step of finding correct loop of face.
2017-03-13 04:39:20 +11:00
7fd2efa507 BMesh: Minor improvement to face-join
Pass in loops instead of edge & faces.
Nearly all callers have the loop-pairs to pass in.
2016-11-12 10:30:32 +11:00
aaa56782d3 BMesh: move BM_face_split_edgenet to its own file
Isolate edge-net splitting in preparation for other functions to be added here.
2015-12-09 16:24:52 +11:00
9c044b4773 BMesh: new API call to collapse an edge
Existing collapse functions were strict regarding the number of verts sharing an edge.
BM_edge_collapse allows any edge to be passed in without first having to manipulate geometry.
2015-11-19 22:52:17 +11:00
3ef27ec807 BMesh: add BM_face_loop_separate_multi
New utility function to handle splitting off multiple loops from a face at once.
2015-04-30 06:24:33 +10:00
89f5a09ab4 Cleanup: use 8 space indent for multi-line args 2015-04-25 20:15:20 +10:00
48abc65c39 BMesh: new face splitting function BM_face_split_edgenet
This takes a face and an edge-net, splitting the face into regions
defined by the edge-net.
2014-07-11 10:29:53 +10:00
c3deb16c16 BMesh: add ability not to delete vertex when collapsing 2014-06-27 20:28:02 +10:00
04a902965e BMesh optimize face splitting by taking loops rather then verts
- add BM_vert_pair_share_face
- add BM_loop_is_adjacent
- remove BM_verts_connect
2013-12-24 11:13:58 +11:00
aa0caa448e utility bmesh functions, for edge loop creation, optionally pass array BM_edge_split_n() to get verts created. 2013-05-22 06:00:26 +00:00
347e2b6cb0 code cleanup: make bmesh var names more consistent 2013-03-09 17:12:24 +00:00
b27854bd47 use booleans for bmesh api. 2013-01-14 16:42:43 +00:00
ee96cde864 style cleanup: whitespace 2012-08-26 11:35:43 +00:00
792f536b36 code cleanup: better use of BLI_array_* (grow in larger steps where possible), include BMO_iter_new in for loops. 2012-04-23 02:17:57 +00:00
16ff7e40e6 code cleanup: change C naming convention (so py and C api match), eg:
C: BM_face_calc_area(f), Py: BMFace.calc_area()
2012-04-23 01:19:50 +00:00
b40476455e code cleanup: remove unused BMesh args. 2012-04-19 14:38:09 +00:00
1635d8e873 add option not to delete edges/verts when joining faces, needed so we can loop over edges and join them without having to check if they have been removed. 2012-04-04 14:48:10 +00:00
4f7bdc59d3 style cleanup: spelling.
also remove large, duplicate comments from sunsky.h
2012-03-09 00:41:09 +00:00
c82c456247 bmesh py api, new functions:
* bmesh.utils.face_vert_rip(f, v)
* bmesh.utils.loop_rip(l)
2012-03-08 20:00:37 +00:00
d1937de1d2 fix for own error in edge-rotate keeping edge customdata - this was crashing when rotating multiple edges.
Now create the rotate edge in advance and copy its customdata (before joining the faces).

This commit also fixes an annoyance where tryangulating faces could create duplicate edges.
2012-03-06 19:29:05 +00:00
d87f08cbaa Add BM_face_split_n which splits a face with intermediate points with given coordinates.
This will be used in soon-to-be-commited knife tool rewrite.
Interpolates using the original face.
Also fixed or improved a couple of comments.
2012-03-06 12:09:35 +00:00
4b940364a1 edge rotate now keeps edge properties (like seam, crease, bevel weight.. etc) 2012-03-05 01:53:30 +00:00
4d84e869a0 Improvements to bmesh edge rotate
On a user level, edge rotate now works better with multiple edges selected, it wont make zero area faces or rotate edges into existing ones.

With a single edge selected - rotate is less strict and will allow ugly resulting faces but still checks on duplicate edges.

API:
* BM_edge_rotate now takes a flag, to optionally...
** check for existing edge
** splice edge (rotate and merge)
** check for degenerate resulting faces (overlapping geometry, zero area)
** beauty - only rotate to a better fit.
... this allows it to still be used as a low level API function since all checks can be skipped.

* BM_edge_rotate() now works a bit different, it find the new edge rotation before joining the faces - exposed by BM_edge_rotate_calc().

* Added api call bmesh_radial_faceloop_find_vert() - Radial Find a Vertex Loop in Face
2012-03-05 00:50:18 +00:00
9c18ade898 bmesh edge rotate
* improve check to see if edge rotate can be done,
  was checking if both edges verts have an edge count of 2, which is really a meaningless test since the verts can have stray edges connected and the result wont work right.
  instead check if the next verts in both faces share a vertex.

* add utility function BM_face_other_vert_loop() which gets the next loop in a face.
* add convenience function BM_edge_face_pair() which returns 2 faces for edges that have exactly 2 face users. (saves ugly e->l->radial_next ... in code) and is more readable.
2012-03-03 12:35:37 +00:00
d1d11bbe9b more header re-arranging.
Some function comments were in headers, some in the C files, some in both.
Moved function comments from headers into the C files.
2012-02-28 18:28:30 +00:00