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?
How to get a 2D floor plan with dimensions from RoomPlan
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
@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 !
Hi @denniswave ! Do you think it is possible to calculate a surface area? I couldnt find this in API
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.
To get a 2D floor plan with dimensions from RoomPlan:
-
With RoomPlan's intuitive tools, you can easily draw the walls, doors, and windows of your room.
-
You can add dimensions by clicking on the "Dimensions" tool and selecting the elements you want to measure. RoomPlan calculates and displays the dimensions automatically.
-
Choosing the "Export" option and selecting the desired format (e.g., PDF, PNG, JPEG) will export your plan. Your added dimensions will be included in the exported plan.