As you probably know ... #e3d_file is an intermediate data format. I will find you a snippet that converts into #we{ }
So ... wpa:import(E3dFile0, St0)
will get the data into the current wings state #st{}
And then you can just find the last item into that state if you want.
Code:
carveCSGImport(FileName) ->
case e3d_obj:import( getTempDir() ++ "/" ++ FileName ) of
{ok,{e3d_file,[],[],[],_}} ->
{ empty, error };
{ok,E3dFile0} ->
NameNow = io_lib:format("polyhead~p_~p_~p", tuple_to_list(erlang:now()) ),
#e3d_file{} = E3dFile0,
St0 = newSt(), %% Worried about impact of this new wpa:import on coffin speed. Need test !
St = wpa:import(E3dFile0, St0),
Wes = gb_trees:values(St#st.shapes),
WeNew = wings_we:merge(Wes),
{ok,WeNew#we{name=NameNow}};
_OTHER ->
_OTHER
end.
So ... wpa:import(E3dFile0, St0)
will get the data into the current wings state #st{}
And then you can just find the last item into that state if you want.