0

Forge RCDB URL is https://forge-rcdb.autodesk.io/configurator?id=5a361b2b58144b5ed2936ddf

I am using only

https://github.com/Autodesk-Forge/forge-rcdb.nodejs/blob/master/src/client/viewer.components/Viewer.Extensions.Dynamic/Viewing.Extension.PointCloudMarkup/PointCloudMarkup/PointCloudMarkup.js

without

https://github.com/Autodesk-Forge/forge-rcdb.nodejs/blob/master/src/client/viewer.components/Viewer.Extensions.Dynamic/Viewing.Extension.PointCloudMarkup/Viewing.Extension.PointCloudMarkup.js

Because I do not use react and I do not need UI panel.

My code is following.

Autodesk.Viewing.theExtensionManager.registerExtension('pointCloudMarkup', PointCloudMarkup)
viewer.loadExtension('pointCloudMarkup')
pointCloudMarkup = viewer.getExtension('pointCloudMarkup')
pointCloudMarkup.addMarkup({
    fragId: 1445, # fragId of some dbid
    point: {x: -4507.00927734375, y: -2092.884033203125, z: 3426.5} # world vector of fragId:1445
})

But nothing happened.

Could you give me some information?

For example.

I am wondering about arguments for

Cœur
  • 37,241
  • 25
  • 195
  • 267
小川修
  • 11
  • 1

1 Answers1

0

PointCloudMarkup is not an extension, it's an object so you cannot register it as such and load it. You need to implement your own extension and instantiate an instance inside it, like it's done in PointCloudMarkupExtension but without react specific things. For more details about writing simple extensions take a look here:

How to write custom extensions for the Large Model Viewer

Loading External Extensions in the Forge Viewer

The PointCloudMarkup constructor takes the following parameters:

constructor (viewer, options = {
    maxPoints: default is 10000,
    vertexShader: `vertexShaderImplementation` (optional),
    fragmentShader: `fragmentShaderImplementation` (optional),
    texture (optional),
    shaderParams, (optional)
}) {

An example for addMarkup is provided in the source here:

 const markupInfo = {
    fragId: hitTest.fragId,
    point: hitTest.point,
    dbId: hitTest.dbId
  }

  this.pointCloudMarkup.addMarkup(
    markupInfo)
Felipe
  • 4,325
  • 1
  • 14
  • 19
  • Thank you very much. I will try to create extension. – 小川修 Feb 23 '18 at 09:47
  • Hi Philippe I saw the example from the https://forge.autodesk.com/author/philippe-leefsma recently. That are all outstanding examples! Unfortunately the github link are unavailable now. Do you mind if I ask you a favor? Please update the link. Thank you very much! – BOAN Feb 19 '20 at 07:59
  • No longer working at adsk anymore so I have no control over those broken links. You can find most of the sample from this repo: https://github.com/Autodesk-Forge/forge-rcdb.nodejs. For further questions please get in touch with support. – Felipe Feb 19 '20 at 08:06