-
-
Notifications
You must be signed in to change notification settings - Fork 108
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
Material System #598
Comments
Currently, are there any standard tables used in the industry, and other major CAD/CAM software that cover physical properties and physical-based rendering? Would it be a good idea to adopt the format of standard tables such as matweb.com or ASM International? |
Or the Materials Project, which has API for querying data about a given material: https://next-gen.materialsproject.org/api Then each function can consult specific fields for that material according to its needs |
The Materials Project seems to be designed for chemistry/physics and doesn't seem to have a simple way to query metals like 5052 Aluminum which is common in the manufacturing industry. In addition, an API Key is required to access the data which makes seamless use by build123d users quite problematic. Having an option for the user to provide their own key and query such that build123d could look up the data and use it seems like a good thing to do though. There are industry standards for material naming and data (like Unified Numbering System A95052 for 5052 Aluminum) which could be used as a optional material descriptor to ensure consistency. Therefore, it seems like build123d needs its own DB of materials - maybe starting with the most common materials used in 3D printing, CNC machining and laser cutting - something like: Plastics:
Metals:
Woods:
Composites:
A JSON file could be used to store the data; how about something like this (will rendering data added eventually)? |
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:Modify/Add to the Materials Array: Add a new object to the materials array in the JSON structure, as shown in the example above. If the materials array does not exist, you will need to create it. Each object within the materials array represents a different material.
Define Material Properties: Within the material object, define the properties of your material, such as name, pbrMetallicRoughness, and any additional properties like textures or normal maps if needed. The pbrMetallicRoughness object is where you define the base color, metallicity, and roughness of the material.
Assign the Material to Mesh Primitives: Each mesh in the glTF file contains primitives, which are the actual geometry data. To apply your material to a mesh, you need to set the material index in the primitives to match the index of your material in the materials array. For example, if your new material is the first object in the materials array, its index is 0, and you would set "material": 0 in the mesh primitive(s) you want to apply it to.
A comprehensive material system would enable users to display and analyze their parts as real world objects.
The text was updated successfully, but these errors were encountered: