iTwin / itwinjs-core

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

ecSQL Geometry Functions #2596

Closed glenworrall closed 2 years ago

glenworrall commented 2 years ago

For the page https://github.com/iTwin/itwinjs-core/blob/release/2.19.x/docs/learning/GeometrySqlFuncs.md There is reference to a ElementGeom table for the iModel_placement. Is there such a thing for an element exposed for ecSQL ? I could not see that in any class name

ColinKerr commented 2 years ago

Checkout the ECSql example for imodel_bbox, it shows building an imodel_placement from properties of a geometric element: https://www.itwinjs.org/learning/geometrysqlfuncs/#imodel_bbox-1

Is this what you're looking for?

glenworrall commented 2 years ago

No … I am specifically asking what this statement means

An object that contains an origin and rotation angles, plus a bounding box. You can obtain an element's placement by selecting the placement column of the ElementGeom table. @see iModel_placement_originhttps://www.itwinjs.org/learning/geometrysqlfuncs/#imodel_placement_origin, iModel_placement_angleshttps://www.itwinjs.org/learning/geometrysqlfuncs/#imodel_placement_angles, iModel_placement_eabbhttps://www.itwinjs.org/learning/geometrysqlfuncs/#imodel_placement_eabb, iModel_placement_aabbhttps://www.itwinjs.org/learning/geometrysqlfuncs/#imodel_placement_aabb

And more specifically what is the “placement column of the ElementGeom table” … in ecSQL … that seems ambiguous … in fact … it suggests that ElementGeom is a class … which it does not seem to be …

pmconne commented 2 years ago

The ElementGeom table was removed from the schema many years ago. It should say that you can obtain the origin, angles, and bbox from the GeometricElement3d table's Origin, Yaw, Pitch, Roll, BBoxLow, and BBoxHigh columns. Of course, if you're going to obtain the origin, angles, and/or bbox directly, you don't need iModel_placement_origin/angles/eabb.

glenworrall commented 2 years ago

+Colin

ColinKerr commented 2 years ago

I created a PR to update the documentation to refer to the properties that actually exist. The examples on the page seem to be up to date so I did not change them. https://github.com/iTwin/itwinjs-core/pull/2597

ColinKerr commented 2 years ago

Closing because doc fix PR has been merged