LibrePCB / librepcb-rfcs

MOVED TO https://librepcb.discourse.group/
Apache License 2.0
3 stars 0 forks source link

3D models of packages and boards #32

Closed ubruhin closed 5 years ago

ubruhin commented 5 years ago

LibrePCB packages should have support for 3D models, so that we can implement a 3D board viewer & export.

In KiCad, footprints can have two different types of 3D models:

Although it's cumbersome to have two different file formats for 3D models, I guess this is the most reasonable solution. So I think it would make sense if we do it the same way...

Or are there other opinions?

dbrgn commented 5 years ago

VRML is horrible unfortunately... But I don't really know a good alternative.

On the other hand, using the same format as KiCAD would allow us to use their 3D models and vice versa. With the growing popularity of KiCAD, maybe better editing tools will pop up. KiCAD libraries are licensed CC-BY-SA, so we could use them. This is probably a case where converging on a common format would give the open source community a lot of benefits.

Also, it seems that nowadays FreeCAD can generate valid VRML files for KiCAD. That wasn't the case a few years ago :)

ubruhin commented 5 years ago

On the other hand, using the same format as KiCAD would allow us to use their 3D models and vice versa.

Yes, that would be really helpful!

KiCAD libraries are licensed CC-BY-SA, so we could use them.

Hmm I'm not sure if we really could/should use them. Actually I want to have all official LibrePCB libraries to be published under CC0, so that users can do absolutely everything with the libraries, without even worrying about their license. CC-BY-SA breaks this, as it has restrictions :(

dbrgn commented 5 years ago

It's a bit special, see https://github.com/KiCad/kicad-packages3D/blob/master/LICENSE.md. Their license would allow users of LibrePCB to use the files without having to attribute the copyright owner.

ubruhin commented 5 years ago

But as far as I understand, users of LibrePCB have to keep the CC-BY-SA license if they redistribute our libraries (containing the 3D models).

It's a mess. I really don't want to have such restrictions on our libraries, but without KiCad's 3D models it's very hard to get good 3D models :sob:

ubruhin commented 5 years ago

Hmm actually I think for the beginning it would be sufficient to support only STEP models. Compatibility with mechanical CADs is more important than realistic 3D previews, and 3D previews with STEP models look already pretty nice.

If really needed, we can still add support for VRML (or something else) some time later (e.g. for raytracing to get realistic looking 3D previews).

dbrgn commented 5 years ago

As long as we have the option to add more formats later on, I guess that's fine.

ubruhin commented 5 years ago

As long as we have the option to add more formats later on, I guess that's fine.

Sure, I think that should be possible.

I just wonder if there is really no 3D file format which allows both, export to MCAD and realistic previews with raytracing (incl. textures etc.)... Would be great to have only one format for everything. I think about something like the Povray or OpenSCAD file format. They are especially cool because they can be parameterized (good for library generators!). But at the end we need a STEP export, and I'm not sure if that's possible with these formats.

There must be some innovative ideas for this - just using STEP and VRML models is boring :grin:

dbrgn commented 5 years ago

OpenSCAD cannot export STEP files, and styling support for surfaces/materials is nonexistent. Although it would be awesome if we could somehow directly support OpenSCAD source files :slightly_smiling_face:

dbrgn commented 5 years ago

I found https://github.com/openscad/openscad/wiki/Project%3A-Add-support-for-exporting-models-in-STEP-format, but from this issue it doesn't look like something's actually in progress.

rnestler commented 5 years ago

just using STEP and VRML models is boring grin

Boring may be a good thing.

ubruhin commented 5 years ago

OpenSCAD cannot export STEP files, and styling support for surfaces/materials is nonexistent. Although it would be awesome if we could somehow directly support OpenSCAD source files slightly_smiling_face

Yes I know, I just mentioned OpenSCAD as an example for what I mean :)

Actually the PovRay format should support everything we would need. But I think it's also quite complex, and probably it would require high effort to integrate it in LibrePCB (for both, 3D preview and STEP export).

Boring may be a good thing.

I agree, but having STEP and VRML is not only boring for us developers, but also cumbersome for users because packages need 3D models in two different file formats containing exactly the same 3D model (just because STEP is missing textures, and VRML can't be used for MCAD). That's an incredible amount of duplicate data which could be avoided if there is a file format which allows both, realistic 3D preview and export to STEP.

ubruhin commented 5 years ago

So, if there is no better idea, I think we should go with only STEP models for the moment.

Probably most of the handling of 3D models could even be implemented in a separate library, independent of the LibrePCB source code (or maybe there even already exist such a library?). If someone is interested in developing such a library, I could try to define a clear interface, so no knowledge about LibrePCB internals would be needed to develop it (similar to the push&shove router library). Would be awesome if someone could work on such a library ;)

ubruhin commented 5 years ago

This issue was moved to https://librepcb.discourse.group/t/3d-models-of-packages-and-boards/23