Rate of Adding Faces
-
Nothing surprising here, I would guess. It shows as the amount of geometry increases, the slower new geometry is added.
The method.
I used a .stl file of 3,112 triangles. The triangles were first read into an Array of Arrays:
[ [v1, v2, v3], [v1, v2, v3], ... ]
I used a repeating timer to add the faces 50 at a time (partition size) to a new Group.
` UI.start_timer(0.001, true) do
entities.add_faces(verts[i])increment counter variables, etc
end`
and ccalculated the time and rate for each partition. I did not use start_operation/commit_operation transactions.
This graph shows the time increase for each partition of 50 faces added. You can see the first 50 took almost no time, but by the end each partition was taking more and more time.
I am prototyping a way to prevent SketchUp from entering the "Not Responding" state when adding significant amounts of geometry. Looks good so far. I am able to keep SketchUp responsive, but at the cost of even longer import times. Although this makes possible the ability to watch the progress of adding geometry, as well as being able to abort the operation.
-
This is how it works. I set the response window 0.07 seconds, so there is almost no lag. Probably a setting of 5 seconds would provide frequent enough updates to allow an abort, and still be nearly as fast as possible.
You can see it locks up near the end. Most likely because I don't have the computer memory (512 MB!)
-
Yea - I noticed this as well. I found building a mesh to be fastest. http://forums.sketchucation.com/viewtopic.php?f=180&t=25305&p=217249&hilit=mesh#p217180
-
That is very interesting Jim. It is building the object while you're off doing other stuff? What heppeneds if you start adding lines and faces to that statue while it is being built?
Chris
-
You can do other stuff while it's working. You can open the Group and make changes as it's working, but no guarantees if you do it.
I found using fill_from_mesh is very, very fast compared to add_faces, so this might be a purely academic pursuit.
I wonder if a plugin such as TIG's center of Gravity would benefit - it "white-screens" my SketchUp almost every time I try it. The calc would take longer, but would allow me to keep modeling while the CofG is calculated - that would be an acceptable trade-off for me.
-
Could plugins lock the component they are adding faces to so that the user can not edit them and mess things up as easily?
-
@jim said:
This is how it works. I set the response window 0.07 seconds, so there is almost no lag. Probably a setting of 5 seconds would provide frequent enough updates to allow an abort, and still be nearly as fast as possible.
You're using a timer of some sort?
Advertisement