Forge Viewer 7.X : Make vertex visible on mobile - autodesk-forge

I need to show the edges of the geometries on mobile using the Forge Viewer 7.X but since version 6.X edges are hidden to improve mobile performance.
https://forge.autodesk.com/en/docs/viewer/v7/change_history/changelog_v6/
Vertex array objects default to false on mobile devices to save memory
It's there a way to turn them on again?
PS: The same log shows a render setting renderEnvironmentDisplayEdges but I can't find where it should be set.
[Edit] To comply with #Peter O. comment:
It is possible to create an override to a Three.js implementation to show meshes edges after the geometry is already loaded/created?
The solution I found have to be made while loading the geometry but the process is being taken care by the Forge Viewer so I'm not sure if I can apply it.
https://threejs.org/docs/#api/en/geometries/EdgesGeometry

Maybe this would help:
viewer.setDisplayEdges(true);

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

How to change the geometry of the two selected models?

I know getSelection() is get the db id of seletion model.
but after this i don't know how to control this viewer.
There are two windows selected by the viewer.
I want to change the geometry of the two windows.
Forge Viewer is open Revit file by my bucket.
viewer.getSelection()
=>(3) [3043, 3055]//how to?
Unfortunately, the viewer isn't designed to support geometry modification. You can modify your design elements in these ways:
changing their position, orientation, or scale (blog)
hiding them, and potentially inserting your own custom three.js geometry instead (tutorial)
changing their materials, incl. using custom shaders (blog)
But if you actually need to tweak the individual vertices of the mesh geometry, that would be very difficult to do.

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

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.

forge Viewer - cant below markups be rotated?

I was checking example https://forge-rcdb.autodesk.io/configurator?id=598d7ec14cabf2c1f4dec948
Not sure while I see markups in View state, the model cannot be rotated? Is this by design? Or markups drawn using different shapes cannot be viewed using camera events? If this is possible, show me an example which shows this.
I exactly need similar example where I can have an editor where markups mode can be selected and draw?
It is by design but you can try below to enable navigation when in view mode:
Autodesk.Viewing.Extensions.Markups.Core.Utils.showLmvToolsAndPanels(viewer)
markExt.allowNavigation(true)
viewer.navTools.orbittoolsbutton.container.style.display='block'
// then pick the desired tool from toolbar and navigate
Note this is NOT officially supported (since navigation is suppressed by design) and might not work with future releases (works as of 7.12).
You might be interested by this example for 3d markup using the Forge Viewer even though it doesn't have a configuration mode.
https://github.com/apprentice3d/ForgeViewerExtensions

Ushahidi - How to make the markers stay on the map on zoom change?

I am using the platform Ushahidi Web-2.7.3 , see: http://ti5.net.br/provedorlegal.com.br, and when I zoom in beyond a certain level, the clustered markers disappear from the map. I also tested this on an older version of a site, see: http://movimentofichalimpa.org/mapa, where the clustered markers do not disappear on zooming in, but just become ungrouped, as is normal with a cluster strategy. How can I make the markers remain on the map when zooming in?
Ushahidi actually uses OpenLayers under the hood -- the images may come from Google, but the Javascript library is pure OpenLayers. These markers are actually generated by adding what is known as a context to the style attribute of the OpenLayers.Layer.Vector and an associated Cluster.Strategy. There is a good example of it working properly here: OpenLayers cluster example and if you look at the Javascript source you will see how it is done: view-source:http://dev.openlayers.org/releases/OpenLayers-2.13.1/examples/strategy-cluster-threshold.html by defining a radius in the context of the styleMap.
The reason that your example isn't working is that there is actually a script error being triggered, which is stopping the clustering/styling from being performed. The styles are defined in the file ushahidi.js. If you open a Javascript debugger you will see the error for yourself that is firing before the ushahidi.js functions are called to determine the number of features in the cluster and therefore the radius of the markers.
The actual error is http://ti5.net.br/provedorlegal.com.br/index.php/json/cluster?s=1401591600&e=1404183599&z=9, but I have no idea why, as the OpenLayers is the minified version which is very hard to debug. You might find moving your application to OpenLayers directly will help, as it will be easier to debug, and it also works on mobiles, which I know is one of the reasons people like to use Ushahidi.