Open mrdoob opened 9 years ago
BTW: I've lately spoken with a colleague and he told me that IFC is based on the STEP format which is well known in the CAD community. In general, STEP is really hard to parse and you would need to write a custom parser similar to VRMLLoader
. However, IFC files can also be expressed in XML (they have the .ifcxml
extension). Such files would be way easier to handle (see 3MFLoader
or ColladaLoader
) so the loader could focus on the actual geometry data building. Maybe it's easier to create a loader that only supports .ifcxml
at the beginning?
@mrdoob, @Mugen87
Why not?
Because
The loader will be 5 times bigger than the Threejs library.
and i use Class
with latest javascript features.
IFC is based on the STEP format which is well know in the CAD community.
Yes, one day i will show you what i'm doing with Threejs ;)
IFC files can also be expressed in XML (they have the .ifcxml extension). ... Maybe it's easier to create a loader that only supports .ifcxml at the beginning?
The parsing is clearly not a big problem. But The geometries generation is ! Because ifc format does not contain any geometries. But use interpolation/interaction between objects to determine the final geometry.
Anyway, if you want it, maybe you should create a specific branch for this before taking any decision. Just to see the BIG thing.
The loader will be 5 times bigger than the Threejs library.
Well yes, if the loader is not so compact as the others, it's probably better to put the code into a separate repository.
@Itee Any plan to release the IFCLOADER anytime soon? Would be interested to see the BIG thing
Not aware of anyone willing to contribute it and maintain it...
I'm using IfcOpenShell 's IFC converter happily, it makes nice geom and materials, can do Collada DAE (which we use to import to Unity), IIRC OBJ and was there glTF nowadays too
I'm using IfcOpenShell 's IFC converter happily, it makes nice geom and materials, can do Collada DAE (which we use to import to Unity), IIRC OBJ and was there glTF nowadays too
But do you use any of the IFC data like Buildingstorey, Site, etc? There's no doubt the web would be better off being able to parse IFC and not this shitty client-server thing everyone's dealing with.
I've given this a shot recently. I've managed to generate some geometry
But it should actually be this:
The basic thing that went wrong is the actual placement and rotation here and my 3D maths are next to non-existent (I simply don't have the patience).
Though there are many classes in the IFC schema. The eventual filesize could be reduced by using Typescript interfaces and using functions to look up and apply the arguments of each 'STEP' in the file.
Bottomline, for an IFC Loader; I don't know if we've got ourselves a 3D Maths genius, because that would solve a lot of problems parsing the mathematical relations while constructing the geometry.
But do you use any of the IFC data like Buildingstorey, Site, etc?
Yes, via Tridify's conversion service, which uses IfcOpenShell as well (I've also used it locally) for the geom. I figure those metadatas are what is easy to parse.
The geometry generation is indeed nontrivial. If you wanna do it in the browser, maybe you can compile IfcOpenShell to WebAssembly and use it as a library from your Javascript. It's plain C++ with no GUI or anything, just a library for which there is a commandline interface separately, so it might be easy to build for the web too. Parsing IFCs is kinda heavy so getting the WASM performance and low memory footprint might be nice. And the lib does a beautiful job at creating the geom.
@MaartenBreeedveld I can help with the maths, for the theoretical basis I have non doubt and I have some experience with ifc, in fact there could be several transformations in series required for the world coordinates. For the implementation in three.js perhaps it will be possible to optimize it.
But do you use any of the IFC data like Buildingstorey, Site, etc?
Yes, via Tridify's conversion service, which uses IfcOpenShell as well (I've also used it locally) for the geom. I figure those metadatas are what is easy to parse.
The geometry generation is indeed nontrivial. If you wanna do it in the browser, maybe you can compile IfcOpenShell to WebAssembly and use it as a library from your Javascript. It's plain C++ with no GUI or anything, just a library for which there is a commandline interface separately, so it might be easy to build for the web too. Parsing IFCs is kinda heavy so getting the WASM performance and low memory footprint might be nice. And the lib does a beautiful job at creating the geom.
We've tried this in the past. But the WASM compiled version is a 40MB download I guess this is due to all the referenced libraries in ifcConvert.
@Jesusbill, Awesome! Currently, I've got no time to work on this project. But if it's okay, I'll come back to you.
Awesome! Currently, I've got no time to work on this project. But if it's okay, I'll come back to you.
Sounds good @MaartenBreeedveld
Added VDBLoader
to the list. https://www.openvdb.org/
Any idea about IFCLOADER? @mrdoob
Nope
Regarding a 3dm loader: I've started work on this now that the openNURBS library has been compiled to wasm thanks to emscripten (rhino3dm).
I'm working on this here and have mesh, breps, extrusions, pointclouds, materials, layers, and groups support started and working.
Relevant files:
I hope to submit a PR that has support for more object types sometime soon. I must admit that I've little experience with web workers, and am leaning on the draco and basis loader examples. Hopefully #18234 simplifies this a bit.
p.s. we are already adding threejs support directly to the rhino3dm.js library like here and here.
Edit: update links to point to McNeel org fork.
We can check this one off ;)
IFCLoader
just landed! š¾ #20598
Any update about M2Loader? Anyone working with that?
@Faq Not that I know of...
FYI: TIFFLoader
has been added via #24420 š .
Any update about M2Loader? Anyone working with that?
I've recently implemented a basic loader for M2 assets for a small personal project. If you want to play around with the code, you can access it via: https://gist.github.com/Mugen87/c96757cec0f7ec02214d6fdea880dec9
Use M2Loader
like so:
const loader = new M2Loader();
loader.load( 'models/m2/cat/druidcat2.m2', function ( mesh ) {
scene.add( mesh );
} );
And you get:
We can potentially add the loader's code to the repo. However, adding an example is problematic since all M2 assets I have found so far are directly from WoW and not available under an appropriate license.
Independently, I would love to add more features to the loader over time. Especially animations and multi-textured assets as well as supporting more asset versions.
I've played World of Warcraft in the past (nightelf druid, feral build) and loved the entire art design so much. Now seeing game assets rendered so nicely with three.js
makes me a bit emotional š.
Multi-textured assets work now (example 7ne_druid_worktable02.m2
):
Now comes the most complex part: Skeletal animation.
I've created a new repository three-m2loader
for maintaining/developing M2Loader
. When the loader is more mature and we have some CC licensed assets, we can consider to add an external example to the three.js
repo.
List of loaders that would be nice to have:
3D
13768
14219
Bitmap
Vector