• Website
  • Search
  • Member List
  • Help
  • Old Forum
  • Social Media
    •   @Wings3dOfficial
    •   @Wings3dOfficial
    •   Wings3dOfficial
    •   Wings3dOfficial
  • Register
  • Login
  • Website
  • Search
  • Member List
  • Help
  • Old Forum
  • Register
  • Login
Wings 3D Development Forum Wings 3D Gripes & Grumbles v
« Previous 1 … 4 5 6 7 8 Next »
wings_body and weld function ...

 
  • 0 Vote(s) - 0 Average
wings_body and weld function ...

ggaliens
Offline

Erlang Hacker
Posts: 954
Threads: 143
Joined: Nov 2012
#4
11-05-2014, 03:49 PM (This post was last modified: 11-05-2014, 04:20 PM by ggaliens.)
Maybe we can LURK around the problem a bit and find it ...

Why would wings_face:fold be used here in wings_body ?
Code:
qualified_fs([F|Fs], Tol, We, Acc) ->
    Vs = wings_face:fold(
       fun(V, _, _, Acc0) ->
           [V|Acc0]
       end, [], F, We),
    {X,Y,Z} = wings_vertex:center(Vs, We),
    Center = {granularize(X, Tol),granularize(Y, Tol),granularize(Z, Tol)},
    qualified_fs(Fs, Tol, We, [{{length(Vs),Center},F}|Acc]);
qualified_fs([], _, _, Acc) -> Acc.

It almost seems like the could have simplified a bunch my calling wings_face:center(F, We) ... I doubt it would be that much slower.

Also ... the name is a MISNOMER here because there is nothing qualified about the faces. I happen to think there should be meaning in words here. It really should be called granularized_fs ... instead. But that's a bit of an aside.

Probably the face fold is just fine ... but so is this one ... and in a single trial ... it came out faster (don't know why).

Code:
qualified_fs([F|Fs], Tol, We, Acc) ->
    Vs = wings_face:vertices_ccw(F,We),
    {X,Y,Z} = wings_vertex:center(Vs, We),
    Center = {granularize(X, Tol),granularize(Y, Tol),granularize(Z, Tol)},
    qualified_fs(Fs, Tol, We, [{{length(Vs),Center},F}|Acc]);
qualified_fs([], _, _, Acc) -> Acc.
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)



Messages In This Thread
wings_body and weld function ... - by ggaliens - 11-02-2014, 05:00 PM
RE: wings_body and weld function ... - by micheus - 11-02-2014, 06:15 PM
RE: wings_body and weld function ... - by ggaliens - 11-02-2014, 08:58 PM
RE: wings_body and weld function ... - by ggaliens - 11-05-2014, 03:49 PM
RE: wings_body and weld function ... - by ggaliens - 11-05-2014, 07:43 PM
RE: wings_body and weld function ... - by ggaliens - 11-06-2014, 04:15 PM

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D - Powered by MyBB

Linear Mode
Threaded Mode