is my definition for a 3D model, but I cant make an appropriate copy method to duplicate a model,
Do I have to memcpy ever array, or can I memcpy arrays of structs?
I dont know Ive been stuck for ages, please help someone..

If you have a terminology and you stick with it then there isn't much of a problem. Personally I hate ijk for loop variables because ijk has meaning in mathematics. Similary why I don't generally use xyz or uvw either. However I use all the time abc (efg if needed) for unimportant loop varaibles. Not everything needs to be spelt out.

However... If you find somewhere down the line that you need to change a variable name from a single or dual character to something more verbose, search and replace will be a bit nastier to do.

Typically I'd use...
vlist, elist, flist,
vcount, ecount, fcount
vindex, eindex (or eidx), findex,
for example. But this is just part of style and preference which is a pretty personal choice apparently.

Also just to nitpick as nitpicking is being done already...
vertex is just an array of 3 floats. I'd actually use float x,y,z; instead of the array of floats. It's more explicit and you could always hack it and cast it off as a pointer to 3 floats if you need it that way. Similarly for the normal in the face structure should be of type vertex instead of another array of 3 floats.

One note of nitpick more is that the model will not account for the case of two triangles stuck back to back all that well. Or I could be wrong about the your mental model. In this case the face->f[] would really only have one other face index in that array instead of 3 unique indicies which I'm assuming is expected. But you may have already put conditions on the model from that other post you made not too long ago.

Quote:hack it and cast it off as a pointer to 3 floats if you need it that way

How could you do that, the reason im using a array of 3 floats, is because I had to do nasty stuff with the same code written out three times, using abc then, bca, then cab.

Quote:two triangles stuck back to back all that well

Why you would want to slice two back too back triangles I have no idea.
But yeah, define the three vertices, then define two faces, one clockwise one counterclockwise.
all three face->f would be the other side, because face->f is the adjacent side (when f[0] is the adjacent side across face->e[0] and that opposite face-v[0])

The compiler may warn but it may also be smart enough to know that all that is stored in Point is essentially 3 floats. Although I wouldn't deliberately design this way. func would probably not be one of my functions but maybe some other library where it will expect arrays of floats instead of an array of some Point/Vertex/Vector structure but under the hood in memory they are the same.

Quote:Why you would want to slice two back too back triangles I have no idea.

I'm just being and idiot. But then, a user of your product (assuming it'll be hacked on if it gets released.) may be an idiot and create a plane with a triangle wing where the top side is mated with the bottom side (assuming back face culling is used and that this trick might be of use.) Yes you won't see much of anything in a profile but this idiot may not care. Also if such a wing was connected to a body of the craft that wasn't as stupidly made the 2 faces per edge fails and 3 adjacent faces per face fail.

Quote:But yeah, define the three vertices, then define two faces, one clockwise one counterclockwise.
all three face->f would be the other side, because face->f is the adjacent side (when f[0] is the adjacent side across face->e[0] and that opposite face-v[0])

idiot, no.
It would work for that though, because It generates all the edges, and for duplicate edges, instead of adding it twice it just says, this face is adjacent to that one.
So in that case the triangles will just be adjacent to each other, three times.

yeah, thats just some specifics of my model class, it works how you define triangles for sine law
a/sinA=b/sinB=c/sinC
the a, b, c are opposite A, B, C, and the adjacent triangles are ordered two, so Its a good system.