Age | Commit message (Collapse) | Author |
|
|
|
Needed a better normal to for plane to offset into when there are
non in-plane edges between two beveled edges. It was using the vertex
normal, which is just wrong.
Differential Revision: https://developer.blender.org/D9508
|
|
|
|
|
|
This makes debugging slightly easier, and makes the code slightly more
explicit about its intentions.
|
|
In some situations where two beveled edges were very close to in-line
but not quite straight, bevel would build a miter when it shouldn't.
The code that chose whether to use a miter at each vertex was slightly
incorrect.
For outer miters there is a check for 3 or more selected edges, but an
inner miter can still be useful with only two beveled edges at a vertex,
so we can't use that here. Instead I changed the check for in-line edges
to run before determining whether the angle is reflex or not. The logic
ends up a bit more straightforward as well. This doesn't completely
remove the rather strange looking triangle vertex meshes at each corner,
but it does make it stable when locations are slightly adjusted.
The only other place this `edges_angle_kind` function was used is for
profile=1.0 vertex meshes. I tested and made sure that still works well.
Differential Revision: https://developer.blender.org/D9420
|
|
The previous fix forgot the case where there is an intermediate
edge and everything isn't in one plane.
Differential Revision: https://developer.blender.org/D9336
|
|
|
|
|
|
The code for Bevel's percent (and absolute) modes were pretty bogus.
It assumed, like the rest of the modes, that the offset lines are
parallel to the beveled edge. Which is not true for these modes,
though it accidentally works sometimes if the legs are equilength.
Also the clamping code for those modes was completey wrong.
It is too hard to really fix the clamping code for absolute mode,
but it is a little better now. Percent mode clamping is fixed.
|
|
Check the simpler case first and return early.
|
|
|
|
|
|
Exit early if the bevel width is zero instead of putting
the main function in an if statement.
|
|
This commit generally moves variable declarations to the smallest scope
the variables are used in. This makes the code more readable by
making it clearer when variables are used and by removing the block
of variable declarations at the top of each function.
|
|
|
|
Also order sizeof(..) first to promote other values to size_t.
|
|
|
|
|
|
Previously a for loop with two iterations was used to calculate the
3D segment locations for the input number and the higher power of 2.
Splitting off the inside of the for loop to a separate function makes
the code more readable.
This commit also includes a simple timer for bevel, enabled with a
define. Interestingly, the cleanup in this commit happended to give
a 3% speedup on a Ryzen 3700x for a bevel calculation with 64
segments.
|
|
|
|
The bevel code initialized the CurveProfile with the "higher power of 2"
segments after the normal number of segments, leaving the widget in an
incorrect state after the calculation. A simple fix is to re-order the
initializations, doing the input number second.
|
|
|
|
The abbreviation 'init' is brief, unambiguous and already used
in thousands of places, also initialize is often accidentally
written with British spelling.
|
|
New code to calculate UV islands made an incorrect assumption about
maximum stack size.
|
|
New code to calculate UV islands made an incorrect assumption about
the maximum size of a stack.
|
|
This matches the change that was done to the bevel modifier so that the
interface for the modifier, the active tool, and the operator are consistent.
This commit extends the refactor to the bmesh implementation too, so
that the parameters in the implementation don't stray too far from what
is exposed.
Tests are adjusted and still pass.
|
|
A bug introduced when I made the choice of interpolation face cleverer.
|
|
|
|
|
|
This addresses warnings from Clang-Tidy's `readability-else-after-return`
rule in the `source/blender/bmesh` module.
No functional changes.
|
|
|
|
|
|
Thanks Howard for double-checking!
|
|
|
|
When there is an odd number of segments, bevel has an ambiguous
choice as to which side face to use to copy face attributes from
and to use for UV (and other loops that have math function) interpolation.
We used to make choice arbitrarily, which led to visually inconsistent
results. Now there is tie-breaking code, face with lexicographic lowest
value in vector with these elements:
(1) connected component (in math-layer space) id
(2) selected (0) vs unselected (1)
(3) material index
(4,5,6): z,x,y components of face center, in that order.
|
|
|
|
This will allow the easier addition of a constant radius mode in the
future and some changes in the UI to mirror the recent similar change
from "Only Vertices" to the "Affect" enum.
|
|
This mode is like Percent, but measures absolute distance along
adjacent edges instead of a percentage.
So, for example, if you use this mode with 2 segments and profile=1,
you will see the length that the bevel moves along unbeveled edges
between beveled ones will match the value specified.
Many users seem to expect this behavior, even though it means the
bevel width is uneven, so this option is for them.
|
|
This is related to T76659.
This just renames data type names to `CD_PROP_STRING`, `CD_PROP_FLOAT`
and `CD_PROP_INT32`. It makes them a bit more specific and removes
unnecessary abbreviations.
Reviewers: brecht
Differential Revision: https://developer.blender.org/D7980
|
|
|
|
Don't use the cube corner special case when the offsets are different
for the three edges involved. The generic VMesh for this situation isn't
perfect, but it's much better than a failed cube corner VMesh.
Tests pass.
|
|
|
|
|
|
|
|
|
|
- Use 'BKE_object_defgroup' prefix for object functions.
- Rename 'defvert_verify_index' to 'defvert_ensure_index'
since this adds the group if it isn't found.
|
|
When beveling architectural objects like baseboards or crown mouldings that
may consist of multiple islands, it's useful if the orientation is at least
conistent.
This changes the arbitrary decision of how the orientation should start at a
chain beginning to use the highest side of the profile in the Z direction.
Reviewed By: howardt
Differential Revision: https://developer.blender.org/D6946
|
|
Also changed signature of bevel function to take integer
for segments instead of float, which is just wrong.
|
|
|