I've also bumped into the Zoom Extents Bug

Wait! I think I’ve gotten a similar error when moving around vertices of a face having a 2D text added to it. I’ve downloaded your model and it seems to be the same problem :smiley: .

If you run this code you’ll see that one text is at the position NaN, NaN, NaN.

Sketchup.active_model.active_entities.grep(Sketchup::Text).map { |t| t.point.to_a }

The following code deletes the invalid text but doesn’t update the bounding box of the model, meaning rendering is still off. Saving and reopening the model seems to solve that half of the problem though :smiley: .

Sketchup.active_model.active_entities.grep(Sketchup::Text).each { |t| t.erase! if t.point.to_a.any?(&:nan?) }

Before running the code deleting the text you can run this code to print the text of the corrupted text so you know what text is missing and can manually add it back where it should be. (“the text of the text” sounds weird but I hope you get what I mean).

Sketchup.active_model.active_entities.grep(Sketchup::Text).to_a.each { |t| puts t.text if t.point.to_a.any?(&:nan?) }; nil

The question now for the SketchUp team to solve is why the text gets corrupted in the first place and why the validity check doesn’t find it.

I hope people will still buy my plugin despite this fix :open_mouth: :stuck_out_tongue: .

4 Likes