gumyr / build123d

A python CAD programming library
Apache License 2.0
386 stars 72 forks source link

Material System #598

Open gumyr opened 3 months ago

gumyr commented 3 months ago

Currently the material attribute of a shape is defined as a user defined string. Materials could be enhanced by creating a data structure that would contain two types of information:

Material properties would then be defined for a wide range of materials such as ABS, 2024 T3 Aluminum, Delrin, 316 Stainless Steel, etc. so the user could just assign a material to their part.

The physical properties could be used when calculating part mass or stiffness while the PBR parameters would be used when rendering the material though a viewer or when exporting to file formats that support such information such as glTF or 3MF.

The OCCT XDE (eXtended Data Exchange) document (used when generating many of the export file formats) only supports storing a material label so additional information would need to be added by directly enhancing the exporters. For example, the export_gltf function would need to edit the generated JSON file as follows:

A comprehensive material system would enable users to display and analyze their parts as real world objects.