Trying to set the anti-aliasing property in autodesk forge (for 2D model/floor plan) - autodesk-forge

Trying to set the anti-aliasing property in autodesk forge (for 2D model/floor plan)
I have adding custom text geometry in my forge viewer but strigling to imrove it's quality.
Tried setQualityLevel (viewer3d.setQualityLevel(true, true)) to set the anti-aliasing on but it didn't improved the qulity/ or anti-aliasing does not seems to be working?
Attaching both images below.
with anti-aliasingoff
and anti-aliasing on
Thanks
I have checked the implementation of Forge viewer and captured some more screenshots to explain the problem again.This time I am capturing geometry created by the autodesk forge measurement tool so that we can target the real problem.
In Autodesk 3d viewer we have this option to enable disable the anti-aliasing
enter image description here
if we set it to on the result is below one. 
enter image description here
We can see edges are still jagged but not as compared to what results if we set it to off.  
Following is the result of anti-aliasing
enter image description here
Observe the red line and difference that anti-aliasing flag makes in the overall quality of the rendered data.
We need to solve the same problem in 2D version of viewer but unfortunately the option to toggle anti-aliasing is not present in 2D forge viewer.I know that the implementation of anti-aliasing present in Autodesk Forge is FXAA and not sure if there are any limitations for 2d in it? if not then can you please let us know if we can expect this future version of Autodesk forge ? Please let us know

Please note that according to the API reference the antialiasing is:
Not applicable to 2D.
That is most likely why the settings have no effect on your 2D drawing.

Related

Forge Edit2D customize toolset

I'm using the Edit2D extension to draw a Polyline over the 2D model then the path of the polyline is sent to the designautomation API to draw the same polyline in the revit file.
The problem I'm having is that the designautomation is drawing the polyline correctly but the scale is incorrect, it doesn't match with what i'm seeing in the browser. The shape is fine, but the scale is not.
I assume that I need to customize the toolset to set the unithandler to use feet instead of inches. The documentation says to register a custom toolset this way:
edit2d.registerTools(MyToolSetName);
But there is no documentation on how to create the MyToolSetName toolset (i saw it's a complex object doing reverse engineering)
Any clue how can I set the unithandler and register it with the registerTools function?
Or any clue on how to make my 2D view in forge match the same coordinates as revit?
Thanks
Update (October 24th)
I built a sample on that, based on sheetviews translated from Revit files.
Please, refer here for more details.
It takes advantage of this blog.
As of now, it only works for sheetviews with viewports containing views that were also translated (present in the bubble generated).
Since we're drawing in 2D view, we only get X and Y from Viewer. Z components of the curves are defined at workitem by the plane used for drawing.
There's also a video on the sample here
Please refer here for details about using Edit2D Toolset (specifically under 3.2 Units for Areas and Lengths) as it says:
Edit 2D uses the same units and length calibration as the MeasureExtension. You can use MeasureExtension’s calibration panel to specify units and calibration for your Edit2D shapes.
We also have a sample that does a similar flow (without Edit2D) here

Mirrored model has its materials flipped inside out when viewed in Autodesk Forge Viewer

Description
Mirrored model has its materials flipped inside out when viewed in Autodesk Forge Viewer.
Adding a section plane reverts the mirrored model back to what it should look like.
We are using this sample viewer from Autodesk.
This weird behavior does not occur when looking at the model in BIM 360 Docs.
We've included screenshots and steps to reproduce this here.
EDIT: while writing this post, we came across Problems with forceDoubleSided setting. Has this been fixed?
Thanks.
Simply loading the 'Autodesk.AEC.LevelsExtension' might fix the problem.
See https://forge.autodesk.com/blog/bim-360-viewer-vs-forge-viewer

Geometries issues involving arc or circle

We use the model-derivative api and the viewer from Forge in our platform, but we had issues with geometries containing arcs :
Bad translation
Should be like that
Here's a link if you want to test by yourself
Link to IFC sample bad_arc_geometries.ifc
Did i miss something ?
There an issue with the IFC extractor, the fix will be rolled out in the next version. sorry for the inconvinience.

Forge viewer displays elements blurry in 2D views and the Measure extension does not work on them

For some of our Revit models, in Forge viewer, 2D views are display blurry, no element can be selected and the Measure extension does not work on elements and only works on the dimensions and the titleblock.
Like this example:
here and here
But it should be like this
I have tested it with our viewer, A360 viewer and Autodesk Forge Tools vscode extension.
This is because 2D drawings or PDFs can contain both vector graphics and raster graphics (this article explains the difference between the two). The measure extension needs vector graphics in order to work properly.
Thanks to Petr Broz and his hint, by changing the Model Display Style in Revit side to Hidden Line instead of Shaded the problem was solved.
Like this.
Update:
The Shadows in Graphic Display Options, also should be unchecked.

Change Background color of 2D sheets of Autodesk Forge using Javascript

How to set a background color in 2D view of autodesk forge file to a specific Room on a floor or level using jquery
To set a background color in 2D, you have to two programmable options...
viewer.setBackgroundColor(...);
viewerImp.toggleSwapBlackAndWhite(true/false);
You can find the API details for setBackgroundColor here:
https://developer.autodesk.com/en/docs/viewer/v2/reference/javascript/viewer3d/
and line2191 toggle blackwhite here:
autodeskviewer.com/viewers/latest/docs/src_application_Viewer3D.js.html
Here is a working example...
Open this URL in a recent version of chrome:
https://autodeskviewer.com/viewers/latest/viewer3d.html?svf=https://lmv-models.s3.amazonaws.com/2d_model/primaryGraphics.f2d
Open up the debug console and type these two options:
NOP_VIEWER.impl.toggleSwapBlackAndWhite(true);
NOP_VIEWER.setBackgroundColor(255,255,0,0,255,255);
The result should give you a clue to what is possible with just the api.
This is specific to the web viewer. Is that what you were looking for ?