利用者:ReD Fox/BevelModifierDev

提供: wiki
移動先: 案内検索

Summary

The bevel modifier will be useful for those cases when the user would like to preview a beveled result while still modifying its single-edged counterparts. Or, it can be used at render time to provide a subtle bevel effect to sharp edged objects. It will support all the functionality of the edit mode bevel tool, but with additional options to give the user as much control as possible over the final beveled result. It will support the following features:

  1. Allows the user to choose between the vertex or edge beveling methods, and will use the method for all operations
  2. Allows the user to set the beveling amount, either as a distance or a radius (see Figure 4)
  3. Allows the user to set the bevel resolution (see Figure 5)
  4. Can selectively bevel based on the angle of the edge
  5. In addition to the above options, the bevel amount can be weighted based on edge crease values (or another custom flag), vertex weights, and edge "size"

Details and Explanations

General comments

The bevel modifier and edit mode bevel tool will use the exact same algorithms to produce a beveled result. However, since it is not appropriate for the bevel modifier to use selection when determining which geometry to bevel, other methods for limiting the bevel will be implemented (since it is often undesirable to bevel an entire mesh by a constant amount). Thus, except where noted below, the bevel modifier should parallel the explanations outlined in the bevel tool above.

Settings and options

Vertex beveling method

See Figure 3 and the associated explanations.

Bevel amounts

For explanation of the difference between the bevel distance and bevel radius values see Figure 4, and the associated explanation.

Bevel resolution

See Figure 5 and the associated explanation.

Edge angle

This option allows the user to limit the bevel to edges that are equal to or sharper than the specified angle.

Bevel weight options

These options allow the user to limit or alter the beveled geometry. For a full explanation of these options and their limitations and applications, see "Weighting behavior" below.

Weighting behavior

Initially, there are plans to include two methods for the user to weight the bevel applied to edges and vertices, and one method to automatically weight the bevel based on mathematical data. There may be changes (the pros and cons are outlined in their respective sections), and there may be the possibility of combining these methods in a single modifier, but for now they will be described as if they are to be implemented as single, stand-alone options.

Edge crease option

The edge crease data was added originally for the benefit of allowing sharp edges for subdivision surfaces. Also, subdivision surfaces (currently implemented as a modifier) still use this data. The major concern when using this to weight the bevel value is that it may conflict with subdivision sufaces to produce strange results if the two modifier types are combined.

The edge crease values are set by the user in edit mode, and range from 0.0 (no crease, i.e. full bevel) to 1.0 (full crease, i.e. no bevel). This will be interpreted as a percentage, so that if a user has a bevel value of 1.0, and the edge crease value is 0.25 (25 percent less bevel), the bevel value for that particular edge will be 0.75.

In comparison with the edit mode bevel tool, the bevel modifier's equivalent to beveling two edges as shown in Figure 1 would be to choose the edge crease weight option, set a 1.0 edge crease value (no bevel) on all other edges (those not selected as shown in Figure 1), and a 0.0 edge crease value (full bevel) for the selected edges. Thus, the edge crease weight option for the modifier can act as a type of "edge selector" (among other things).

Vertex weight option

The vertex weight option does not have the potential conflict problems that the edge crease option does, but it is currently rather cumbersome for the user to define vertex weights in Blender (they must either type the value vertex by vertex in the buttons window, or use a hard to manipulate weight painting tool). It also does not allow for edge-based weighting, making situations and results such as the one presented in Figure 1 impossible. In essence, the differences between the vertex weight and edge crease weighting options are comparable to the differences between the vertex and edge selection modes for the edit mode beveling tool.

As with the edge crease values, the values for vertex weights can be set by the user, and range from 0.0 (no weight, full bevel) to 1.0 (full weight, no bevel). This is (to me) a bit backwards for vertex weights, but it parallels the edge crease values.

In order for vertex weights to be used as bevel weights, the user will be required to create and/or specify a vertex group to be used.

Percentage value option

This will initially be implemented as a bevel weighting option, but it may be better defined as an alternative way of setting the bevel value (since it does not allow user-specified, fine-grained control over the beveled result, as do the edge crease and vertex weight options). The basic premise behind a bevel weighted by percentages is that "larger" edges will be beveled more than "smaller" edges, and will, hopefully, provide better visual results while saving the user from manually adjusting each edge. The chief difficulty is to determine what defines a "large" or "small" edge.

There are several factors that can be used when defining edge size and percentages.

  1. What does the percentage represent? Should the largest and smallest edges in the mesh be found first, and the percentage made to represent a scalar between the two (so that the largest edge is beveled the full bevel amount, and the smallest edge isn't beveled at all)? Or, should the percentage disregard the bevel value and become a value of itself, setting each edge's bevel value according to its size (so that if the percentage value is 0.5, each edge will be beveled to half its maximum bevel amount)?
  2. How do you determine edge or vertex "size"? Do you use the length of the edge, the length of the adjacent edges sharing vertices with the edge, the adjoining face areas/sizes, or some combination of all of those? What about edge angles, should they be a factor as well?
  3. Should the bevel amount be consistent for all inset distances? If an edge is shared by two faces, one that is small and one that is large, should the large-faced side of the edge be inset relative to its larger size (producing a beveled edge that has different joining angles for each face), or should it be inset with the same value as that used for the smaller face (producing a beveled face that has the same joining angles for both faces)?

Resolving and combining weights

  • two or more meeting edges with different weights
  • Possibility: tweaking percentage with edge or vertex weights

Examples

Algorithms

Questions/problems

  1. Is there really a potential conflict between using edge crease values for both subsurf and bevel? If so, what are the ways of removing this conflict (make separate flags for each tool, create a bevel-only vertex weight proxy for edit mode, etc.)?
  2. Would a "Subsurf Bevel" option (as presented in this image) be helpful?
  3. Is a "weight bevel by percentage" option necessary, or even helpful? I thought it was a great idea at first, but now I can see it being a little-used function with very little practical value that takes quite a bit of work to code correctly.