Skip to content

Commit 0dbe26c

Browse files
fixup! Added materials
1 parent e79768b commit 0dbe26c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

cadquery/occ_impl/assembly.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,9 @@ def toCAF(
224224
vmtool = XCAFDoc_DocumentTool.VisMaterialTool_s(doc.Main())
225225

226226
# used to store labels with unique part-color-material combinations
227-
unique_objs: Dict[Tuple[Color, Material, AssemblyObjects], TDF_Label] = {}
227+
unique_objs: Dict[
228+
Tuple[Optional[Color], Optional[Material], AssemblyObjects], TDF_Label
229+
] = {}
228230
# used to cache unique, possibly meshed, compounds; allows to avoid redundant meshing operations if same object is referenced multiple times in an assy
229231
compounds: Dict[AssemblyObjects, Compound] = {}
230232

@@ -474,9 +476,7 @@ def toVTK(
474476
if element.material.pbr:
475477
actor.GetProperty().SetMetallic(element.material.pbr.metallic)
476478
actor.GetProperty().SetRoughness(element.material.pbr.roughness)
477-
actor.GetProperty().SetRefractionIndex(
478-
element.material.pbr.refraction_index
479-
)
479+
actor.GetProperty().SetBaseIOR(element.material.pbr.refraction_index)
480480
if element.material.pbr.emissive_factor:
481481
actor.GetProperty().SetEmissiveFactor(
482482
*element.material.pbr.emissive_factor.rgb()

0 commit comments

Comments
 (0)