0

I am trying to draw a Markups in forge Viewer but it's working when loading extension

var extensionOptions = { hideIssuesButton: false, hideFieldIssuesButton: true, };

  // Use the `viewer` reference to call `loadExtension` with the extension name and the extension options:

  viewer["3d"].loadExtension('Autodesk.BIM360.Extension.PushPin', extensionOptions).then(function (extension) 
  {
      PushPinExtensionHandle = extension;
  });

but draw Thickness and Font Size is very small.How to increases the size?

Please find the attachment for reference. enter image description here

habib
  • 2,366
  • 5
  • 25
  • 41

2 Answers2

0

here are some properties which u can adjust to set the size and width of your Text

var textgeometry = new Three.TextGeometry(text,
      Object.assign({}, {
        font: fonts,
        bevelEnabled: false,
        curveSegments: 2,
        bevelThickness: 0,
        color: 0xFFA500,
        bevelSize: 0.21,
        height: 3,
        size: 1
      }));

here is the link for reference how u can add Text Geometry TextGeometry

Ronak Shetiya
  • 960
  • 6
  • 27
  • Hi Ronak, thank you for sharing. In this context, the originator is using markup extension to draw the svg shape. While the code you shared is geometry of Three.js, which is normally used when adding custom geometries. – Xiaodong Liang Mar 04 '21 at 04:19
  • @XiaodongLiang thanks for correcting that and will try to understand code written by you – Ronak Shetiya Mar 04 '21 at 06:08
0

It looks to me the post is about how to set font size and freehand thickness of Markup in Forge Viewer. I am not sure why the code snippet is about loading Pushpin Extension.

anyway, let me try to answer the question of font size and freehand thickness.

Markup Core extension provides the parameter to set font style when you create text. The parameter is a json, in which font-size is one key. So to set font size, the code is like below:

 markupExt.enterEditMode();
 var text1= new Autodesk.Viewing.Extensions.Markups.Core.CreateText(markupExt,2333, 
 {x:10,y:10}, {x:100,y:100},'My Test String Small', {"font-size":5})
  text1.execute();
 var text2= new Autodesk.Viewing.Extensions.Markups.Core.CreateText(markupExt,2333, 
 {x:30,y:30}, {x:130,y:130},'My Test String Big', {"font-size":20})
  text2.execute();

As to thickness, the other post tells now to set stroke width. Autodesk Forge Viewer Markup Style Object

enter image description here

Xiaodong Liang
  • 2,051
  • 2
  • 9
  • 14