-
Notifications
You must be signed in to change notification settings - Fork 328
Support for materials #1815
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
base: master
Are you sure you want to change the base?
Support for materials #1815
Conversation
This looks great, I wonder if there is ever a use case for a material to be a string in as an option in addition to these nice material classes you have here. I was wondering if something like this would be possible / useful
|
@shimwell it would certainly be nice to have some predefined materials, and maybe allow to use the material name for other things too. But let's start with making CI green. |
b5d0434
to
0ea2c5e
Compare
0ea2c5e
to
0dbe26c
Compare
38218df
to
36308a6
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1815 +/- ##
==========================================
+ Coverage 95.54% 95.57% +0.03%
==========================================
Files 28 29 +1
Lines 7319 7505 +186
Branches 1102 1131 +29
==========================================
+ Hits 6993 7173 +180
- Misses 195 198 +3
- Partials 131 134 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Material support in step exporting will get better in OCCT: |
Would probably nice to have a set of materials to get started, but I think, any real-world application will require custom material sets. (edit: for example https://physicallybased.info) |
VRML export runs, but is not correct yet. |
9bad718
to
a76304a
Compare
0f8b1d7
to
2a8410b
Compare
2a8410b
to
a4232a0
Compare
The PR would be ready from my side for a first iteration. I think it would be great to add textures later on, one could create quite good visualizations directly with cadquery/vtk. For the time, the PBR materials already achieve quite nice results. |
Thanks for all the hard work! Are the new classes picklable? |
Yes, they are pure dataclasses/basic python types, so everything can be pickled. How far is the progress on the serialization topic? Have you thought about using pydantic? I plan to implement model caching in our internal project and json would be easier to use in a db like with Postgres' JSONB column or redis' JSON datatype compared to pickle. |
Perfect, thanks! There are no plans to implement serialization beyond pickling which is already there. For caching I'd suggest joblib, but maybe you have something else in mind. |
Implemented material support.
In this approach, materials are stored in python dataclasses, the OpenCascade objects are only created when building the assembly.
Tests/docs are missing at the moment.