The Mixed Reality Forums here are no longer being used or maintained.
There are a few other places we would like to direct you to for support, both from Microsoft and from the community.
The first way we want to connect with you is our mixed reality developer program, which you can sign up for at https://aka.ms/IWantMR.
For technical questions, please use Stack Overflow, and tag your questions using either hololens or windows-mixed-reality.
If you want to join in discussions, please do so in the HoloDevelopers Slack, which you can join by going to https://aka.ms/holodevelopers, or in our Microsoft Tech Communities forums at https://techcommunity.microsoft.com/t5/mixed-reality/ct-p/MicrosoftMixedReality.
And always feel free to hit us up on Twitter @MxdRealityDev.
Scanning a window or door frame
I'm building off the logic in the HoloToolkit and Tutorial 230 for spatial scanning. The basic scanning process is working fine. In the room I'm in there are french doors which is nice because its similar to the real world scenario I'm building for. I'm trying to get the spatial scanning to recognize the frame around the french doors - specifically the top edge of the frame. In the app, with the gaze on the middle top of the door frame I issue a voice command and it's supposed to place some objects relative to the plane of the frame at the top / above the window area. See the graphic.
The mesh shows me that triangles/verts are found on the frame but it never seems to turn it into a plane. I'm telling it to include not only Walls but Unknown objects, as they are classified in the spatial processing scripts. I'm also giving it an extremely small (or no) minArea for planes. Looking through code it seems that the FindPlanes method P/Invokes into a native dll so the logic there is a bit of a black box.
Any ideas what I might need to do to recognize that area as a game object (so I can position relative to it)?
Thanks!
Answers
@Dennis_Welu,
You can take a look at the PlaneFinding.dll source code in the HoloToolkit on GitHub. The source lives in the SpatialMapping/PlaneFinding folder.
Thanks!
David
Thanks @DavidKlineMS . I'll take a look.
I'm wondering as a workaround right now if I can just get the point in space on the mesh where the user gaze lands... The mesh seems to be built around the frame ok, it just doesnt receive a plane there. SpatialMappingManager has the list of meshes...just not sure how to get the point from that (these are not game objects with colliders right?).
Hmm interesting. @DavidKlineMS , it appears that the minArea value passed into the FindPlanes routine is used only in merging planes, not finding them: https://github.com/Microsoft/HoloToolkit/blob/90af8fd880f697d5186ae19a325ff188d6750991/SpatialMapping/PlaneFinding/PlaneFinding/dllmain.cpp#L55-L66
That would be fine except that inside the FindPlanes implementation it has a constant minimum size value of 0.125 so candidates less than that are discarded and never considered for merging: https://github.com/Microsoft/HoloToolkit/blob/90af8fd880f697d5186ae19a325ff188d6750991/SpatialMapping/PlaneFinding/PlaneFinding/FindPlanes.cpp#L27.
I'm thinking maybe the min value should be passed into FIndPlanes and not MergePlanes. Does that seem reasonable?
@Dennis_Welu,
If you Raycast to the Spatial Mapping layer (SpatialMappingManager.Instance.LayerMask), you will get the location of the collision.
As for modifying the PlaneFinding DLL code to take a min value in FindPlanes, I think that's a great idea. I would not remove the parameter from MergePlanes. Instead, i would suggest a min plane size in addition to the min value used by MergePlanes. The code for both the HoloToolkit and HoloToolkit-Unity are open source and accept pull requests. Feel free to file an issue on GitHub and, if you would like, contribute to the toolkit!
Thanks!
David
@DavidKlineMS Sure, got it, makes sense. And definitely interested in doing that if the current project continues on... :-)