Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add script to generate 3D models for TO-92 #120

Merged
merged 1 commit into from
Oct 16, 2023
Merged

Add script to generate 3D models for TO-92 #120

merged 1 commit into from
Oct 16, 2023

Conversation

ubruhin
Copy link
Member

@ubruhin ubruhin commented Oct 8, 2023

I already had the situation several times that I wanted to generate a 3D model for a package which was created by hand and without the intention to also generate the package because it's just a single (or a few) package not worth to generate. One example is TO-92, but there are many more such packages.

However, so far this repository contains only generators creating the complete library elements. So I wonder how we should handle the case where we only want to generate the 3D model. Initially I started with a new top-level directory called "3d" which would contain pure 3D generators, and a corresponding "out" directory. However, I think this doesn't work because the dependency cadquery_helpers.py is in the top level directory ("ImportError: attempted relative import with no known parent package").

So for now I came up with just adding the new script generate_to92.py and its output directory out_3d to the root directory. Maybe that's actually not that bad since those scripts might some day be extend to also generate the whole package, then they are already at the correct location.

Note that we cannot reuse the existing out directory for plain 3D models because the out directory is intended to be copied 1:1 into a LibrePCB workspace, while the 3D models need to be imported manually into the LibrePCB library editor. So the new script just writes some 3D models into out_3d/to92/ and these STEP models then need to be manually loaded into LibrePCB.

Theoretically we don't need to store these scripts (because no UUIDs are generated, no cache is needed) but of course it would be nice to still have the source of the 3D models stored somewhere.

Any opinions/ideas welcome!

Btw, here the generated models:

librepcb-to92

@ubruhin
Copy link
Member Author

ubruhin commented Oct 16, 2023

No comments = no objections, thus merging as-is. Could still be commented if there is some feedback.

@ubruhin ubruhin merged commit a2c5bb8 into master Oct 16, 2023
8 checks passed
@ubruhin ubruhin deleted the to92-3d branch October 16, 2023 09:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant