Skip to content

Commit

Permalink
Fix undefined front_texture in IfcTriangulatedFaceSetBuilder
Browse files Browse the repository at this point in the history
  • Loading branch information
jbrouwerdigibase committed Oct 13, 2024
1 parent d4df3c9 commit 00dace2
Showing 1 changed file with 4 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def self.build(ifc_model)
end

def initialize(ifc_model)
@ifc_module = ifc_model.ifc_module
@ifc_module = Settings.ifc_module
@ifc_model = ifc_model
@ifc_triangulated_face_set = @ifc_module::IfcTriangulatedFaceSet.new(ifc_model)
@ifc_triangulated_face_set.coordinates = @ifc_module::IfcCartesianPointList3D.new(ifc_model)
Expand Down Expand Up @@ -70,19 +70,16 @@ def set_faces(
add_parent_texture = faces.any? { |face| face.material.nil? }
add_material_to_model(parent_material) if add_parent_texture

front_texture = texture_exists?(front_material)
back_texture = texture_exists?(back_material) if double_sided_faces
parent_texture = texture_exists?(parent_material)
front_texture = texture_exists?(front_material) || false
back_texture = double_sided_faces ? (texture_exists?(back_material) || false) : false
parent_texture = texture_exists?(parent_material) || false

@mirrored = true if is_mirroring?(transformation)

meshes = faces.map { |face| [face.mesh(7), get_face_transformation(face).inverse] }

meshes.each do |mesh|
face_mesh, face_transformation = mesh
front_texture = texture_exists?(front_material) || false
back_texture = double_sided_faces ? (texture_exists?(back_material) || false) : false
parent_texture = texture_exists?(parent_material) || false

# Calculate UV transformation for parent texture if no texture is applied to the face
if !(front_texture || back_texture) && parent_texture
Expand Down

0 comments on commit 00dace2

Please sign in to comment.