Request for an App
I am in need of an app which can find the area of a space that is represented by a jpeg where at least one measurement is known. For example, I have a floor plan of an apt that purports to be a certain area. The floor plan has room sizes shown. I want to be able to simply enter one measurement to get the scale ratio and then trace the plan to find the area. This is easy to do using a program such as Adobe Acrobat Pro on a desktop but I have not seen anything similar for IOS (or Android). If someone knows of such a program, please let me know. It seems as if this should not be overly difficult to do using Pythonista and I could make it my project to write it but I fear that may take awhile given my (rusty) python skills not to mention the UI using Pythonista. If someone has the time and inclination, I (and I think others) would be most grateful for such an app/script.
p=photos.pick_image() p.save("temp.jpg") #we need to allow some time for animation to completely complete import time time.sleep(1) v = RoomAreaView('temp.jpg') v.present()
I cant really explain why, but it seems that trying to present a view immediately after pick_image() doesnt quite allow the animation to complete, at least sometimes. Adding a little time seems to work. 1 second is probably overkill,myou can experiment with it.
The first time I execute this script after Pythonista is started, the file picker comes up, I select an image, the script ends ( i.e. The run triangle returns) and no window is opened. If I run it again, I get:
Traceback (most recent call last):
File "/private/var/mobile/Containers/Shared/AppGroup/B86CEE4E-E4A9-4BB4-9CA7-6E13BDA2C2A4/Pythonista3/Documents/floorplanarea-6.py", line 160, in <module>
ValueError: View is already being presented or animation is in progress
At this point Pythonista needs to be quit or any app that tries to present a view will fail similarly.
Did you try my delay approach? You will need to force quit pythonista, then make the above mod.
Just tried it and it worked! Is there a better way to do the image selecting that does not involve saving the temp file at all?
Unrelated question: this script is extremely useful and would be much easier to use if I could select 2 points that define one known dimension and set the scale by entering it as feet and inches rather than using a slider. What I do now is select 2 points and move the slider until it is as close as I can get to the printed dimension but I can never get it quite right as the slider always changes as I take my finger off and the delta for a small movement is enough to make the positioning tricky.
Thanks so much for your expert help.
I am (slowly) working on an update that will have a much nicer user interface, allow pinch zooming for precision point placement, and have support for multiple rooms, saving and reloading results, and presenting summaries etc.
But things go slowly...
That's great! I understand and I shall be patient. Would it help in designing the UI if I posted links to 1 or 2 typical floor plans to give a better idea of what I'm trying to do?
@jonb I would be happy to discuss use cases here or, if you prefer, outside the forum. One thing you did not mention is the ability to set scale, start entering points and then clear points/lines without reentering scale. Also,, while it does not affect the area calculation very much, it would be nice to have the option to force a line segment to be vertical or horizontal as most floorplans are oriented in this way and positioning the line is a bit tricky. Having the ability to store the plan with the scale and area would be VERY helpful.I am convinced that with the additions you mention, this could be successfully sold on the App Store.
I pushed a change which includes the ability to two finger pinch zoom, and two finger pan.
I made this change a long time ago, but i now added in your file picker. Points can be moved by dragging on an existing point, thus you can set your scale, and then move points, or if you dont get it quite exact, you can zoom in and tweak.
I updated the scale textbox to allow simple math. For instance, if scal is currently 0.08, you draw a line which says 23.2, but the real distance is 25 you could enter 0.08*25/23.2, and the scale will automatically be set so your length is exact.
I also added a clear button to clear the path.
anyway, just sort of temporary changes using the old ui.
@jonb Here is a "real world" image of a floor plan that I am trying to measure. If I zoom in, the red circle is sometimes too large to position accurately. Also, would be nice to be able to measure the total area as well as the area of internal rooms or spaces. Right now I can do either but not both on one plan. Also, might be better if the window were full screen?