jeremyansel / jeremyansel.media.wavefrontobj Goto Github PK
View Code? Open in Web Editor NEWA .Net library to handle Wavefront Obj .obj and .mtl files.
Home Page: https://jeremyansel.github.io/JeremyAnsel.Media.WavefrontObj/
License: MIT License
A .Net library to handle Wavefront Obj .obj and .mtl files.
Home Page: https://jeremyansel.github.io/JeremyAnsel.Media.WavefrontObj/
License: MIT License
It would be very kind if you could add this overload to ObjMaterialFile and ObjFile, otherwise underlying streams are automatically disposed and have to be reread or copied.
If an obj with "mtllib my cool material.mtl" is read, an exception is beeing thrown that the file has no extension.
Could this be fixed accordingly to #3?
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.
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?
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.
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.
Hi
With your permission, I would like to open several PRs for some quality of life improvements:
Let me know what you think about these changes
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.