-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Powertools context menu for cartographic polygon functions #630
base: main
Are you sure you want to change the base?
Conversation
Agreed. I'll review this PR right after #626
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. |
@r-veenstra There's an issue with numpy on Windows:
|
I added the numpy 1.26 whls to extension.py, but the shapely whl is still having an issue installing:
|
@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 |
@corybarr I've added back what I had in there, deleted my shapely and numpy folders from USD Composers |
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 #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)
Screen.sharing.-.2024-01-25.3_24_18.PM.mp4
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.