Contributing models made in Onshape

Hello! I’m interested in contributing to several symbols, footprints, and 3D models I’ve made to the KiCad library. I’ve done my best to make the symbols and footprints KLC-compliant; however, I have a question regarding the 3D models. I’ve made most of the models using Onshape, a free, browser-based CAD program. I noticed that M1.3 of KLC requires a generator file be supplied. I don’t think Onshape supports the creation of such generator files.

A few ways I can think to solve this are to (1) create a text file with a URL to the Onshape document (much like Google Docs, Onshape allows link-sharing) or (2) import a STEP file into FreeCAD and then save the project as an FCStd file.

The first option follows the spirit but not the letter of M1.3 because it would allow anyone to view, copy, and edit the features that created the original geometry. The second option follows the letter but not the spirit, as I would submit an FCStd file, but it wouldn’t include the ability to edit the model.

Are either of these options acceptable for contributing 3d models to the KiCad library? If not, are there any plans to allow for the contribution of 3d models using tools that don’t support generator scripts?

That’s not something I would call a program, it’s a service where I would have to sign in to, and it can vanish any time or keep my data as hostage. I’m not going to try if I can export a 3D source file from there.

Only if the STEP file is created by a script. If it’s made with some 3D modeling GUI, you need to provide the native file for editing.

Hi Eelik! Thanks for the reply. I understand your concerns about using tools that aren’t FOSS. I share them, which is why I opted to use KiCad :slight_smile:

Would it be acceptable to import a STEP file to FreeCAD and then submit the corresponding FCStd along with the original STEP file? While this wouldn’t preserve the original feature tree, it would provide a file ready for modification in KiCad’s preferred 3D modeling software.

I can’t say for the library maintainers what they would be willing to accept. Personally I would accept none of those two options, and not even sharing a source file which can’t be edited with an Open Source program. But that’s just my personal opinion. And I know 3D modeling (like EDA, too) isn’t so simple because program don’t interoperate well, unlike for example office suites for which import and, importantly, export compatibility is a life and death issue.

Ah, I see. Is this forum the appropriate place to get answers from library maintainers, or would a better approach be submitting a merge request and seeing what they say?

Maybe @kliment reads this and can comment. Or you can add a question as an issue to the issue database, Issues · KiCad / KiCad Libraries / KiCad Packages3D · GitLab.

1 Like

Thanks for tagging me @eelik - I was not aware of this thread

@Cameron_Urban I’ll bring this up with the other librarians and we’ll get back to you here.

1 Like

There are some guidelines in the KLC for contributing 3D models:

From the guidelines:

Files created in closed source tools are permitted. If a certain model is available designed in both an open and closed tool then the one from the open tool is preferred and will replace the other one.

This is detailed:

M2.3 Freecad is the preferred design tool

The goal of the KiCad 3d model library is to provide a free open library of 3d models. The use of open source design tools is preferred for this very reason.

Hi maui and paulvdh, thanks for the replies. I had read those sections of the KLC, however I don’t think they answer my question. Per M1.3:

The source files used to generate 3D model data must be submitted to this repository when a user contributes 3D model data.

However, in my case, there is no easily accessible source file, as the CAD program is browser-based. As a work around, I could export the file as a STEP and then import it into FreeCAD to create an FCStd file. This would make the part editable in a FOSS CAD program but eliminate its feature history. Or, I could share the model publically on Onshape with and include a txt file with the public model’s URL as a “source file.” This would allow another user to copy and edit it, with its feature history intact, but they’d need to make a free Onshape account.

Neither option is ideal, but I wonder if either is acceptable for contributing to the KiCad libraries.

According to The Open Source Definition – Open Source Initiative none of the two options fulfill the requirements for Open Source definition (although 3D model isn’t a program). In case of Onshape this is clear: the source code isn’t available.

The other requirement is more complicated.

The source code must be the preferred form in which a programmer would modify the program. Deliberately obfuscated source code is not allowed. Intermediate forms such as the output of a preprocessor or translator are not allowed.

STEP is an end product, not preferred form for editing. Packaging it inside other format doesn’t make it any more editable.

KiCad project doesn’t need to comply to any requirements or definitions from outside. However, if for example some linux distro lives up to their own requirements, they can remove non-complying packages. I guess Debian wouldn’t allow plain STEP if someone would raise discussion. I don’t know if there are any precedents.

Yes, we are 100% in agreement that Onshape is not open source, and that building a model from an open source program is better than doing so from a closed platform.

However, as previously pointed out, KLC does allow models created using closed source software if no open source model exists. The one condition is that the source file be provided so that the exported STEP and WRL can be edited if need be.

Therefore, it is my understanding that I would be allowed to contribute a model that I made in SolidWorks as long as I included the SolidWorks file along with the STEP and WRL.

If that is true, then I think that using Onshape with a URL supplied as a source file should be allowed (but not preferred) as well. The supplied SolidWorks file doesn’t meet the guidelines of open source either, and I’d argue that creating a free Onshape account is a lower barrier to entry than buying a SolidWorks license. However, I admit that this increased accessibility comes with increased data persistence concerns over the SolidWorks example.

I just want to reiterate that I agree this isn’t optimal. I’m purely curious if there’s a way that a browser based closed-source CAD platform could fit into the rules that already allow non-browser-based closed-source CAD platforms. Looking forward to hearing what some of the librarians think about this :slight_smile:

I think that one reason for the source file requirement is to check that the model has not been lifted from a manufacturer in violation of licensing terms. Far too many components have 3D models that cannot be freely passed on to 3rd parties.

1 Like

Just to make it clear: importing a STEP file into FreeCAD in order to pretend that you submitted a source makes absolutely no sense. You would only do that if there was some dumm automated workflow and you wanted to cheat the CI into believing that you submitted something valid.

The reasons for requiring the source include what @davidsrsb said (making sure that we are not violating the licence), but the main reason is to ensure that any changes can easily be applied later. There are several reasons why changes might be needed: some wrong dimensions may need to be fixed, material properties may need to be added/edited/improved, the model might not have been fused properly, maybe the step file could be optimized, maybe a decision is made to use a different scaling factor for WRL models, … it could be just about anything that turns out to be helpful to do in the long run. If the source is missing and some changes are required, the only options left are to leave the models in some undesired/buggy state, to delete them or to remake them from scratch (a lot of work). None of those options is ideal.

Having Oneshape source as URL most likely fully satisfies the needs for future editability. However, apart from persistence concerns (which is a major issue on its own), the main problem with any newly introduced source format is related to the shortage of manpower available to review contributions and maintain the libraries.

Until not so long ago, trivial merge requests for simple footprints might have been waiting for years before anyone even looked at them, let alone reviewed them and merged them. As a consequence the contributors gave up, moved on, and after a while many of the merge requests could not even be applied any longer due to merge conflicts, outdated format etc. While the situation improved recently after a number of volunteers stepped in to help, the team is still way too small and there are still approximately one thousand merge requests pending. Introducing a new format that no librarian is familiar with puts even more burden on those limited resources, potentially leading to even more delays reviewing the simple stuff.

This is by no means an official standpoint, but the standpoint could in theory change if suddenly a bunch of heavily motivated volunteers with high quality standards and solid knowledge of one specific software would show up and would be willing to make new models, review new contributions, maintain existing models, write tools to improve automation etc.

3 Likes

What would be your solution for real Open source 3d model? Is there a solution?

No.

Theoretically the solution would be to allow only models with source code in some format which can be fully imported to an Open Source 3D software. In practice this wouldn’t work. The KiCad 3D library must be compromised to get more models. I don’t like that, but fortunately I’m not the one whose responsibility it’s to decide these things.

I understand your point about open source. My question is mostly how do you imagine a 3d model source to begin with.
Just the simple parametric vs non-parametric design would make it impossible to share the “source code”.

I understand the suggestion to mean the originally created model file created in an open source 3D CAD package . . . so that the model can be modified and fixed if needed.

Not simply a STEP file imported in an open source package and then re-saved.

The 3D model’s source would be the original file which you do the work with. So if you are doing you work with FreeCAD, the source is .FCStd, and if you are working with Blender, the source is .blend. If you are doing you work with online service such as OnShape, then you don’t really have any source file.

Just the simple parametric vs non-parametric design would make it impossible to share the “source code”.

Technically you could do your model with non-parametric program and then submit it’s source file, but in practice that’s not the case usually, and you have to keep in mind the model could be rejected also because it’s not done well.

If you could export your source file to a file format such as .FCStd without loosing much of the useful information in it, that could be acceptable, but that’s never the case in practice, because most of the information is lost when exporting. A “real open-source model” would be one that could work with a free/libre software such as FreeCAD, and no useful information has been lost because of an export.

The two key issues that exist:

  1. License
    Who owns the original file, who is allow to distribute it. Kicad provided library assets are all licensed under Creative Commons CC-BY-SA 4.0 License and thus redistribution and re-use is possible. So the question is … when someone provides a 3D model just as a step, how does kicad know they are free to use it (and thus everyone else is free to use it). STEP does not include a methods to mark the license.
    While a lot of vendors provide a 3D model of their part, they have not licensed it as CC-BY-SA but more likely “all rights reserved” (ie they still hold ownership and a final say on who/where/how the model is used).

  2. Reproducibility
    If something has to be changed (error, improvement etc…) then without the original source file this is impossible without re-implementation in a tool.

These two should always be considered and that is why there is a freecad file (either generated programmatically or manually (ie freecad files or cadquery). There is no real open-standard for 3d parametric format, the FreeCAD format is the closest. None of the proprietary software supports it and their parametric files are closed-source and iirc have not been reproduced elsewhere

1 Like