Skip to content
This repository has been archived by the owner. It is now read-only.

3D models of packages and boards #32

Closed
ubruhin opened this issue Oct 25, 2018 · 13 comments

Comments

@ubruhin
Copy link
Member

commented Oct 25, 2018

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:

  • VRML for 3D board viewer and raytracing
  • STEP for export to mechanical CAD

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

This comment has been minimized.

Copy link
Member

commented Oct 25, 2018

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

This comment has been minimized.

Copy link
Member Author

commented Oct 26, 2018

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

This comment has been minimized.

Copy link
Member

commented Oct 26, 2018

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

This comment has been minimized.

Copy link
Member Author

commented Oct 26, 2018

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 😭

@ubruhin

This comment has been minimized.

Copy link
Member Author

commented Oct 28, 2018

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

This comment has been minimized.

Copy link
Member

commented Oct 28, 2018

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

@ubruhin

This comment has been minimized.

Copy link
Member Author

commented Oct 28, 2018

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 😁

@dbrgn

This comment has been minimized.

Copy link
Member

commented Oct 29, 2018

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 🙂

@dbrgn

This comment has been minimized.

Copy link
Member

commented Oct 29, 2018

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

This comment has been minimized.

Copy link
Member

commented Oct 29, 2018

just using STEP and VRML models is boring grin

Boring may be a good thing.

@ubruhin

This comment has been minimized.

Copy link
Member Author

commented Oct 31, 2018

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

This comment has been minimized.

Copy link
Member Author

commented Nov 8, 2018

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

This comment has been minimized.

Copy link
Member Author

commented Dec 14, 2018

@ubruhin ubruhin closed this Dec 14, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
3 participants
You can’t perform that action at this time.