# Issue related to BoundaryDiscretizeGraphics

Bug introduced in 11.3

I was revisiting an earlier problem of mine related to designing 3D objects with extruded text for 3D printing. The accepted answer no longer works in V11.3 if a certain subset of letters are used. For example, while this works as expected:

 BoundaryDiscretizeGraphics[Text[#], _Text] & /@ CharacterRange["A", "C"]


a slight modification results in failure to discretize the graphics.

BoundaryDiscretizeGraphics[Text[# <> #], _Text] & /@ CharacterRange["A", "C"]


Working through various pairs of letters, it appears as if BoundaryDiscretizeGraphics fails if neither of the letters contains an annulus (correct math term?). So "AA" and "AC" will both work, but with "CE" and "CD", only the latter text will be rendered properly.

Of the single letter options, only lower case "i" and lower case "j" fail, which somehow makes sense because in these two cases, there exists two regions, neither of which have an annulus.

All of these problems are not present in the 11.2 version on the Raspberry Pi.

While this is primarily a public service announcement, I am looking for suggestions for workarounds to creating letter-shaped regions. My application requires that it work on both traditional desktop platforms as well as the Raspberry Pi, so timing does become a concern.

• I observe the same with version 11.3 on Windows 7 x64. Tagging as a bug. – Alexey Popkov May 30 '18 at 9:13

I think it is worth reporting this issue to support.

To see what might be going on, try DiscretizeGraphics instead:

DiscretizeGraphics[Text["CC"], _Text]


You'll notice that the output appears to be a non-simple polygon, and I think this is why BoundaryDiscretizeGraphics fails to produce a region. To workaround this issue, you can insert a small space between the letters:

BoundaryDiscretizeGraphics[Text["C\[VeryThinSpace]C"], _Text]


Update

The OP in a comment mentioned that my workaround doesn't help for letters that have disconnected pieces, e.g., "i".

Another possibility for creating a region from letters is to use an ImportString/ExportString round trip to the "PDF" format, which creates a Graphics object, and then discretize the resulting Graphics object. For example:

g = First @ ImportString @ ExportString[Style["Ci", 100], "PDF"]


The output is a Graphics object:

g //Head


Graphics

Use BoundaryDiscretizeRegion on this graphics object:

BoundaryDiscretizeGraphics[g, MaxCellMeasure->Infinity]


• I had picked up on the same issue with DiscretizeGraphics; your workaround is very nice. – bobthechemist May 27 '18 at 18:20
• The \[VeryThinSpace] solution does not work with lower case i and j since spaces cannot be added below the dots (obviously). – bobthechemist May 30 '18 at 11:48
• @bobthechemist I've updated my answer with another method that hopefully proves useful. – Carl Woll May 30 '18 at 23:11