0

How do I plot a 3D curly brace that is scalable, but the curly parts remain intact, and can be altered where the labeling tip points to?

update:

I have tried insetting the string { into my graphics, and it looks more professional than the BSplineCurve I previously used, but still lacks adjustability.

Inset[
 First@ImportString@
   ExportString[
    Style["{", RGBColor[0.25, 0.25, 0.25], FontSize -> 12, 
     FontFamily -> "Cambria Math"], "PDF"],
 {0.12, 0, 1/2 + 0.045}, Center, 45]

The result looks something like this:

enter image description here

2ub
  • 301
  • 1
  • 8
  • It seems like a straightforward but very tedious task. What have you tried? Where did you get stuck? – Szabolcs Oct 16 '17 at 10:49
  • Look at previous attempts, for example https://mathematica.stackexchange.com/questions/4374/scale-insetted-characters-to-plot – Acus Oct 16 '17 at 12:14
  • @Szabolcs, I've been using BSplineCurve to make the braces and adjust it by GeometricTransformation. It looks somewhat unprofessional though. – 2ub Oct 16 '17 at 12:21
  • @user18792, OK I'll take a look. – 2ub Oct 16 '17 at 12:23
  • What do you mean by 3D? Something like in this question? https://mathematica.stackexchange.com/questions/128412/strategies-for-creating-3d-text – Greg Hurst Oct 16 '17 at 15:54
  • @ChipHurst, 3D as in 3 dimensions, like in Graphics3D or Plot3D – 2ub Oct 16 '17 at 16:01
  • @L.Quen Sure, but it's still not clear to me what you want. Do you want a floating glyph in 3D, or something more along the lines of the link I pasted above, or something completely different? – Greg Hurst Oct 16 '17 at 17:16
  • @ChipHurst, Floating glyph i guess that denotes a length in 3d – 2ub Oct 17 '17 at 05:49

1 Answers1

4

Here's a way to get most of what you want, stolen from Szabolcs here:

reg = BoundaryDiscretizeGraphics[
   Text[Style["{", FontFamily -> "Cambria"]], _Text];
polyBase = FirstCase[Normal@Show[reg], _Polygon, None, Infinity];
poly = Polygon[
   Prepend[#, ConstantArray[0, Length[#[[1]]]]] &@
     Map[Rescale, Transpose@polyBase[[1]]] // Transpose
   ];

That gives you a polygon, which you can just mess with using GeometricTransformation.

Here's the base Polygon:

poly // Graphics3D

base p

Note that you can change it with transformations:

GeometricTransformation[poly, 
  ScalingTransform[{1, 1, 3}]] // Graphics3D

scaled p

And since it has been Rescale-d that now spans the z range [0, 3]. See also RotationTransform and TranslationTransform.

b3m2a1
  • 46,870
  • 3
  • 92
  • 239