• 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 Programming v
1 2 3 4 Next »
how to make plugins from the command line

 
  • 0 Vote(s) - 0 Average
how to make plugins from the command line

hartsantler
Offline

Junior Member

Posts: 8
Threads: 3
Joined: Sep 2018
#1
09-08-2018, 10:00 PM
I am trying to figure out how to create simple shapes from the command line (using expressions and not compiling it as a plugin), here is what i have so far that is not working yet.

Code:
BuildShape = fun(Prefix, Fs, Vs, PostFix) ->
    We = wings_we:build(Fs, Vs),
    Name = Prefix++PostFix,
    St = wpa:get_state(),
    Shapes0 = element(1, St),
    Shapes = gb_trees:insert(0, We, Shapes0),
    erlang:setelement(1, St, Shapes) end.

Tetrahedron = fun(L, PostFix) ->
    Xi = L/2.0,
    Hp = math:sqrt(3.0),
    Li = Xi*Hp,
    Zi = Xi/Hp,
    Yi = L * math:sqrt(2.0/3.0),
    Yf = Yi / 3.0,

    Fs = [[2,1,0],[1,2,3],[1,3,0],[3,2,0]],
    Vs0 = [{ 0.0,  Yi-Yf,  0.0},
       { 0.0, -Yf,   Li-Zi},
       { -Xi, -Yf,     -Zi},
       {  Xi, -Yf,     -Zi}],
    BuildShape("tetrahedron", Fs, Vs0, PostFix) end.

Tetrahedron(1.0, "1").

The error i get is:
Code:
** exception error: no function clause matching
                    gb_trees:insert(0,
                                    {we,undefined,0,[],
                                     {array,6,10,undefined,
                                      {{edge,0,1,2,0,4,2,1,3},
                                       {edge,0,2,0,3,3,0,2,5},
                                       {edge,0,3,3,2,5,1,0,4},
                                       {edge,1,2,1,0,5,4,0,1},
                                       {edge,1,3,2,1,2,0,3,5},
                                       {edge,2,3,1,3,4,3,1,2},
                                       undefined,undefined,undefined,
                                       undefined}},
                                     none,none,
                                     {4,
                                      {2,0,
                                       {1,3,{0,0,nil,nil},nil},
                                       {3,1,nil,nil}}},
                                     {0,nil},
                                     {array,4,10,undefined,
                                      {0,0,1,2,undefined,undefined,undefined,
                                       undefined,undefined,undefined}},
                                     {array,4,10,undefined,
                                      {{0.0,0.5443310539518174,0.0},
                                       {0.0,-0.2721655269759087,
                                        0.5773502691896257},
                                       {-0.5,-0.2721655269759087,
                                        -0.2886751345948129},
                                       {0.5,-0.2721655269759087,
                                        -0.2886751345948129},
                                       undefined,undefined,undefined,
                                       undefined,undefined,undefined}},
                                     {0,nil},
                                     default,6,none,none,[]},
                                    st) (gb_trees.erl, line 276)
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)



Messages In This Thread
how to make plugins from the command line - by hartsantler - 09-08-2018, 10:00 PM
RE: how to make plugins from the command line - by micheus - 09-08-2018, 11:08 PM
RE: how to make plugins from the command line - by hartsantler - 09-20-2019, 03:59 AM
RE: how to make plugins from the command line - by micheus - 09-20-2019, 04:47 PM
RE: how to make plugins from the command line - by hartsantler - 09-21-2019, 04:47 PM
RE: how to make plugins from the command line - by micheus - 09-21-2019, 09:20 PM
RE: how to make plugins from the command line - by dgud - 09-23-2019, 06:46 AM
RE: how to make plugins from the command line - by hartsantler - 09-24-2019, 02:43 AM
RE: how to make plugins from the command line - by dgud - 12-09-2019, 07:43 AM

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

© Designed by D&D - Powered by MyBB

Linear Mode
Threaded Mode