Wings 3D Development Forum
[fixed] New MMB Connect for vertices (BUG) - Printable Version

+- Wings 3D Development Forum (https://www.wings3d.com/forum)
+-- Forum: Wings 3D (https://www.wings3d.com/forum/forumdisplay.php?fid=1)
+--- Forum: Bug Reports (https://www.wings3d.com/forum/forumdisplay.php?fid=12)
+--- Thread: [fixed] New MMB Connect for vertices (BUG) (/showthread.php?tid=1664)

Pages: 1 2 3


[fixed] New MMB Connect for vertices (BUG) - ggaliens - 04-09-2016

New MMB Connect for vertices (BUG)

I'm having troubles in the case where I'm trying to connect three at a time (triangles).

My approach is to create a keyboard shortcut for Connect MMB which connects distant vertices by a straight shot path. Then I also have a hard edges short cut.

Anyways ... if I cut over an existinng cut ... I definitely get problems. Dan and I have collaborated on this function. I hope I can help him debug any issues with current released implementation. But we will also need help from other users to get a bigger "sample" of bugs.

I'm getting "Cannot connect vertices" message.

Also getting this ... which is weird ...

Code:
Reason: {badarg,[{unicode,characters_to_binary,
                          [[[[69,120,101,99,117,116,105,110,103,32,116,104,
                              101,32,99,111,109,109,97,110,100,32,34,86,101,
                              114,116,101,120,124,67,111,110,110,101,99,116,
                              32,67,117,116,115,34,10,98,111,117,110,100,32,
                              116,111,32,116,104,101,32,104,111,116,107,101,
                              121,32,
                              {bindkey,vertex,120},
                              32,99,97,117,115,101,100,32,97,110,32,101,114,
                              114,111,114,46]],
                            0]],
                          []},
                 {wxStaticText,new,4,
                               [{file,"gen/wxStaticText.erl"},{line,105}]},
                 {wings_dialog,build,5,
                               [{file,"c:/Users/uabdgud/src/wings/src/wings_dialog.erl"},
                                {line,873}]},
                 {lists,foldl,3,[{file,"lists.erl"},{line,1262}]},
                 {wings_dialog,build_box,7,
                               [{file,"c:/Users/uabdgud/src/wings/src/wings_dialog.erl"},
                                {line,1266}]},
                 {wings_dialog,build,5,
                               [{file,"c:/Users/uabdgud/src/wings/src/wings_dialog.erl"},
                                {line,814}]},
                 {wings_dialog,build,4,
                               [{file,"c:/Users/uabdgud/src/wings/src/wings_dialog.erl"},
                                {line,766}]},
                 {wings_dialog,'-build_dialog/3-fun-0-',3,
                               [{file,"c:/Users/uabdgud/src/wings/src/wings_dialog.erl"},
                                {line,725}]}]}



RE: New MMB Connect for vertices (BUG) - cyseal - 04-09-2016

(04-09-2016, 05:40 PM)ggaliens Wrote: New MMB Connect for vertices (BUG)

I'm having troubles in the case where I'm trying to connect three at a time (triangles).

I don't understand this sentence.
With 3 vertices, W3D doesn't connect them in triangle?


RE: New MMB Connect for vertices (BUG) - ggaliens - 04-09-2016

OK ... this story is getting stranger ... I feel like I'm adding confusion somehow by using a hotkey. When I use direct CTRL+MMB ... I feel like I'm getting a differ behaviors. Please stand by.


RE: New MMB Connect for vertices (BUG) - micheus - 04-09-2016

(04-09-2016, 05:40 PM)ggaliens Wrote: Also getting this ... which is weird ...

Code:
Reason: {badarg,[{unicode,characters_to_binary,
                          [[[[69,120,101,99,117,116,105,110,103,32,116,104,
                              101,32,99,111,109,109,97,110,100,32,34,86,101,
                              114,116,101,120,124,67,111,110,110,101,99,116,
                              32,67,117,116,115,34,10,98,111,117,110,100,32,
                              116,111,32,116,104,101,32,104,111,116,107,101,
                              121,32,
                              {bindkey,vertex,120},
                              32,99,97,117,115,101,100,32,97,110,32,101,114,
                              114,111,114,46]],
                            0]],
                          []},
                 {wxStaticText,new,4,
                               [{file,"gen/wxStaticText.erl"},{line,105}]},
                 {wings_dialog,build,5,
                               [{file,"c:/Users/uabdgud/src/wings/src/wings_dialog.erl"},
                                {line,873}]},
                 {lists,foldl,3,[{file,"lists.erl"},{line,1262}]},
                 {wings_dialog,build_box,7,
                               [{file,"c:/Users/uabdgud/src/wings/src/wings_dialog.erl"},
                                {line,1266}]},
                 {wings_dialog,build,5,
                               [{file,"c:/Users/uabdgud/src/wings/src/wings_dialog.erl"},
                                {line,814}]},
                 {wings_dialog,build,4,
                               [{file,"c:/Users/uabdgud/src/wings/src/wings_dialog.erl"},
                                {line,766}]},
                 {wings_dialog,'-build_dialog/3-fun-0-',3,
                               [{file,"c:/Users/uabdgud/src/wings/src/wings_dialog.erl"},
                                {line,725}]}]}
ggaliens, how exactly do you get this error? Which dialog you are activating?


(04-09-2016, 05:43 PM)cyseal Wrote: I don't understand this sentence.
With 3 vertices, W3D doesn't connect them in triangle?
cysealTake a look at the original code discussion and watch his video in this post.


RE: New MMB Connect for vertices (BUG) - micheus - 04-09-2016

... and PLEASE, use the proper thread for reporting bugs to 2.0.3. I had linked it in the release announcement thread. Dodgy


RE: New MMB Connect for vertices (BUG) - ggaliens - 04-09-2016

Micheus ... I think I have too much going on. I think there is a bug ... but might be hard to recreate as shown above. I was using the Official build though.

I'm using stanford bunny with fairly regular triangles. Like I said ... I need to try to find out if my use of hotkeys was adding confusion.


RE: New MMB Connect for vertices (BUG) - micheus - 04-09-2016

I asked because it's clear that is in a moment where a dialog is created as well as when unicode conversion is required. So, you just need to remember which dialog you activated.


RE: New MMB Connect for vertices (BUG) - ggaliens - 04-09-2016

For me ... it was supposed to be without a dialog. I think it must come from wings_u:error_msg
maybe.

This is for Dan G ... Dan ... sometimes it picks the wrong part of loop to keep ... see this video.




BTW ... there was a reason why calc_planes was returning three planes. Part of that reason was to ensure the outer part of the loop was not selected. Now it is a "misnomer" because it only returns 1 plane.

I'm fairly certain you won't be able to connect/collect the proper set of faces without the two planes you decided to forgoe. They were critical to the process. If you don't use them ... then you must be doing some topological thing ... which will be wrong.

So ... original implementation (even if hacky) ... used three planes.

Two of then are "Book end" plane that go through the start and ene vertices ... one plane for each vertex. Then there is third plane (the cutter plane). The two book end planes were design to be perpendicular to the cutting/slicing plane. You want to keep the vertices/edges ... cut the ones ... that are between the two book end planes. I think you also need the MIDPOINT I was generating as well. See the logic in my original collect faces ...

Code:
collect_faces(Mid, Plane1, Plane2, Es, #we{}=We) ->
    FaceSet = wings_face:from_edges(Es,We),
    MyFs = fun(Fi, Acc) ->
        Center = wings_face:center(Fi, We),
        S1a = e3d_vec:plane_side(Mid, Plane1),
        S2a = e3d_vec:plane_side(Center, Plane1),
        S1b = e3d_vec:plane_side(Mid, Plane2),
        S2b = e3d_vec:plane_side(Center, Plane2),
        if (S1a ==S2a) andalso (S1b ==S2b) -> gb_sets:add(Fi,Acc); true -> Acc end
    end,
    gb_sets:fold(MyFs, gb_sets:empty(), FaceSet).

This is a projection of the cut object. The cutting plan is not important ...
It is the other two planes that feel even more important than the cutting plane. Sure ... you cut with the cutting plane. But the other two plus the midpoint are carefully crafted so that we can avoid wrong loop parts.

Together the three planes form an "H" as I did depict in code comment at one point.




RE: New MMB Connect for vertices (BUG) - micheus - 04-09-2016

The plane cut code couldn't be used for that. Considering the plane defined by Vs,Ve and (Mid0+Vn - where Vn is the average normals of Vs and Ve) it could be used to Calc the entire surface cut and then you could choose the shortest segment between the two vertices discarding the other. That was not viable?


RE: New MMB Connect for vertices (BUG) - ggaliens - 04-09-2016

That might work for Dan. Not sure how he's picking between logical segments right now. It does not seem RANDOM to me ... for he seems to get a lot of the cases correct. But now I need to do a test on an object that is even more complicated than the stanford bunny.

A few times ... with the release version ... I feel like it got caught in a huge loop ... taking forever. Not sure why.