Open r-veenstra opened 7 months ago
quite possibly need changing once https://github.com/CesiumGS/cesium-omniverse/pull/626 is merged due to globe anchor changes.
Agreed. I'll review this PR right after https://github.com/CesiumGS/cesium-omniverse/pull/626
I'd also propose this functionality be moved from powertools into the core plugin before the next release, given the limitations for authoring Cesium Cartographic Polygons at this stage.
I agree. We should also strongly consider moving over the cartographic-polygon footprint tool.
I agree. We should also strongly consider moving over the cartographic-polygon footprint tool.
I'm going to polish it up and add the footprint tool to this PR too
I've added the footprint generation script here. @corybarr it would be good to test on windows to ensure the Shapely library properly installs for a new user. Likewise @lilleyse or @timoore if you could confirm Linux installation works ok that would be great. I've followed the same approach for pip installing that was used for the proj library.
I've added the footprint generation script here. @corybarr it would be good to test on windows to ensure the Shapely library properly installs for a new user. Likewise @lilleyse or @timoore if you could confirm Linux installation works ok that would be great. I've followed the same approach for pip installing that was used for the proj library.
@r-veenstra There's an issue with numpy on Windows:
Processing c:\users\cbarr\p\co3\exts\cesium.powertools\vendor\shapely-2.0.2-cp310-cp310-win_amd64.whl
ERROR: Could not find a version that satisfies the requirement numpy>=1.14 (from shapely==2.0.2) (from versions: none)
ERROR: No matching distribution found for numpy>=1.14 (from shapely==2.0.2)
2024-01-25 22:49:23 [888,628ms] [Warning] [omni.kit.pipapi.pipapi] 'c:\users\cbarr\p\co3\exts\cesium.powertools\vendor\shapely-2.0.2-cp310-cp310-win_amd64.whl' failed to install.
2024-01-25 22:49:23 [888,629ms] [Error] [cesium.powertools.extension] Could not install wheel for shapely
I've added the footprint generation script here. @corybarr it would be good to test on windows to ensure the Shapely library properly installs for a new user. Likewise @lilleyse or @timoore if you could confirm Linux installation works ok that would be great. I've followed the same approach for pip installing that was used for the proj library.
@r-veenstra There's an issue with numpy on Windows:
Processing c:\users\cbarr\p\co3\exts\cesium.powertools\vendor\shapely-2.0.2-cp310-cp310-win_amd64.whl ERROR: Could not find a version that satisfies the requirement numpy>=1.14 (from shapely==2.0.2) (from versions: none) ERROR: No matching distribution found for numpy>=1.14 (from shapely==2.0.2) 2024-01-25 22:49:23 [888,628ms] [Warning] [omni.kit.pipapi.pipapi] 'c:\users\cbarr\p\co3\exts\cesium.powertools\vendor\shapely-2.0.2-cp310-cp310-win_amd64.whl' failed to install. 2024-01-25 22:49:23 [888,629ms] [Error] [cesium.powertools.extension] Could not install wheel for shapely
I added the numpy 1.26 whls to extension.py, but the shapely whl is still having an issue installing:
Installing whl for pyproj
Successfully installed whl for pyproj
Installing whl for numpy
Successfully installed whl for numpy
Installing whl for shapely
...
ERROR: Could not find a version that satisfies the requirement numpy>=1.14 (from shapely==2.0.2) (from versions: none)
ERROR: No matching distribution found for numpy>=1.14 (from shapely==2.0.2)
2024-01-26 00:07:17 [3,857ms] [Warning] [omni.kit.pipapi.pipapi] 'c:\users\cbarr\p\co3\exts\cesium.powertools\vendor\shapely-2.0.2-cp310-cp310-win_amd64.whl' failed to install.
2024-01-26 00:07:17 [3,858ms] [Error] [cesium.powertools.extension] Could not install whl for shapely
@corybarr oh my bad. I did have numpy whls but thought they were for another powertool I was working on simultaneously. I still have them here uncommitted, so I'll add and test later today
@corybarr oh my bad. I did have numpy whls but thought they were for another powertool I was working on simultaneously. I still have them here uncommitted, so I'll add and test later today
Sure, I'll give it a test. I'm puzzled why shapely can't see my installed numpy whls. It seems very straightforward to add them. Did you do anything beyond copying them and adding an element to the array in extension.py
?
@corybarr I've added back what I had in there, deleted my shapely and numpy folders from USD Composers pip3-env
folder and they appeared to install correctly
@corybarr I've added back what I had in there, deleted my shapely and numpy folders from USD Composers
pip3-env
folder and they appeared to install correctly
This is puzzling. Your commit is character-by-character exactly what I tried. I still get the same installation error for the shapely whl. It appears that the shapely whl can't see the numpy whl that was just installed. I don't have numpy on this laptop and never have, but that shouldn't matter. The numpy whl is successfully logging as installed prior to the shapely whl attempting its installation.
This PR adds a context menu option to Powertools that converts Basis Curves into Cesium Cartographic Polygons.
The option is available in both the viewport
And the stage window
I have based this implementation off
context_menu.py
inomni.curve.manipulator
The context menu item will be visible with one or more Basis Curves selected. It will not display if any non-basis curve prims are selected.
The logic for conversion is using the pre-existing code for converting Basis Curves, and will quite possibly need changing once https://github.com/CesiumGS/cesium-omniverse/pull/626 is merged due to globe anchor changes.
I'd also propose this functionality be moved from powertools into the core plugin before the next release, given the limitations for authoring Cesium Cartographic Polygons at this stage.
EDIT:
This PR now also includes a feature to create a new BasisCurve from the footprint of a prim(and its children)
https://github.com/CesiumGS/cesium-omniverse/assets/123468416/14842ebc-b276-44ac-90f3-95a9bdd39504
This implementation uses the Shapely library to perform 2D shape functions.
At a high level the logic is
An optimisation has been added that compares the AABB of the current mesh to the accumulated boundary of all meshes processed so far. If the AABB is complately within the accumulated boundary horizontally, it is skipped. This has reduced processing of the above architectural model from ~22s to 4s. Further optimisations could be added, such as sorting the meshs by largest AABB first.
This option is available as a right-click context menu item on many prim heirarchy that contains one or more UsdGeom.Mesh prims.