Skip to content

[BUG] Materials found by search lack the vis properties except the first one #88

@bernhard-42

Description

@bernhard-42

Description

For the string assignment in build123d:

In [5]: b1 = Box(1, 1, 1)
   ...: b1.material = "Stainless 304"

I thought of using pymat.search.

Steps to Reproduce

see below

Expected Behavior

every material found comes with default vis properties

Actual Behavior

Unfortunately, only the first in a material chain provides it:

In [18]: m = pymat.search("Stainless Steel")

In [19]: m
Out[19]: 
[Material('stainless', ρ=8.0 g/cm³),
 Material('stainless.s303', ρ=8.0 g/cm³),
 Material('stainless.s304', ρ=8.0 g/cm³),
 Material('stainless.s316L', ρ=8.0 g/cm³),
 Material('stainless.s17_4PH', ρ=7.8 g/cm³),
 Material('stainless.s316L.passivated', ρ=8.0 g/cm³),
 Material('stainless.s316L.electropolished', ρ=8.0 g/cm³)]

In [20]: m[0]
Out[20]: Material('stainless', ρ=8.0 g/cm³)

In [21]: m[0].vis
Out[21]: Vis(source='ambientcg', material_id='Metal012', tier='1k', finishes={'brushed': {'source': 'ambientcg', 'id': 'Metal012'}, 'polished': {'source': 'ambientcg', 'id': 'Metal049A'}, 'dirty': {'source': 'ambientcg', 'id': 'Metal049B'}}, roughness=0.3, metallic=1.0, base_color=(0.75, 0.75, 0.77, 1.0), ior=None, transmission=0.0, clearcoat=None, emissive=None)

In [22]: m[1].vis
Out[22]: Vis(source=None, material_id=None, tier='1k', finishes={}, roughness=None, metallic=None, base_color=None, ior=None, transmission=None, clearcoat=None, emissive=None)

Environment

any

Additional Context

No response

Possible Solution

No response

Changelog Category

Fixed

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions