Commit Graph

372 Commits

Author SHA1 Message Date
412826a504 Mempool: delay allocating an initial chunk, its not always used 2014-04-08 12:58:56 +10:00
af59ee340f Mempool: remove BLI_MEMPOOL_SYSMALLOC, MEM_* allocs are more efficient now 2014-04-05 12:14:05 +11:00
617557b08e Code cleanup: remove TRUE/FALSE & WITH_BOOL_COMPAT define 2014-04-01 15:22:28 +11:00
b0a8e4ced1 Fix T39262: Regression in 2.70, wire-frame editmode tool replaced all 2014-03-25 07:53:09 +11:00
25835ec977 Fix possible use of invalid face index with wireframe tool 2014-03-25 07:53:09 +11:00
d08e6ab279 Fix T39215: Shortest path error 2014-03-17 03:42:03 +11:00
3d031d1f3a BMesh: minor changes for BM_face_split use 2014-03-13 18:41:45 +11:00
df3116b326 Fix for un-subdivide creating duplicate faces 2014-03-06 01:00:18 +11:00
37ef7f3537 Fix T38936 Bevel strange flickering on big meshes.
Last change to bevel had a check for what was supposed
to be an "on edge" new vertex being off the edge.
The test tolerance was too small. This fixes that.
2014-03-04 09:31:20 -05:00
1582dd5e4d Partial fix for T38871, Bevel could create a far-out spike.
There needed to be a check that when a newly created point is
supposed to be on an edge, that it stays within the bounds
of either end of the edge.
This fixes the hole-in-cube example in the bug, but not
the boolean modifier one, which still needs more work.
2014-02-28 13:56:17 -05:00
d3b9457991 Code cleanup: style/warnings 2014-02-28 11:04:15 +11:00
6de3a8a4fe Bevel fix for T38675, bad bevel on slanted L.
The test for a reflex angle used the vertex normal,
which was not a good test for a saddle point vertex.
Switched to using the face normal, if available, for that test.
Also added test for this in svn bevel_regression.blend.
2014-02-17 11:43:31 -05:00
68521841a8 Bevel: remove unused assignments.
Caught by coverity.
2014-02-03 09:53:27 -05:00
d900f5be55 Code cleanup: use bools where possible 2014-02-03 19:35:44 +11:00
1dc1d92dab Code cleanup: white space and cmake was broken on all platforms 2014-02-03 13:56:34 +11:00
39202a53b5 Bevel: fix glitch in "pipe" case with square profile.
The "pipe" case -- where two beveled edges are in line
and there is at least one more beveled edge -- needed better
handling when profile parameter = 1.0 (square outward).
2014-01-28 13:20:42 -05:00
37f1b717eb Bevel code cleanup: get rid of old 'ADJ' code.
The new subdiv 'adj' pattern is working well, so removing the
old code and taking opportunity to remove 'subdiv' from a number
of names.
2014-01-28 07:03:25 -05:00
a5c35fb27f Code cleanup: use booleans where appropriate 2014-01-28 04:00:04 +11:00
1c29fd77d3 Code Cleanup: style and correct API class ref 2014-01-26 22:17:01 +11:00
01c1790a11 Make multisegment bevel profiles even for all parameters.
The method for calculating points on the profile for non-circles
and non-lines meant that the segments making up an edge had
uneven widths.
Use a numeric search technique to find superellipse evaluation
points that lead to equal-sized chords across the profile.
Also calculate the actual profile points sooner, so that they
don't have to be recalculated again and again.
This also sets up for a possible later feature of arbitrary
profile shapes, set by user.
2014-01-24 10:07:24 -05:00
4ae7ae6f2e Code Cleanup: use bool for return values and correct comments
also remove CDDM_Check, theres no need for it.
2014-01-22 02:53:48 +11:00
7acb7cb897 Replace XOR swapping by default ("naive", with extra var) one.
Ref: http://en.wikipedia.org/wiki/XOR_swap_algorithm, modern compilers/CPUs are much more efficient with "naive" algo than XOR one.
Doubled check, for me in an optimized build, XOR is several times slower than naive algo.
2014-01-21 15:50:44 +01:00
45b9822259 Fix T38300: Bevel didn't always reconstruct faces properly.
With new subdivision method for making the vertex mesh, we always
subdivide the edges between the new vertices around a vertex
(we used to not subdivide edges between two non-beveled edges).
This fixes a bug related to this change.
2014-01-21 09:02:27 -05:00
37242e6b0b Code Cleanup: style 2014-01-21 12:05:27 +11:00
a502959e4b Bevel: fixed problems with vertex bevel and some 'weld' cases.
Vertex bevel was completely messed up after last change,
and this fixes.
'Weld' bevels, where there are exactly two beveled edges
meeting at a vertex, now look better in cases where one
of the beveled edges is on a flat plane.
2014-01-20 08:55:07 -05:00
621bf47e91 Docs: doxygen file descriptions for BLF, GPU and WM 2014-01-19 23:15:25 +11:00
63ccb26303 Code Cleanup: spelling 2014-01-17 17:35:03 +11:00
af93ebcb50 Code Cleanup: style and redundant casts 2014-01-16 19:15:53 +11:00
bb1a7e4d87 Code Cleanup: simplify matcaps checks and quiet warning 2014-01-16 18:32:57 +11:00
e5c7535beb Code Cleanup: float/double promotions 2014-01-15 13:40:40 +11:00
c5d3abc863 Bevel fix to clamping for percent type.
The clamp code is still very crude and over-conservative,
but was totally wrong for the percent amount type.
2014-01-14 11:21:56 -05:00
61ff3dfdda Code Cleanup: spelling 2014-01-13 15:31:57 +11:00
c925b5bbb2 Bevel fixes for profiles: better way to calculate.
It is better to keep the profile as it is perpedicular
to the edge, and then project it onto a given plane
at the corners. Also fixed the interpolation to a
different number of segments when the profile is not
round.
2014-01-12 14:10:39 -05:00
62aa004c25 Style Cleanup: whitespace 2014-01-12 22:05:24 +11:00
e47a41e3fc Code Cleanup: style 2014-01-09 11:44:59 +11:00
8305fd8841 Code Cleanup: style edits to bevel and remove unneeded boundvert_rep_face call 2014-01-09 00:50:32 +11:00
49aa701645 Add profile control parameter to Bevel.
Parameter controls concavity / convexity.
    <.25 means: concave inward
    .25 means: straight slanted
    >.25 means: concave outward
    .5 means: circular (the default)
    1 means: straight along original sides
For now, there is a hard lower limit of .15
because more work is needed to get decent
results in the range below that.

The profile is actually a superellipse, and the
parameter is 1/4 of the exponent in the implicit equation
for a superellipse, except at the extreme values of 0 and 1.
2014-01-08 07:40:01 -05:00
e164a500c8 Fix to own previous commit for bevel vertex only case.
In separating out the adj mesh change from a profile change,
I'd forgotten that some profiles need to be flat (in particular,
for vertex-only bevels). This fixes that.
2014-01-06 15:53:22 -05:00
bdd20e18ef Bevel: use stack memory for interp_vmesh()
Rather then using the memarena and never freeing.
2014-01-07 03:17:32 +11:00
e0a4a4afc3 Bevel: change 'adj' pattern to use subdivision.
This gets rid of a hacky way of setting the mesh
coordinates at corners, which created overlaps
in some cases.
Also, special case a cube-like corner with all
edges beveled, to snap to a sphere, giving more
expected curvature in that case.
2014-01-06 10:52:31 -05: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
1500d9962c error in recent commit (this is getting ridiculous),
faces were flipping the wrong way
2013-12-22 07:27:07 +11:00
01acc2a7dc EditMesh: wireframe tool, add offset and vgroup support (not used yet) 2013-12-22 06:54:37 +11:00
da91575206 Bevel: add width consistency pass.
When the desired widths (offsets) of beveled edges cannot be
satisfied, often because we want them to meet on an intermediate
non-beveled edge, we need to compromise on the widths somehow.
This code changes the compromise to minimize the sum of squares
of errors in the offsets.  It also adds a global width consistency
pass: starting from a vertex that needed width adjustment, it
uses a breadth-first search to try to propagate the adjustments
and keep the bevel widths from having to taper along the edges.

Also fixed a case where a reflex angle would cause bad results.
Also fixed the way the 'percentage' width method was calculated.
2013-12-02 07:24:22 -05:00
c33fb00c28 Fix for triangulate and beauty-fill
- could crash if triangulate attempted to create an existing face.

- tagging edges to rotate was unreliable, don't do this anymore.
  now check if edge is in the array passed to the beauty function.
2013-12-02 11:49:18 +11:00
3f5b59cd90 Fix T37121: decimate works badly with flat surfaces 2013-11-27 11:26:19 +11:00
d4a11388bf Code Cleanup: warnings 2013-11-22 11:30:40 +11:00
1158c1f7c0 Bevel Fix for nonplanar faces / reflex angles
When beveling two adjacent edges, code used face normal instead
of the face-corner normal (these can be different for nonplanar
faces); the bevel may look uneven in such cases.
Switched to using corner normal, and needed to fix the case
where the edges meet at a reflex angle. Fixed a similar case
when beveling two edges with one non-beveled in between.
Also removed unnecessary argument from offset_meet.
2013-11-20 07:18:18 -05:00
bea9c3ab30 Fix T36998: Bisect would operate on unselected vertices. 2013-11-19 07:00:18 +11:00
8f7f8d679c Style Cleanup: whitespace 2013-11-17 22:00:57 +11:00