sfaust
sfaust

Reputation: 2373

Use model space coordinates

I'm using the Forge Viewer and I'm having trouble getting the model space coordinate system instead of paper space. I have a building floor plan in view and I can get the coordinates of things but they are all like 3.5, 4.6, etc. that would be within an 8.5x11 piece of paper so I would assume that's paper coordinates. I really need model coordinates that should be more like 56, 75, 152, etc. (assuming it's feet). I've tried looking for different viewables but it always seems to be paper space. Here is my code to load a document:

  viewer?.loadDocumentNode(doc, doc.getRoot().getDefaultGeometry()).then(e => {
    console.log(e);
    if (viewerReady) {
      viewerReady(viewer!);
    }
  });

This works but I get the paper coordinates. I did look through the name of the viewable that comes back as default and it's 'Model' so that seems like it's model space to me but the coordinates don't seem to be. I did also open the source ACAD drawing and confirmed that in model space the coordinates are correct (one test was 345ft, etc.).

Is this something I can see in the document somewhere? Is there a scaling of some type? Or a parameter of some type in the conversion that I need to set? How do I get the 'real' coordinates?

Upvotes: 0

Views: 310

Answers (1)

Petr Broz
Petr Broz

Reputation: 9942

When working with 2D drawings, you should be able to find this information in the model's metadata:

enter image description here

Upvotes: 1

Related Questions