Skip to content

Commit

Permalink
Merge pull request #582 from elblake/eb/x-normal
Browse files Browse the repository at this point in the history
X importer hard edges fix
  • Loading branch information
dgud authored Sep 24, 2024
2 parents 4aa697e + 8832eac commit ea6e3a1
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions plugins_src/import_export/x_import.erl
Original file line number Diff line number Diff line change
Expand Up @@ -106,14 +106,12 @@ import_mesh(ObjName, #x_mesh{vslist=Vs_0,fslist=Fs_0,normals=Ns,texcoords=TxC_0,
_ when is_list(ML) ->
{Efs, NsC} = to_efs_mtl(Fs_0, Ns, TxA, ML)
end,
HEs = all_edges([X || #e3d_face{vs=X} <- Efs]),
Mesh = #e3d_mesh{
type=polygon,
vs=Vs,
fs=Efs,
tx=TxC,
ns=NsC,
he=HEs
ns=NsC
},
Obj = #e3d_object{name=ObjName,obj=Mesh},
Obj.
Expand Down Expand Up @@ -924,17 +922,6 @@ split_mesh_mtls_1(#x_mesh{matlist={MatList, MSpecs}}=Mesh) ->
{Mesh#x_mesh{matlist=MatList}, MSpecs}.


edge_pairs([E|_]=Fs) ->
edge_pairs(Fs, E, []).
edge_pairs([E1|[E2|_]=Fs], E0, OL) ->
edge_pairs(Fs, E0, [{E1,E2}|OL]);
edge_pairs([E1], E0, OL) ->
lists:reverse([{E1,E0}|OL]).

all_edges(FL) ->
lists:append([edge_pairs(F) || F <- FL]).


%% Read the .x file, and return the content to the tokenizer
%%
read_xof(Filename) ->
Expand Down

0 comments on commit ea6e3a1

Please sign in to comment.