philgiasson / imodeljs

Monorepo for iModel.js Library
https://www.imodeljs.org
MIT License
0 stars 1 forks source link

[Bentley] Add CustomRpc to query linear geometry as Path. #3

Closed a-gagnon closed 3 years ago

a-gagnon commented 3 years ago

Add a simple RPC interface + implementation to return the first linear geometry that we find in an element's GeometryStream.

Example usage (frontend): async function foo() { const response = await CustomRpcInterface.getClient().queryPath(this.iModel.getRpcProps(), elementId); const path = CustomRpcUtilities.parsePath(response); if (path) // do stuff }

Have a look at CurveChainWithDistanceIndex from the documentation. You may use it to wrap the Path object and make things easier going forward.

AccuSnap is also something worth looking at when writing a tool.

a-gagnon commented 3 years ago

Pour des raisons de performance, il est impossible d'obtenir la géométrie complète sur le frontend. Les calculs doivent être faits sur le backend et les résultats envoyés au frontend lorsque nécessaire.

Tenez-moi au courant si vous rencontrez des problèmes.