Commit Graph

145 Commits

Author SHA1 Message Date
09e40a4956 Cleanup: spelling 2015-09-14 02:22:22 +10:00
04e12c617d Fix T46029. Center ngon in bevel got no attributes or interpolation data. 2015-09-07 09:33:42 -03:00
Julian Eisel
ef629e0d50 Quiet warnings
We had too many warnings lately... was awaiting that someone would kill them - didn't happen -> goes to my commit ratio! :P
2015-09-04 01:04:37 +02:00
96fa58e22c Math Lib: Add closest_to_plane helper functions
- closest_to_plane3 (for float3 planes)
- closest_to_plane*_normalized_v3 (for unit length planes)

Use when the plane is known to be unit length
2015-08-31 20:10:36 +10:00
58c9a0b11a Cleanup: spelling 2015-08-22 21:17:32 +10:00
7c352ed43a Cleanup: style + doxy 2015-08-19 08:49:12 +10:00
0c420a2e49 Fix T39486, screwed object bevel made bevel amount go out of control.
There is an adjustment pass in bevel that tries to make the bevel
widths at either end of a beveled edge as equal as possible.
When there are hundreds of beveled edges end-to-end, these adjustments
can accumulate out of control and result looks awful.
Yet the adjustment pass is sometimes needed to avoid equally awful
appearances in other cases (see the "Bent test" in the bevel regression
tests).
This change uses the 'Clamp overlap' flag of bevel (on by default in
the modifier, not in the tool) to limit the amount of adjustment to within
10% of the desired width. When the flag is off, there is no limit to the
adjustment.
2015-08-16 15:15:13 -04:00
9b43fce3c1 Fix T45795, bevel treated one-edge-beveled case inconsistently.
When one edge is beveled at a vertex among more than 1 other unbeveled
edges, the code makes a polygon around the vertex. The position of the
vertices on the non-adjacent-to-beveled-edge edges depended on the
ordering of edges, which leads to inconsistent-looking results in seeming
symmetrical situations.  Changed to use the bevel amount as slide
distance, which fixes this.
2015-08-16 11:13:53 -04:00
fa86efdc97 Fix T40070, Bevel didn't bend as expected sometimes.
Two problems fixed. One, the comparison of angles to
'almost straight' or 'almost zero' needed a bigger epsilon.
Two, using the corner normal instead of the average face normal
is usually the right thing to do, and what the code was doing,
but in some cases the corner normal could be very wrong.
2015-08-14 15:51:27 -04:00
a662980f31 Remove already-ifdef'ed out PRE_275_ALGORITHM code from bevel.
The new algorithm has soaked enough that we are unlikely to go back now.
2015-08-14 09:46:49 -04:00
8b286bf35a Cleanup: style 2015-08-14 17:46:26 +10:00
39ce0a9916 Fix T44049, edge bevel with sometimes breaks UVs.
Fairly large changes to bevel code to do a better job
of keeping UVs from crossing islands, etc.
Updated http://wiki.blender.org/index.php/Dev:2.5/Source/Modeling/Bevel
to explain algorithm used for maintaining UVs.
Updated the bevel_regression.blend tests in lib tests.
2015-08-12 10:18:58 -04:00
e301cf3ec2 Cleanup: double-promotion warnings 2015-07-25 13:26:20 +10:00
791b5fe9d0 Fix T45331, a bevel regression for 2.75.
Got bad results when two beveled edges form straight line
and there are two or more unbeveled edges attached to either
side of the connecting vertex.
2015-07-06 13:27:01 -04:00
12aff8d783 Add 'loop slide' option to bevel. See T45260
Current behavior of bevel is to 'loop slide' along unbeveled edges
when possible, but this produces uneven bevel widths sometimes,
so this option lets user choose between having the loop slide effect
or having more even bevel widths. Trying it out with default being
'no loop slide', so different from current behavior. May reverse this
choice later, depending on user reactions.
2015-07-05 09:53:17 -04:00
50a1ad5bb3 Cleanup 2015-06-06 21:02:16 +10:00
68cdd2b361 Fix T44961, bevel spikes out when certain angles near 180.
Made the test for whether one can "see" an adjacent edge less
knife-close to 180. This means it will chose to slide along
such an edge less often, and avoid some spikes.
2015-06-05 13:00:41 -04:00
896f08bde8 Fix T41177. Bevel shouldn't try to slide along edge when can't see it. 2015-06-03 15:19:48 -04:00
fd1ea5e3db Fix T44742. Bevel now avoids vertex meshes when only two edges are beveled.
Also, changed the algorithm for generating the vertex meshes when not all
edges into a vertex are beveled. Now it tries to slide along edges that
form part of the silhouette when possible; when not possible, it tries
to snap to the best plane in between the beveled edges.
2015-06-02 09:25:05 -04:00
89f5a09ab4 Cleanup: use 8 space indent for multi-line args 2015-04-25 20:15:20 +10:00
690b90f1e2 BMesh: minor optimization counting adjacent data
add BM_***_count_is_over(), _count_is_equal()

Useful if we only want to know if the count is a smaller value.
2015-04-12 17:38:14 +10:00
d49eeabae7 Cleanup: warnings 2015-03-16 09:37:00 +11:00
2140cb60cb Fix T39184: Multisegment bevel profiles should curve in-plane sometimes.
When the multisegment profile joins two unbeveled edges, all in the same
plane, users desire that rather than the current behavior of linear
interpolation between those edges, the profile should curve.
This changes behavior to do that.  The old behavior can be obtained
by setting the profile parameter to 0.25, if desired.
2015-03-15 18:24:36 -04:00
a7d292394e Fix T43898, correct all uv layers in bevel, not only the active one 2015-03-05 18:50:44 +01:00
dce59530d0 Fix part 1 of T43239, multisegment vertex bevel on 2-edge vertices.
Implemented multisegment rounding of vertices with two edges.
Works both with wire edges and edges that have one or two faces
attached.
2015-02-12 06:55:30 -05:00
d4934f8f6d cleanup: style/indentation 2015-02-11 18:39:28 +11:00
9fadacfd0f cleanup: style 2015-01-08 19:57:50 +11:00
bf168f0600 Fix T43137: vertex bevel percent mode wasn't implemented. 2015-01-06 09:13:38 -05:00
25c5542fe7 Math Lib: add constant: M_SQRT1_3 1/sqrt(3) 2014-11-22 18:21:52 +01:00
133f79e449 Cleanup: warnings, typos 2014-10-29 14:15:21 +01:00
8d1d16bf0d Bevel modifier: Add weight support for vertices bevelling.
Nothing to say here, really, just a couple of lines to add to get it working...
2014-10-15 08:57:11 +02:00
eadfddd02a Cleanup: magic numbers 2014-08-12 15:58:53 +10:00
13a8f650df Cleanup 2014-07-21 10:53:07 +10:00
70453c578d Fix T34664: bevel face material can be set in tool and modifier.
Now the bevel tool, modifier, and internal operator have a material
slot # parameter that the user can set. If left at default of -1,
behavior is as current -- bevel face material is taken from the
closest original face (this may be ambiguous). If material slot
is >= 0, it gives the material slot index number for the material
to use.
2014-07-17 09:20:22 -04:00
3b81aae5c1 BMesh: avoid redundant normalize comparing angles 2014-07-14 14:22:15 +10:00
b5213b2dea Fix T40007 Bevel tool resets after getting to 1.
If the side of a beveled edge hit another vertex, the offset
amount reset to zero. This was the result of commit rB1582dd5e4d7c
which clamped the amount to zero to avoid creating spikes with
obtuse angles. Now we clamp the amount to the closest end of
the edge to where the amount wants to be.
Also fixes the first part of T40365.
2014-06-14 17:47:44 -04:00
d6287b213b BLI_gsqueue: use size_t for elem_size (was casting all over) 2014-06-15 03:49:25 +10:00
9f0466fb6b Quiet double promotion warning & ws edit 2014-06-13 02:22:40 +10:00
8c2b5ffb11 Fix Bevel bug T39746, small scale gives flat profile.
With very small meshes or very small bevel amounts, the bevel
profile would be flat even if a round one was requested.
Problem was that the code was checking the length of a cross
product for closeness to zero to test coplanarity. Needed
to normalize things before making that test to account for scale.
2014-06-12 10:22:10 -04:00
84767a29f1 Fix Bevel multisegment profile bugs T39184, T37502 and last part of T40365.
When doing a 'weld' type join where there are two non-beveled edges
in the same plane one beveled one but not the other, then there
should be a curved profile; bug was creating a straight one.
2014-06-10 11:21:52 -04:00
d504b325fb Fix T37618 Bevel mismatched offsets and bad profile plane.
Used a different technique to resolve "impossible" offset cases
that makes more consistency. Also changed the plane in which
the profile lies for the case with only one beveled edge and
more than 3 other edges.
2014-05-30 16:07:45 -04:00
6bde9a52f9 Fix T39174 Bevel didn't maintain edge attributes.
When rebuilding the polygons that touch bevel-involved vertices,
need to copy the edge attributes from corresponding original edges.
Special treatment of corner segments, to maintain continuity of
smooth and seam attributes.
Another fix: if have four meeting edges, two opposite ones beveled
and the other two not, propgate the non-beveled-edges attributes
across the line that joins them (perpendicular to the bevel).
2014-05-29 07:32:16 -04:00
d9dd29054f Style cleanup 2014-05-20 00:11:16 +10:00
758bdcd6c2 Fix Bevel bugs T39726 and T39108, bevels with wire edges.
This updates the fix in rB27db75363, which had to be undone
because it broke other bevels.
It also fixes cases where edges went away went doing vertex
bevel on vertices with some wire edges.
2014-05-16 10:28:15 -04:00
a197d02b03 Fix T39939: Undo change of rB27db75363e67, which broke bevel.
The test for wire edges when reattaching was wrong, because
some newly made edges are wire at the point of the test.
This made some duplicate edges.
Need to track the original wire edges a different way.
2014-04-28 18:41:33 -04:00
fdcb9fcb7e Bevel: Avoid sqrt comparing lengths 2014-04-29 00:35:32 +10:00
27db75363e Fix T39726: wire edges cause bevel artifacts.
Now code explicity excludes wire edges from beveling
and reattaches the wire edges to one of the newly
created vertices after beveling.
Also fixes a bug where vertex-beveling a wire-edge-only
vertex would not reattach the wire edges.
2014-04-28 09:07:47 -04:00
d7d2e71a03 Correct some errors in auto-cleanup 2014-04-27 22:02:59 +10:00
88a0fe5f1b Code cleanup: use 'const' for arrays (bmesh) 2014-04-27 00:25:16 +10:00
617557b08e Code cleanup: remove TRUE/FALSE & WITH_BOOL_COMPAT define 2014-04-01 15:22:28 +11:00