Treat grouped mesh as sketchup entity (#449)
Build and deploy / build (push) Has been cancelled
Build and deploy / deploy-installers (push) Has been cancelled

This commit is contained in:
Oğuzhan Koral
2026-01-30 10:34:27 +03:00
committed by GitHub
parent 96cd122645
commit 760d8a033d
3 changed files with 9 additions and 8 deletions
@@ -105,9 +105,6 @@ module SpeckleConnector3
# @param entity [Sketchup::Entity]
def entity_has_changed?(entity)
# We do not necessarily consider grouped meshes for caching?
return false if entity.is_a?(SpeckleObjects::Geometry::GroupedMesh)
speckle_state.changed_entity_persistent_ids.include?(entity.persistent_id.to_s) ||
speckle_state.changed_entity_ids.include?(entity.entityID.to_s)
end
@@ -102,8 +102,8 @@ module SpeckleConnector3
grouped_meshes = faces.group_by { |face| [face.layer, face.material || face.back_material] }
grouped_meshes.each do |(layer, mat), faces|
material_id = mat.nil? ? 'none' : mat.persistent_id.to_s
grouped_mesh_id = "#{layer.name} - #{material_id} - #{entity.definition.persistent_id.to_s}"
grouped_mesh = SpeckleObjects::Geometry::GroupedMesh.new(faces, layer, mat, grouped_mesh_id)
# grouped_mesh_id = "#{layer.name} - #{material_id} - #{entity.definition.persistent_id.to_s}"
grouped_mesh = SpeckleObjects::Geometry::GroupedMesh.new(faces, layer, mat)
flat_atomic_objects[grouped_mesh.persistent_id.to_s] = grouped_mesh
definition_proxy.add_object_id(grouped_mesh.faces.first.persistent_id.to_s)
end
@@ -28,15 +28,19 @@ module SpeckleConnector3
# @return [Sketchup::Material] material that faces belong to
attr_reader :material
# @return [String] structured id for grouped mesh
# @return [String] fake id for grouped mesh
attr_reader :persistent_id
# @return [String] fake id for grouped mesh
attr_reader :entityID
# @return Hash{String=>Sketchup::Face}
attr_reader :mesh_groups
def initialize(faces, layer, material, persistent_id)
def initialize(faces, layer, material)
@faces = faces
@persistent_id = persistent_id
@persistent_id = faces.first.persistent_id.to_s
@entityID = faces.first.persistent_id.to_s
@layer = layer
@material = material
@mesh_groups = {}