Commit Graph

88 Commits

Author SHA1 Message Date
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
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
49208a3419 Cleanup: shadow warning, style 2019-01-21 10:05:58 +11:00
b640fd829e Add miter pattern options.
Will document the new options in release notes, then in manual.
Still a bit of work to do on the bulging shape that appears
on cube corners if using arc inner miters, but will do that later.
Also need to do something smarter in clamp overlap.
2019-01-18 12:54:10 -05:00
496f6adce2 Better bevel normal hardening when some faces were smooth.
Harden normals causes normal splitting, which will not give the
appearance expected due to autosmooth unless some edges are sharpened,
so this change fixes that. Also bevel tool will turn on autosmooth
if not already on if hardening normals.
2019-01-06 18:12:00 -05:00
aef01c47e6 Fix T58113 Multiple problems with bevel harden normals.
Move the bevel hardening code all into bmesh_bevel.c.
Based on user feedback, rewrote the bevel hardening algorithm
to be more what users want.
Based on user feedback, changed the UI, removing some
not-useful options. Now hardening normals while beveling
is enabled by a simple checkbox.
Now setting face strength gives options for which faces
get their face strength set.
2019-01-03 13:39:52 -05:00
365a5b75c1 Partial fix for T57868, crash when using bevel from Python.
These changes are necessary. Need to mark vertices of edges passed
in geom; also the normals.out slot has a custom element type, not
ELEM, so need to prevent attempt by python code to convert it to
an elem.  But this leaves a memory leak. I will rework code to not
use normals.out slot at all, but that's a bigger fix.

Now there is a crash in a different place (GPU code). Think that if
using Op on its own (instead of from edbm_bevel_calc, there needs to
be a dependency graph update and maybe more?
2018-11-27 09:59:03 -05:00
eb7b450c0c Cleanup: style 2018-08-10 08:14:22 +10:00
c41ce58fde Fix indentation, spacing and added comments 2018-08-05 08:39:20 +05:30
7db1db72bb Fixed hnmode not being passed with bevel tool 2018-08-04 22:32:28 +05:30
0c6410ec0c Added ability to harden normals.
Uses 2 different params: mode and strength. There are still some
hiccups with how 2.8 interacts with normals. Will resolve as
support gets better
2018-06-11 11:58:26 +05:30
2903146826 Added UI support for seams and sharp edges and cleanup 2018-06-04 15:13:54 +05:30
ed84388e7d Bevel Op (internal and API) now returns new edges and verts as well as
faces.

This was requested by script writers. Especially needed if beveling
wire edges with vertex_only.
Should be backward compatible as just adds two new keys to returned
dict in python ('edges' and 'verts').
2017-06-07 08:53:10 -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
a62b806d70 Fix T42145: EditMesh Bevel tools had no clamping option.
Missing feature already present in Bevel modifier, useful and rather simple to add.
2014-10-08 16:42:41 +02: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
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
bfb9cefccb Added options for how bevel amount is measured.
Now there is an 'Offset Type' dropdown on tool
shelf with types:
Offset - current method, offset of new edge
  from old along sliding face
Width - width of new bevel face (if segments=1)
Depth - amount a chamfering plane moves down
  from original edge
Percent - percent of way sliding edges move
  along their adjacent edges

The different options mainly are useful when
beveling more than one edge at once.

Leaving as a TODO to put these in the modifier,
as doing that has more permanent effects so
want to let users shake out problems with this
first.
2013-11-10 12:31:57 +00:00
6cba2b8d73 move bmesh tools into their own include,
changes to tool args would rebuild far too many files and these are mainly by modifiers outside of bmesh.
2013-08-23 04:22:07 +00:00
b1f4e2b4db code comments: bmesh operator doxy header descriptions. 2013-03-30 08:54:50 +00:00
604bdb7f45 Fix bevel modifier bug #34611, limit bevel amount needed.
This is a quick fix that perhaps overestimates the point
of first geometry collision, but at least for now it should
allow models that used the old modifier and a too-big
bevel amount to not look awful.

The correct solution to this problem is much more involved
and I'll get to it later.
2013-03-13 14:08:12 +00:00
0a6e8a41b9 Enable new bevel tool code in bevel modifier.
Now modifier takes a segments parameter.
Bevel edge weights will multiply the overall amount.
For vertex-only, you can give a vertex group name,
and the weights in that will multiply the overall amount.
2013-02-21 17:29:35 +00:00
b27854bd47 use booleans for bmesh api. 2013-01-14 16:42:43 +00:00
4e5d5e0d84 Add 'vertex_only' option to bevel tool.
Right now, changing segments to > 1 doesn't do anything,
but intend to work on making that cause rounded corners.
2012-12-28 02:45:10 +00:00
dbdc76c9d0 code cleanup: make bmesh operator names more consistant since python has access to these as input arguments and return values.
all output values currently have ".out" suffix, this may go in the future, but for now it makes it clear in C code what are inputs and outputs.
2012-11-20 05:50:19 +00:00
48639af5f8 use input and output slots for bmesh operators, needed for the python api to get return values. 2012-11-19 14:58:31 +00:00
185cf6095e improvements to bevel
- the resulting selection is now correct

internal details
- bev_rebuild_polygon() now only rebuilds polygons that are attached to a bevel vertex (was rebuilding ALL).
  ... need to take care we don't leave faces pointing to removed geometry, so far this works fine.

-  bev_rebuild_polygon() uses stack memory for <32 size ngons to reduce allocs.

- skip hash lookup when removing bevel verts (use tag instead).
2012-11-19 02:26:59 +00:00
cdc4037f0d bmesh: BM_verts_in_face was using bmesh operator flag which is no longer ensured to be available,
use internal apiflag instead, Thanks to Nicholas Bishop for spotting.

also quiet some warnings.
2012-11-19 00:54:55 +00:00
fd9dac77d1 bevel now only takes manifold edges (so it doesnt need to check for them) 2012-11-18 09:33:11 +00:00
4401ac8c9e finish moving bevel code out of the operator dir (it works again) 2012-11-18 08:35:27 +00:00
9a74fb5b05 moving bevel to tools dir as-is to keep svn history (breaks build, will fix next). 2012-11-18 08:20:02 +00:00
c3c14f862b use quad-strip for filling even when no segments are being added, this gives quad-loops along the bevel whereas before it made ngons. 2012-11-16 21:25:11 +00:00
6de13de7ab more straightforward way to implement quad-strip face filling suggested by Howard Trickey,
also some other changes - no need to check the new loops face is larger and no longer split up the ngon more times then there are subdivisions in the face strip (now ngons will remain on both sides).
2012-11-16 21:05:27 +00:00
dc06523622 rework the bevel quad strip logic to work with ngons correctly, previously it only worked properly with triangles. 2012-11-16 14:28:37 +00:00
8928344bf7 fix for own bug in quad-stip fill method, quad strips were skewed. 2012-11-16 13:41:21 +00:00
b7dbf83d19 more minor improvements to bevel use of math functions 2012-11-16 12:33:24 +00:00
6b0c200403 code cleanup: remove unneeded normalize (face normal), and unneeded call to len_v3v3 2012-11-16 12:25:15 +00:00
3edbd1d0e2 bevel: save some memory by aligning struct members. 2012-11-16 10:15:25 +00:00
f5b356bf18 wip - alternate bevel curve calculation (still disabled)
now USE_ALTERNATE_ADJ works, giving more stable corners that don't flicker and glitch out as the offset changes.

The shape is not a circle though and doesnt look quite as nice as the existing method.
2012-11-16 08:12:06 +00:00
b3f6c12136 bevel: wip ifdef'd code to test an alternative method of placing corner vertices. 2012-11-15 23:21:21 +00:00
8270592fa4 code cleanup: some renaming to avoid confusion. 2012-11-15 22:32:29 +00:00
987f6a7d4f code cleanup: move local math functions into math_geom.c, math_vector.c, no functional changes. 2012-11-15 13:24:14 +00:00
283ee53085 fix for deleting lines hanging the text editor when no markers are used, presence of markers still hangs.
also compiler warnings and some style edits.
2012-11-15 02:11:40 +00:00
cd8584aad5 Fix 'polygon eating' problem in bevel (bug #33141)
which was due to almost-parallel lines.
2012-11-15 02:05:32 +00:00
a286afe75d use memarena for bevel allocs 2012-11-14 11:06:58 +00:00
7295d98e07 use ghash for bevel verts, saves list lookups when getting a BMVert's BevVert 2012-11-14 10:23:38 +00:00
0163ae1701 speedup bevel by tagging verts and edges to bevel, this avoids a loop over all bevel edges for each bevel vert (can use edges-of-vert instead) 2012-11-14 10:08:39 +00:00
7c3db355b1 remove ifdef'd bevel code, current bevel works better then the previous code.
reduce strlen check in texttool_suggest_add()
use 'del list[:]' rather then 'list[:] = []' in python scripts which clear lists.
2012-11-14 09:45:15 +00:00