How to get a 2D floor plan with dimensions from RoomPlan

I am in need to create a 2D floor plan with the dimensions mentioned, from the generated 3D result of RoomPlan. Is there a way to create it in a little easy-to-understand manner? Or will it require manual elaborate coding?

Post not yet marked as solved Up vote post of bishusikder Down vote post of bishusikder
9k views

Replies

PS - i can try to pull out some javascript code for you, but its highly fragmented and it doesnt use any of the objects/properties that the RoomPlan or ARKit SDKs use, so i doubt it would be much help.

I've posted an article in which I go through the process of setting up an app and creating a 2D floor plan using SpriteKit: https://totheroot.io/content/create-a-2-d-floor-plan-with-room-plan-and-sprite-kit-part-i

  • Hi @denniswave this link not open properly, i try to many times and multiple browser. till now not open..

Add a Comment

@denniswave : I recently came across your tutorial, "Create a 2D Floor Plan with RoomPlan and SpriteKit" and just wanted to drop you a quick thank you. It was super clear and really helped me out! 😃👍

By the way, do you have any tips on how I could display wall lengths and floor areas within each room? That’d be the cherry on top! 🍒 Cheers !

  • a surface object has dimensions. so you could actually just draw parallel lines and show the length

Add a Comment

Hi @denniswave ! Do you think it is possible to calculate a surface area? I couldnt find this in API

  • @Gerri777 - Just thought i'd chime in because i've had to do the same thing; getting area, among many other metrics.

    Once you have the 2D data (or even the 3D data), 90% of what you will want to do with the data will be outside of the RoomPlan API, and even outside of the AR Kit API. You're on your own. However, most of these things are quite easy to do with open source libraries. For example, to get area, you simply need a polygon of your room points.

Add a Comment

Hi @denniswave your highness. It is an honour to have you here. The sample app you provided is just as remarkable as you are. It undoubtedly paves the way for many others working in this area.

I have a follow-up question, though. Suppose I have point cloud data, like a LAS file, from a room I've scanned. How realistic do you think it would be to re-visualize this data in either 3D or 2D?

@AkshayBagekari I tried the solutions for the cross floorplan that @denniswave and @Brent185 suggested, but I couldn't solve it.. and are right, but solutions depend on how each person thinks. Everyone's thinking process may be different. I aimed for a straightforward output - So, I added a rotation gesture(UIRotationGestureRecognizer) and checked the camera angle when the user rotated it. I compared that angle with the angle of each surface, and it matched the angle of the longest continuous surface. , I set that rotation angle as the camera angle. I didn't rotate the whole surface; I just changed the camera angle. Finally, I got the correct output. I added the rotation gesture only for testing purposes to see if it appears straight at a certain angle, which means you don't need to add the gesture.

For example :- by setting camera rotation.
self.camera?.zRotation = largesurfaceAngle

@denniswave Thanks for the shared research into this!

for everyone else looking to get some dimensions and rotating the final sketch I just played around a little bit today. I have not used SpriteKit before so was just messing around and my results are below.

To rotate: self.position needs to be rotated by the largest surface (or any surface really) euler angle y in the negative direction.

Then each self.z rotation needs to compensate for this by adding the same surfaces euler y angle as well. this is because we are subtracting the y angle. So if we want the surface we select to be horizontal we need to subtract it back out. Do this for all z rotations.

code attached below.

  • @Jermi would you be able to share details on how you displayed the wall lengths? I know that we have point A and point B, but how did you get it so that the line is displayed on the outside edge of the wall, and for the numbers to show up in-between?

  • Hi @Jermi In the shared code, could you please provide information or code related to the following constants: dimensionLineDistFromSurface, dimensionLabelWidth, dimensionWidth, and hideSurfaceWallCapZPosition?

  • @Jermi Can you share your sample code? Thank you