iTwin / itwinjs-core

Monorepo for iTwin.js Library
https://www.itwinjs.org
MIT License
615 stars 210 forks source link

unable to access child elements #5902

Closed abhijitpatil181171 closed 1 year ago

abhijitpatil181171 commented 1 year ago

i have created graphic with readGltfGraphics .but i am unable to access branch,entries and range of graphic. when i inspect i can see all that but not accessible from code side what can be issue?


⚠ Do not edit this section. It is required for imodeljs.github.io ➟ GitHub issue linking

pmconne commented 1 year ago

If you want the range, use readGltf instead.

RenderGraphic is an intentionally opaque type and it may or may not have any number of branches, etc. Please explain what you are trying to accomplish that leads you to want access to its internal structure. Note, readGltf and readGltfGraphics are designed to produce graphics; they are not intended to parse and return a glTF document. Plenty of libraries for that already exist.

abhijitpatil181171 commented 1 year ago

const branch = new GraphicBranch(); branch.add(graphic); graphic = IModelApp.renderSystem.createGraphicBranch(branch, transform) const rangeBox: Range3d = graphic?.branch?.entries[0]?.branch?.entries[0]?.range;

i am trying to access range which is needed to create bounding box

pmconne commented 1 year ago

If you want the range, use readGltf instead.