omz:forum

    • Register
    • Login
    • Search
    • Recent
    • Popular

    Welcome!

    This is the community forum for my apps Pythonista and Editorial.

    For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.


    Request for an App

    Pythonista
    9
    88
    45640
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • JonB
      JonB last edited by

      Did you try my delay approach? You will need to force quit pythonista, then make the above mod.

      1 Reply Last reply Reply Quote 0
      • ihf
        ihf last edited by

        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.

        1 Reply Last reply Reply Quote 0
        • JonB
          JonB last edited by

          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...

          1 Reply Last reply Reply Quote 0
          • ihf
            ihf last edited by

            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?

            1 Reply Last reply Reply Quote 0
            • ihf
              ihf last edited by

              @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.

              1 Reply Last reply Reply Quote 0
              • JonB
                JonB last edited by

                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.

                https://github.com/jsbain/RoomAreaFinder.git

                anyway, just sort of temporary changes using the old ui.

                1 Reply Last reply Reply Quote 0
                • ihf
                  ihf last edited by

                  @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?

                  1 Reply Last reply Reply Quote 0
                  • L
                    Lesternixon @TutorialDoctor last edited by

                    The quickest method would probably be to import the jpg and trace it using the pen tool. Simply add a small amount of code to the traced object to compute the area dynamically. Although your situation is highly particular, I believe it will serve your needs. I'm currently working on that screenshot.

                    ihf 1 Reply Last reply Reply Quote 0
                    • ihf
                      ihf @Lesternixon last edited by

                      @Lesternixon Thanks. @jonb wrote a fantastic script that does exactly what I wanted. Unfortunately with the new release of Pythonista it fails due to a problem with the image module. Hopefully this will get fixed at some point.

                      cvp 1 Reply Last reply Reply Quote 0
                      • cvp
                        cvp @ihf last edited by cvp

                        @ihf Perhaps I did not update the @JonB module for years but I tried with new Pythonista beta (340007) and it works

                        1 Reply Last reply Reply Quote 0
                        • ihf
                          ihf last edited by

                          @cvp That's interesting. I have many versions. Does the version you tested allow you to select an image from your photo library or is it using a fixed file name? The reason I ask is that most of the versions I have allow that selection (it was added early on in the development), and that particular function for selecting an image appears still to be broken in the latest data. (https://forum.omz-software.com/topic/7935/photos-pick_image-throws-error/1)

                          cvp 1 Reply Last reply Reply Quote 0
                          • cvp
                            cvp @ihf last edited by cvp

                            @ihf It was floorplanarea.py , not RoomAreaFinder, and yes, it uses a fixed image, no picking

                            ihf 1 Reply Last reply Reply Quote 0
                            • ihf
                              ihf @cvp last edited by

                              @cvp Can you please send me that version? When I tried changing my version of floorplanarea.py to use a specific file, it gets an error. pick.image remains broken but if the version you have that works is a recent version in terms of features, I could use that for now.

                              cvp 1 Reply Last reply Reply Quote 0
                              • ccc
                                ccc last edited by

                                This one?

                                https://raw.githubusercontent.com/jsbain/RoomAreaFinder/master/floorplanarea.py

                                ihf 1 Reply Last reply Reply Quote 0
                                • ihf
                                  ihf @ccc last edited by

                                  @ccc No, I have that one. That's the one that won't run on the v3.4beta (it tries to pick the image) and if I change it to use a stored file it gets an error on line 63.

                                  1 Reply Last reply Reply Quote 0
                                  • cvp
                                    cvp @ihf last edited by

                                    @ihf old floorplanarea

                                    ihf 1 Reply Last reply Reply Quote 0
                                    • ihf
                                      ihf @cvp last edited by ihf

                                      @cvp I tried running that and it gives an error about RoomOverlay.touch_moved n() takes 2 positional arguments if you touch the image. I have the most recent version of the script and if I remove the image picker to avoid the bug in the beta I get other errors that must also be beta (or just new version) related.

                                      cvp 1 Reply Last reply Reply Quote 0
                                      • cvp
                                        cvp @ihf last edited by cvp

                                        @ihf Weird. I don't have any problem. Perhaps due it uses also an old Gestures module, in the same folder.

                                        Gestures checked, same as in old Gestures

                                        Did you restart Pythonista ?

                                        ihf 1 Reply Last reply Reply Quote 0
                                        • ihf
                                          ihf @cvp last edited by

                                          @cvp yes, many times. If it works for you, perhaps I have some bad module here somewhere.

                                          cvp 1 Reply Last reply Reply Quote 0
                                          • cvp
                                            cvp @ihf last edited by cvp

                                            @ihf If you use "my" old FloorPlanArea.py and if you did not change it 😉, be sure you also use the Gestures.py of @jonB in the same folder, to avoid using another Gestures module, for example, of @mikael, they could have different parameters.

                                            1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post
                                            Powered by NodeBB Forums | Contributors