GSoC 2019: Custom Bevel Profiles

Hi everybody! This thread will be used for discussion of the custom profiles project!

Here’s a link to my original proposal. I’ve also created a section in the wiki here that I’ll keep updated as I make progress.

UI / Interface

Although there should be a way to use a curve object from the scene as a custom profile, the ability to edit a profile curve right in the UI would be helpful. Here’s a mockup of what I think that could look like. The trickier part compared to the existing curve editing interface is that the profile shouldn’t necessarily have to be a function.
Mockup

Implementing intersections

The trickiest problem for the implementation of this feature is likely to be any situation with an unsymmetrical and a more than 2-way intersection. Any situation at least as complicated as this:

As you can see here, even with this simple profile, there’s no obvious way to fill the beveled vertex. One of the things I will research is if this problem has been tackled before in other software, and if so, how this somewhat arbitrary situation is resolved there.

Feedback

If anyone has input about these ideas or others, it would be great to hear it! I’m particularly interested in ideas for filling >3-way intersections.

Also, if you have a specific use-case for this feature, that would be helpful to know!

21 Likes

The result should ideally be identical to using a real-world chamfer tool, which removed material along the edges.

The result would thus be:

4 Likes

I like that solutions sometimes, but bevel normally doesn’t work only like real world chamfer tools.

Could be great see how other softwares like Houdini manage the problems of bevel profile. Use mirrored profile, the “power/scale” of the profile.

houdini does some interpolation:

try their apprentice version and play around with it. :slight_smile:

1 Like

Another way to use these profiles could be for extrusion as modo does https://www.youtube.com/watch?v=1jnr-vWzSDo

3 Likes

Good luck :slight_smile: amazing add to blender

3 Likes

How about being able to use grease pencil strokes for the profiles? You could then grab/sculpt the profile easily in the 3d view which could be interesting. Sampling the strokes should be pretty easy too (hopefully)

I’d prefer to see a pen-input for the Curve Widget that @HooglyBoogly shows up top (which, brownie points: is how I was hoping you’d implement the curves. I wish more curve-based modifiers used it!)

1 Like

I would use something like this to create the profiles

Screenshot%20(154)

plus the ability to save presets, with icons that create themselves as icing on the cake :stuck_out_tongue_winking_eye::cake:

2 Likes

Thanks for the responses! I’m sorry I haven’t been more responsive. I’m still finishing up final exams, although I’m mostly finished.

I’ll try to respond to everyone here. You have some really helpful ideas!

I agree, this seems like an elegant solution! I do have a few concerns about pursuing this option though. One is that it doesn’t seem to support non-symmetrical profiles very very cleanly. (Like the profile pictured below). It looks like the reason chamfer method works well in your picture is that it’s a symmetrical profile. So each of the three edges intersect at the same center, etc… As the chamfer runs through for the third time, I could even see it making islands that aren’t connected to the main object.
Screenshot%20from%202019-05-16%2007-51-13
I tried to build a demonstration of what I meant here with the boolean modifier, but I ended up spending way too much time cleaning up geometry. Here’s what it looks like before I started to fix the third bevel. Maybe messiness is unavoidable in situations like this, but this looks a bit crazy.
3-way%20Intersection%20Chamfer%20Unsymmetrical

Thanks for this image! I may need to study that interpolation it does, it’s not quite clear how it decides what to do there yet.

I’m guessing the symmetrize field forces it into a symmetrical case which avoids some of the complexity I mentioned above. I thought it might be useful to keep that as a separate case in my implementation.

It’s looking like I will need a few of the same properties for sampling and picking the direction of the curve.

That looks great! I like that they have a selection of preset profiles. I wonder if it would be too difficult to add a way to save presets like the BoltFactory addon does.

I’m not sure about this. Blender already has a curve system, both as objects and the curves for color correction. I am planning to add the possibility to systems similar to both of those, so another option might not be necessary. What’s necessary here probably is a quick way to go back and forth between grease pencil stokes and meshes/curves, which might even already exist.

Wow! We’re getting ambitious! I think presets and icons will have to come last, after I’ve finished the basic functionality, but I agree that would be very nice.

4 Likes

Question, will you be able to save these profiles you make so you can reuse them for other projects? Would be pretty neat if you could. :slight_smile:

I would love to get that done! I’m not quite sure where it fits in the priorities though. Judging by how many people have mentioned it, it seems pretty important, but getting the core functionality done and making intersections work may be higher a higher priority for the summer.

1 Like

By the way, here is my most recent mock-up for what the custom profile UI could look like. The first thing I have to do is get the custom profile data piped into the bevel modifier, so I’m starting now by adding getting these properties added to the UI.

The idea behing the Sample only Nodes property (which needs a better name) is to override the number of segments and only draw straight lines between the curves on the plot above.

I will hopefully be able to reuse most of the elements from the existing CurveMapping user interface element. Priorities there are:

  1. Learning the API around that to see if I can get the necessary UI changes from the template just in Python.
  2. Figuring out how it stores its data to get that into the bevel parameters.
  3. Later on, sampling the curve between the points. (I will start with the “Sample only Nodes” case case where the only thing that matters is the nodes.
  4. Other lower priority tasks like making the plot more reactive to the other properties.
3 Likes

Didn’t even knew Modo could do that. Oh wait, I don’t use Modo =)).

1 Like

This proposal is fantastic! I wish it could be implemented some day! The ability to have multiple profile presets would be so neat and will save so much time!

2 Likes

will this be a feature for the tool itselfs as well and not only for modifier ?

1 Like

The feature will be for the tool as well as the modifier. The tool is a bit harder to implement though, there is a different system for passing the arguments to the operator whereas the modifier just calls the operator’s C code directly. So for right now I’m focusing on the modifier.

2 Likes

Hi, another update here! (and feedback solicitation)

First, I wanted to give a link to a log that I’ve been keeping: User:HooglyBoogly/GSoC2019/Log - Blender Developer Wiki Here’s a sample ;):

May 30

Today I finished getting the sampled info into the ProfileSpacing struct. That struct contains the 2D locations of the profile’s points before it gets transformed into 3D on top of a plane. Unfortunately I think this means I’ve completed most of the more straightforward part of using the profile information in bmesh_bevel.

I also spent way too long today dusting off my GDB knowledge diagnosing some stupid seg-faults that I caused with some typos and another silly mistake. It’s all part of getting up to speed on a new project, and it’ll be faster in the future, but it still feels stupid in retrospect.

Next, I could either focus more on getting the profile UI widget drawing fixed out, or see what I can do with this profile-spacing info in the simple weld cases I’ve talked about.

If anyone wants to follow along and provide feedback, that’s a place to do it!

A Question about profile orientation

One question that’s come up is how to deal with the arbitrary choice of which side of the profile becomes the right side of the widget and which the left, in other words the orientation of the custom profile. After some discussion with @Howard_Trickey, I’m leaning in the direction of choosing a direction based on a somewhat arbitrary metric like the distance to the object origin and providing a reverse button like I have on the mockups which would flip the profile around.

This would mean that in order to adjust the direction separately for differnent parts of the bevel you would have to do two separate actions. Does this seem like too much of a limitation?

The choice between symmetric or unique profiles would be nice too. In the former, you’d essentially only draw half of the bevel, and the other side would be mirrored, sidestepping any orientation issues or trouble with keeping both sides the same.

1 Like

I agree, this could be quite helpful. I think it would make the amount of code that would change much smaller. The profiles are constructed one half at a time right now, so if each half were the same the only thing that would have to change is the position of the vertices the bevel code created, not the manner by which they’re created.

At the end of the project though, when the more general non-symmetric case is completed, I think the only difference between this “Symmetric” check-box and a manually symmetric profile would be the intersections. So I’ll probably tackle this option when I start with the more complicated intersections.

1 Like