Blender EdgeTools

All,

Over the past couple months I’ve coded a few edge-based tools (as scripts) that I used in a modeling project I have been working on for awhile. Since I had them lying around and found them really useful, I went ahead and through them together into an add-on. They pretty much implement some edge manipulation tools I am used to having with a CAD package I often use. The tools are as follows:

Extend:
Does exactly what it sounds like: it extends a single, selected edge. You can change the length of how much the edge is extended by.

Spline:
This one has some known issues, but the idea is to connect two edges with a cubic spline using an end point and edge direction to create the control points for the spline generation (knot and handle). You can adjust the tension of each handle and which end point is used (direction). Right now only the “C-spline” and “Beizer” spline types mostly work (the last point is not connected for reasons I cannot decipher).


Angle off Edge:
Probably the worst named one since I have no idea what would be a good name :o. Anyway, the idea is that if you select a line and a plane, then create a new edge some angle off of the original edge in the chosen plane (does that make any sense?) with a given length. In this case you select two edges which gives you your plane, and then it creates edges from there. Then you can choose which vertices to use and which direction (+/-) to create the edges in addition to the length of the created edges. Unfortunately right now the angle control does not work so you are stuck with a right angle.


Shaft:
Creates a cylindrical mesh (“shaft”) about a selected edge. This can work in three ways: select two edges, select an edge and a point, or just select an edge. The first uses one edge as the axis to revolve the second edge around. The second method uses the point to know the radius of the shaft to create. The last one the user specifies the radius of the shaft. This one seems to work perfectly.

Split:
This one “slices” the selected edges on a plane. To use this one, select a face (that is the cutting plane) then the edges that cross the plane that you want to slice. I will warn that while in general it works as expected, sometimes it does really strange stuff, so something about it does not quite work right.


If you encounter any bugs, I would appreciate if you dropped a note here so I can try to figure out what is wrong. Also, if there are any edge-based tools you would like to see feel free to mention them and I will look into adding them.

EDIT: This script is now in the Blender contrib.
Finally, download link:
https://svn.blender.org/svnroot/bf-extensions/contrib/py/scripts/addons/mesh_edgetools.py

Additional screenshots:
http://www.mediafire.com/file/8a883wsn9y6zsiy/Screens.7z

thanks mate, good job.

thanks for sharing your tools! :slight_smile:
with a little work, these could make it to trunk possibly.

Thanks a lot, BrikBot, very good tool for an architect!

Spirou4D: funny you should say that . . . the modeling project these came out of was an architectural project.

Ok, got “Angle off Edge” fully functional and (I think) bug free. I also did some tweaking in it to make the +/- controls behaviour predictable. Before you never really knew which way Blender would think was “+” and which was “-”.

good news, when will you be releasing another update :slight_smile:

Will this work with bmesh?

seems like this would be nice with ngons… :slight_smile:

@blenderificus: When I get time and inspiration ;). More seriously, I have been trying to better understand spline theory to improve that part, and have also been working on bringing some long over-due updates to a different add-on I am also developing (Stair Builder). So pending those.
@holyenigma74: It should, meaning I don’t see any problems with it, but I haven’t tried it so I really don’t know. Probably the only tools that probably could use some re-working is “Slice” to be non-destructive of faces.

looks like the BMESH merge started yesterday, I hope this still works :slight_smile:

Well, it looks like everything but “Slice” is working with BMesh. I guess it’s time to start squashing those bugs. . . .

Awesome! Thanks :smiley:

Ok, this is now working under BMesh. Please note that it is currently at the bleeding edge of the BMesh API, so you must have a Blender build more recent than r44800. “Slice” now works a little more intelligently too by taking advantage of the non-destructive nature of BMesh. Oh, and the weird error I was sometimes seeing randomly disappeared (no complaints here!).

Additionally, I have a couple new, small tools for projections. The first is a typical projection where you project the selected geometry onto the selected face. The second only projects one of the verts of a selected edge onto the plane. It defaults to whichever vert is closest to the plane. It also defaults to projecting along the direction of the edge instead of the normal of the plane (though that can also be changed). This is useful for aligning, say, the end of a cylinder with an angled plane.

It is now fully using BMesh, not just working with it. With that, “Spline” is now working fully (there was a minor bug with it not ending at the last point :o), and “Shaft” is now creating the faces for the shaft. There is also a couple fixes with “Angle off Edge”. Previously, it would hard crash if you tried to use just one edge. It will not instead through an error message and exit. Also, it would crash if you selected two parallel edges. It now works with parallel lines, but the angle functionality is a little unpredictable.

The BMesh API is so much nicer to work with than the straight mesh API. . . .

Been awhile since I posted an update here as life got a bit crazy :spin:. But I have been working on developing a CAD solid model type of edge fillet for this. As a part of that, I have written some code for intersecting a line with a non-planar quad. There are some assumptions on the definition of the surface defined by the quad but overall it seems to work well so far (I haven’t hit any issues with it yet). I threw it into PasteAll (http://www.pasteall.org/32099/python) as I figured other coders might find it useful.

thanks for sharing!

Thanks for this add-on, very useful!

The script was moved to Blender’s contrib/SVN. The link has been updated to point you to the correct location.

Having looked over in the other thread you mentioned, I see what you’re thinking and well, yes and no. What I’ve got it doing is it is working with the raw, mathematical definition of a spline. So in a sense, yes it is dealing with a temporary spline but it is strictly as a mathematical formula. Then by walking along a control variable in the splines’ formula I generate each point needed for the spline, then finally connect all the points. But it would certainly be possible to adapt the formula/point generation to other purposes.

@3Duaun and Carrozza: Glad to hear it’s useful!

Fabulous little toolset.

From your writeup I honestly couldn’t tell what the AOE addon did without trying it myself. Even the screenie didn’t help. So I wrote up my own personal instructions for it (as I often keep notes for my scripts) and thought I would share it for your consideration. I also came up with a slightly different name which is just a bit more descriptive. Anyway, keep it, trash it, or modify it for your own:

Angle off Planar Edge:
Given two edges, you can create a new edge some angle off of the original edge in the plane made by the two original edges. So, you select two edges which gives you your plane, and then invoke the script and it creates edges from there. Then you can choose which vertices to use (and therefore which edges are created/kept) by checking or unchecking the vertice boxes, which direction (+/-) to create the edges in and the length of the created edges.

Thanks again for these scripts!

That’s significantly better than what I’d come up with so far, which really wasn’t very good. So I’ll probably “borrow” it :wink: