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

Material System #598

Open
gumyr opened this issue Mar 22, 2024 · 0 comments
Open

Material System #598

gumyr opened this issue Mar 22, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@gumyr
Copy link
Owner

gumyr commented Mar 22, 2024

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:

  • Physical Properties Attributes like: density, strength, stiffness
  • Physically Based Rendering (PBR) Attributes that impact the appearance of a material when rendered, such as: ambient, diffuse, specular, and emmissive colors, shininess, transparency, etc.

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.

@gumyr gumyr added the enhancement New feature or request label Mar 22, 2024
@gumyr gumyr added this to the Not Gating Release 1.0.0 milestone Mar 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant