SketchUp / api-issue-tracker

Public issue tracker for the SketchUp and LayOut's APIs
https://developer.sketchup.com/
38 stars 10 forks source link

Drawing text causes the Sketchup2021 to crash #721

Open LItterBoy-GB opened 3 years ago

LItterBoy-GB commented 3 years ago

SketchUp/LayOut Version: Sketchup 2021 OS Platform: windows10

  1. Runing the code.
    option = ['A', TextAlignLeft, '宋体', false, false, 3.mm]
    g = Sketchup.active_model.entities.add_group
    g.entities.add_3d_text(*option)
  2. Save the file.
  3. The SketchUp crash.

The '宋体' is a Chinese font. more

thomthom commented 3 years ago

I am not seeing a crash.

The file saves, and the hole in the A is filled (I suspect it's because the text is only 3 mm and we're running into issues with too small geoemtry.

image

Did you submit the BugSplat report? If you did, did you enter any details that we can use to look it up?

Also, what does Sketchup.version say for you?

LItterBoy-GB commented 3 years ago

@thomthom Sketchup.version : 21.1.299

image

c7b05fb28d276ec387b41ddb3813c137cd6cef79

Yes, because the height is too small. I solve it use the code.

option = ['A', TextAlignLeft, '宋体', false, false, 3.m]
g = Sketchup.active_model.entities.add_group
g.entities.add_3d_text(*option)
tr = Geom::Transformation.scaling(ORIGIN.transform(g.transformation),3.mm/3.m,3.mm/3.m,1)
g.transform! tr
DanRathbun commented 3 years ago

Probably can use: g.transformation.origin instead of ORIGIN.transform(g.transformation)

Also ...

g.transform!(g.transformation.set!(0.001))

... does the same as ...

tr = Geom::Transformation.scaling(g.transformation.origin, 0.001, 0.001, 1)
g.transform! tr
thomthom commented 3 years ago

The BugSplat report you submitted had no information in the text fields. It's hard to locate a bugsplat without any details. Can you submit one with the description "github issue 721" please?

LItterBoy-GB commented 3 years ago

@thomthom I draw a 3dtext and save model, then SketchUp crash. I commit the bug by SketchUp Error Report. env : windows 10 x64 , SketchUp pro 21.1.299

option = ['A', TextAlignLeft, '宋体', false, false, 3.mm]
g = Sketchup.active_model.entities.add_group
g.entities.add_3d_text(*option)
Sketchup.active_model.save 'test.skp'
thomthom commented 3 years ago

Did you submit it with some information I can use to look it up? I searched for "github issue 721" and found nothing.

Since I'm not able to reproduce this on my machine we need to locate your BugSplat report. But I need to be able to search for it.

LItterBoy-GB commented 3 years ago

I'm sorry I misunderstood that more information. image image

thomthom commented 3 years ago

Perfect! I found the crash report.

It's crashing while validating the model. I'm wondering this this is related to locale - which might be why I'm not seeing the crash.

Can you try something for me?

Add the text as in your example:

option = ['A', TextAlignLeft, '宋体', false, false, 3.mm]
g = Sketchup.active_model.entities.add_group
g.entities.add_3d_text(*option)

Instead of saving, go to Model Info > Statistics > Fix Model

image

Does that also crash? That will allow us to get a sense if this is related to saving or validating.

LItterBoy-GB commented 3 years ago

Yes, SketchUp crash. Crash #220839

thomthom commented 3 years ago

Thanks for testing that.

sketchupbot commented 3 years ago

Logged as: SKEXT-3253

LItterBoy-GB commented 2 years ago

@thomthom @sketchupbot Crash #254065 other text and fonts that will crash.

  option = ['新建图纸0', TextAlignLeft, '黑体', false, false, 5.mm]
  g = Sketchup.active_model.entities.add_group
  g.entities.add_3d_text(*option)