Wings 3D Development Forum
Unify edge length - Printable Version

+- Wings 3D Development Forum (https://www.wings3d.com/forum)
+-- Forum: Wings 3D (https://www.wings3d.com/forum/forumdisplay.php?fid=1)
+--- Forum: Interface & Usage (https://www.wings3d.com/forum/forumdisplay.php?fid=3)
+--- Thread: Unify edge length (/showthread.php?tid=1389)

Pages: 1 2


Unify edge length - esha - 09-19-2015

Hi there, I've been using Wings for a while but found my way here only now.
And I have already a question:

I've modelled a bracelet around the arm of an existing human figure.
The topology turned out a bit uneven, some polys are wider than others.
Is there a way to make all edges along the rim the same length, without changing the overall diameter?
Basically I'm looking for a way to distribute the verts along the edge more evenly, all at the same distance to each other.


RE: Unify edge length - ggaliens - 09-19-2015

If the bracelet is circular ... you can use circularize.

But if circular ... you probably would not be asking the question ... as there would be many ways.

Maybe include a picture of your bracelet if you want more in-depth suggestions.


RE: Unify edge length - esha - 09-19-2015

Thanks. No, it's not circular because it follows the wrist closely and that is more oval in shape. Also, it's open at the top where I'm going to put a decoration.

Here is a screenshot, very rough still but that way it's easier to edit:
https://gyazo.com/eb6fe8273e8dca90fc83f2af7fd0ff74

Another screenshot: https://gyazo.com/6ac65b2cf1bec721d379fd9ec4488e14

I want to add structure to the bracelet by extruding and beveling the polys. If they aren't all the same size it's going to look weird.


RE: Unify edge length - ggaliens - 09-19-2015

I assume you want the shortest edges lengths to be unified ... rather than the longest edges lengths ?

It is an interesting question you bring up. If I were to write a plugin or command for such thing ... I'd average all the selected edge lengths as AVG. And then I'd find the mid-point of each edge selected and just change the length to all be AVG. And then if you picked two edges in a row (tangent) ... then if there "fought" with each other ... that would be your problem. That or the command could check that each selected edge was not touching any other selected edge.

Maybe call it "unify edge ring". For that matter ... maybe you can use absolute scale ?

Micheus may have a really good idea here. He knows all the commands better than I do. It's probably in there already.

Then again ... if it is just the short edges that need to be uniform ... why not just re-extrude the inner or our face rings (the large face rings ... not the small ones) using plain old commands ?


RE: Unify edge length - esha - 09-19-2015

Absolute scale? I thought all the scales in Wings were %
And yes, I'm talking about the short edges.

Ideally Wings would count the number of edges in my selection (19 along the loop), calculate the total length, divide by 19 and adjust the length of each edge. This would mean moving the vertices along the edges, either inwards when the edge is too long or outwards when it's too short.
If it started on one side and worked through the edges one after the other there shouldn't be problems with "fighting" edges, either, I think, because the lengths will even out.

This would be an extremely useful feature. Necklaces, decorations of all sorts, lots of things demand an even distribution of vertices along a line of edges.


RE: Unify edge length - micheus - 09-19-2015

Yeah! I also missed this resource.

What I would offer to you as an alternative is to work with selections (from the entire faces - less one) and rotate around a picked axis. But, it will not produce the correct result anyway - except for a coincidence. Smile
Then, you could start from a cylinder to get this:
[Image: bracelet_zps0bab10d7.png]
if that area will have any kind of fastening, maybe it could not be a problem.


RE: Unify edge length - micheus - 09-20-2015

Just in case it can interest I upload the gif I had prepared:
[Image: bracelet_zpsuyvkhy6v.gif]
Start point was the deletion of one segment:
- selected the two edge loop of it boundaries;
- Loop cut command;
- select and Delete the segment.
Next, I selected one face and then:
- [+] increase selection some times;
The whole process is a sequence of:
- Rotate [RMB] - pick the axis and run the adjust;
- [-] decrease selection;
- [CTRL+D] repeat command (Rotate).

at some point I inverted the selection [CTRL+SHIFT+I].


RE: Unify edge length - ggaliens - 09-22-2015

Why don't we define a reasonable solution for esha ?

I propose a command "size absolute" or maybe "absolute size" to go next to "Absolute Command" (which I don't understand very well). Absolute size should resize edges, faces and bodies about their centers to a fixed number or units (length, area, or volume). A generic solution that is missing I'm pretty sure.


Code:
command({edge,{manifoldlab,absolute_size}}, #st{sel=SelAny}=St) ->
    case SelAny of
        [ ] ->   wings_u:error_msg("This is best applied to edge rings.");
        _ -> ok
    end,
    Qs = [{text, 1.0, [{key,absolute_size},{width,10}]}],
    wings_dialog:dialog("Absolute Size ...", Qs,
        fun(Res) ->
            {absolute_size,Sz}  = lists:keyfind(absolute_size,1,Res),
            wings_sel:fold(
                fun(Es, #we{id=ID}=We, Acc) ->
                    MyEdge = fun(Ei, #we{es=Etab, vp=VPos}=We2) ->
                        #edge{vs=VS,ve=VE} = array:get(Ei, Etab),
                        Pt1 = wings_vertex:pos(VS, We2),
                        Pt2 = wings_vertex:pos(VE, We2),
                        MidPt = e3d_vec:average([Pt1,Pt2]),
                        Dir = e3d_vec:norm(e3d_vec:sub(Pt1,MidPt)),
                        Pt1b = e3d_vec:add(MidPt, e3d_vec:mul(Dir,Sz)),
                        Pt2b = e3d_vec:add(MidPt, e3d_vec:mul(Dir,-Sz)),
                        VPos2 = array:set(VE, Pt2b, array:set(VS,Pt1b,VPos)),
                        We2#we{vp=VPos2}
                    end,
                    WeNew = gb_sets:fold(MyEdge, We, Es),
                    wings_shape:replace(ID, WeNew, Acc)
                end, St, St)
        end);




RE: Unify edge length - micheus - 09-22-2015

I would like to see a sample using a non regular shape - some thing with concave and convex segments.
If the end result still preserve the initial appearance (if possible, even after a smooth operation) maybe we say that it is a generic solution.


RE: Unify edge length - beng27 - 03-31-2016

Great, that's *exactly* the command I need for several projects in Wings.

How can I use it on Mac OSX? I have wings 2.02, and its not included.

Is there a manifold labs version of 1.54 for OSX? I can't find it.