@jim said:
@tig said:
GC.start is Jim's baby - built-in - As I understand it you start if before making the groups ?
I thought I learned of it on this forum!
I don't think it's the GC that's slowing adding geometry - more likely it is Sketchup looking to make faces and break overlapping geometry as geometry is either added or exploded. (pure conjecture.)
Try this:
` def addfaces(ents = Sketchup.active_model.entities)
vertices = [Geom::Point3d.new(0,0,0), Geom::Point3d.new(1,0,0),Geom::Point3d.new(0,1,0)]
start = Time.new
1000.times do
ents.add_face vertices
end
puts "Same tris took #{(Time.new - start)}"
start = Time.new
1000.times do
ents.add_face vertices
vertices[0].z += 0.1
vertices[1].z += 0.1
vertices[2].z += 0.1
end
puts "different tris took #{(Time.new - start)}"
start = Time.new
1000.times do
ents.add_face vertices
vertices[0].z += 0.1
vertices[1].z += 0.1
vertices[2].z += 0.1
end
puts "more different tris took #{(Time.new - start)}"
end
addfaces`
Firstly adds 1000 triangles using the same coordinates, secondly adds 1000 triangles with unique vertices, lastly adds another 1000 triangles with unique vertices. Shows a 10x difference in performance, yet the geometry engine will be constructing the topology in all cases - ie doing work.
This would seem to indicate its an insertion bottleneck - which is consistent with thomthom findings.
What does it mean? It means its a brick wall and adding geometry in SU is slow and there is nothing you can do about it.