Element Graphics
The iTwin.js renderer is designed to render tiles, not elements. But in some cases it is useful to display graphics for individual elements. For example, tools that modify the geometry of an element may wish to display a preview of their effects while the user interacts with them. Or, a simulation might want to temporarily animate a handful of elements. Or, a decorator may wish to produce graphics for types of geometry - like BReps and text - that are not supported by the front-end GraphicBuilder.
TileAdmin.requestElementGraphics accepts either an element Id or an arbitrary GeometryStream from which to produce graphics, along with other options like the chord tolerance specifying the desired level of detail. It returns graphics in iModel tile format which can then be supplied to readElementGraphics to produce a RenderGraphic for display in a Viewport.
This sample demonstrates the use of these APIs to animate an "exploded" view of a set of elements.
Last Updated: 30 December, 2021