GithubHelp home page GithubHelp logo

jeremyansel / jeremyansel.media.wavefrontobj Goto Github PK

View Code? Open in Web Editor NEW
10.0 10.0 6.0 6.55 MB

A .Net library to handle Wavefront Obj .obj and .mtl files.

Home Page: https://jeremyansel.github.io/JeremyAnsel.Media.WavefrontObj/

License: MIT License

C# 99.71% Batchfile 0.29%

jeremyansel.media.wavefrontobj's Introduction

Top Langs Jérémy Ansel's GitHub stats

jeremyansel.media.wavefrontobj's People

Contributors

derekdiamond avatar jeremyansel avatar rudcode avatar vpenades avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

jeremyansel.media.wavefrontobj's Issues

usage of IList interfaces in collections.

Hi, I've recently found your WavefrontObj library, and I'm impressed of its level of completeness, I think it's the first time I've seen a wavefront library to handle all the primitives of the format!

I have a small issue with the API, though:

Internally, the library uses List<T> , but public API uses IList<T>

the difference may look trivial at first sight, but there's some critical usability Issues;

.Net has two interfaces for accessing lists: IReadOnlyList<T> and IList<T> , both are implemented by List<T>

At the time these interfaces where introduced, it would had made sense that IList<T> also implemented IReadOnlyList<T> because after all, it has all the methods required to do so, but this didn't happen. and as a consequence of this ill design, there's lots of limitations of what you can do with these interfaces. There's a heated debate at dotnet about how to fix this issue in .Net , but I don't think they're going to find a solution for this any time soon.

The practical consequience is that the properties exposing IList<T> cannot be used on methods requiring IReadOnlyList<T> even if the internal List<T> does implements it.

So my suggestion would be this:

Fully expose List<T> in the public API on those methods and properties that expect you to modify the list. This change would be transparent to current users of the library because List<T> has the same funcionality of IList<T>, with the advantage of also exposing IReadOnlyList<T>.

Conversely, if there's properties exposing IList<T> in a way that the users are not supposed to modify the list in any way, just return IReadOnlyList<T> to better reflect the intentions of the API.

A usemtl statement has too many values

Whitespaces in the material name cause an exception when calling ObjFile.FromFile(filePath);

For example:
usemtl name with whitespaces

Other 3D tools like blender or threejs are allowing whitespaces in the material name.

Would it be possible to allow whitespaces in this library too?

Adding comments?

Is there a way to insert custom comments into the obj file during output? I'd like to add some comments at the top of the files I'm creating. Thanks.

Whitespace inside .mtl

Hi, I have this .mtl file that have something like this

map_Bump Amaranth Seed_N.png
map_Kd Amaranth Seed_D.png

and I got this error

A filename must have an extension.

I think the error came from this line but I have no idea how to fix it properly, thank you.

quality of life improvements

Hi

With your permission, I would like to open several PRs for some quality of life improvements:

  • implicit Conversions between ObjVectorX and System.Numerics.VectorX.
  • Add DebuggerDisplay attributes to several classes to improve debugging experience.

Let me know what you think about these changes

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.