• Login
sketchucation logo sketchucation
  • Login
🤑 SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

[Plugin][Code]SKMtools,Material/ImageTools

Scheduled Pinned Locked Moved Plugins
176 Posts 36 Posters 264.1k Views
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.
  • R Offline
    rustar123
    last edited by 9 Oct 2021, 17:10

    I have edited transparent for my pic already. But my problem is i can not use ImageTrimmer


    1a.png


    2a.png

    1 Reply Last reply Reply Quote 0
    • D Offline
      Dave R
      last edited by 9 Oct 2021, 17:24

      The message is very clear. You need to save the SketchUp file before you run Image Trimmer.

      Etaoin Shrdlu

      %

      (THERE'S NO PLACE LIKE)

      G28 X0.0 Y0.0 Z0.0

      M30

      %

      1 Reply Last reply Reply Quote 0
      • T Offline
        TIG Moderator
        last edited by 9 Oct 2021, 18:04

        @rustar123

        You have two problems...

        1:
        You cannot ImageTrim a PNG in a model that has never been saved - there are temporary files to be saved with the model, so it needs a destination folder....
        Save the model then trim it [assuming the PNG is correctly configured]
        Looking at it, you could speed up processing time by cropping the PNG to exclude the transparent parts around the edges - every pixel is inspected, so having as few transparent pixels as is possible [e.g. by cropping] will give a quicker result...

        2:
        More importantly - You have NOT resolved the incorrect file associations for JAR files.
        It is explained in various usage tips in the tool's posts.
        JAR files MUST be set to open with Java.
        Some decompression apps can hijack this JAR file-type - hence the message from your decompression app !
        Reset the JAR file-type to open with Java [as it should be...]
        Then retry...

        TIG

        1 Reply Last reply Reply Quote 0
        • R Offline
          rustar123
          last edited by 9 Oct 2021, 23:13

          @tig said:

          2:
          More importantly - You have NOT resolved the incorrect file associations for JAR files.
          It is explained in various usage tips in the tool's posts.
          JAR files MUST be set to open with Java.
          Some decompression apps can hijack this JAR file-type - hence the message from your decompression app !
          Reset the JAR file-type to open with Java [as it should be...]
          Then retry...

          So how to reset the JAR file-type to open with Java? thank's

          1 Reply Last reply Reply Quote 0
          • T Offline
            TIG Moderator
            last edited by 10 Oct 2021, 16:35

            Find a .JAR file - there are 10 such files in the SKM subfolder...
            C:\Users\YOURUSERNAME\AppData\Roaming\SketchUp\SketchUp 2021\SketchUp\Plugins\SKMtools
            Select a JAR file's icon > right-click > Open with...
            I your case the entry won't show 'Java*' but some compression tool, so click Choose Another App...
            Find Java in your available apps, then set the .JAR file-type to always open with that... OK to save changes.
            Now JAR files will open properly in Java...

            If you don't have Java installed, then download and install it...
            https://www.java.com/download/ie_manual.jsp
            https://www.tomsguide.com/how-to/how-to-download-java-for-windows

            TIG

            1 Reply Last reply Reply Quote 0
            • B Offline
              blueman2
              last edited by 6 Feb 2022, 15:30

              Seem to be having trouble again getting image trimmer to work.

              I've tried this with multiple png files and have also flattened a few of them and removed the background saving them as transparent pngs.

              The files were saved prior to importing the image.

              Java has been installed and is set to open Jar files

              When the image is imported and selected, Image Trimmer runs, but when it stops, nothing appears to have happened. If I explode the image, it completely disappears. There is an image saved in the Image Trimmer folder but it is the same image.

              I've tried this many times with different versions of the file. Want to eventually push/pull to get an engraved effect. Any help would be appreciated. I may be missing something but I don't know what it is. Thanks

              I've attached some of the image files I attempted to use

              Image 003.jpg
              Image 002.jpg


              martincleanTrans.png


              MartinGuitarrsLOGO.png

              1 Reply Last reply Reply Quote 0
              • T Offline
                TIG Moderator
                last edited by 6 Feb 2022, 15:58

                Your [simplified] PNG works for me...
                I did 'crop' it slightly in Gimp to optimize its processing time, because any excess transparent pixels around it will be ignored, but are still looked at during the processing.
                The two images show the un-smoothed and smoothed outline results...

                You seem to have JAR files set right - are there the files show in the TrimmedImages Folder ?


                CaptureFolder.PNG


                Capture.PNG


                CaptureSmoothed.PNG

                TIG

                1 Reply Last reply Reply Quote 0
                • B Offline
                  blueman2
                  last edited by 6 Feb 2022, 16:46

                  Thanks Tig,

                  Yes I do have a folder of trimmed images

                  I just tried it with a cropped version and still the same result. Am I doing something wrong in the procedure?

                  1. Select surface on model to apply to
                  2. import png as image
                  3. with image selected, run image trimmer
                  4. once it stops running, I explode image

                  after image trimmer runs

                  Image 005.jpg

                  after exploding
                  Image 004.jpg

                  1 Reply Last reply Reply Quote 0
                  • B Offline
                    blueman2
                    last edited by 7 Feb 2022, 19:54

                    Thanks Tig,

                    I think I see where I was making a mistake, I could not find the trimmed files. I expected them to appear where the original image was. When I expanded the view, I saw them sitting off to the side.

                    Image 005.png

                    However, now I'm having trouble getting this onto the face of the object so that I can push/pull. I did redo this one more time and requested that the component he stood up. That worked well but then could not accurately get it onto the face. Any tips for doing this?

                    Thanks again

                    1 Reply Last reply Reply Quote 0
                    • T Offline
                      TIG Moderator
                      last edited by 8 Feb 2022, 12:16

                      If you had told it to make the image-trimmed component stand up it'd be easier to see, and you could then move it into the face, using Move and perhaps Rotate if appropriate.
                      Since the edges if the facets in the instance are hidden and you'll be PushPulling later I suggest you edit it and Select All, them use Entity-Info to remove and Hidden attributes...
                      Once it's in place explode the instance and it should 'merge' into the surface, letting you PushPull its faces as desired...

                      TIG

                      1 Reply Last reply Reply Quote 0
                      • boofredlayB Offline
                        boofredlay
                        last edited by 19 Aug 2022, 16:11

                        @tig said:

                        IMPORTANT NOTICE!

                        There has been a lone report of these tools not working - with a '.jar' file 'opening' rather than 'running'!
                        Many of these tools use small Java '.jar' executable files that do specific tasks like zip/unzip and image manipulation.

                        I have found that I can reproduce this weirdness IF I let a 'zip/unzip' application like AlZip or WinRar 'poach' the '.jar' file-type as one that it will open. If so then when Ruby tries to 'open' a '.jar' file instead of it 'executing' in Java [like it should], it 'opens' in the decompression application...

                        The solution = look at your WinRar etc settings and ensure '.jar' is NOT one of its file-types for opening... 😒

                        Hi TIG. Hope you are well.
                        Sorry for another "it's not working for me" post but that is what this is.

                        I installed the plugin through Extensions Manager, saved a new file, imported an image and run the image trimmer script and get the dots at the bottom and then it blips and nothing happens.

                        I think I made sure the .jar files open with java like you mention above but I guess I have done something wrong.

                        I have attached the SketchUp file I am working with if it helps.

                        Thanks for any help.


                        MAN0004.skp

                        http://www.coroflot.com/boofredlay

                        1 Reply Last reply Reply Quote 0
                        • boofredlayB Offline
                          boofredlay
                          last edited by 19 Aug 2022, 16:48

                          Hmm. I made sure 7zip and Express Zip File Compression were not associated with .jar files. These are the only zip programs on this machine that I can tell.

                          http://www.coroflot.com/boofredlay

                          1 Reply Last reply Reply Quote 0
                          • D Offline
                            Dave R
                            last edited by 19 Aug 2022, 16:57

                            I guess I've never looked to see if any zip utilities are associated with them. I guess I should.

                            Etaoin Shrdlu

                            %

                            (THERE'S NO PLACE LIKE)

                            G28 X0.0 Y0.0 Z0.0

                            M30

                            %

                            1 Reply Last reply Reply Quote 0
                            • D Offline
                              Dave R
                              last edited by 19 Aug 2022, 17:55

                              Hi Eric,

                              I know I'm not TIG but I tried your file and it trimmed just fine. Actually more quickly than I expected.
                              MAN0004.skp

                              Etaoin Shrdlu

                              %

                              (THERE'S NO PLACE LIKE)

                              G28 X0.0 Y0.0 Z0.0

                              M30

                              %

                              1 Reply Last reply Reply Quote 0
                              • T Offline
                                TIG Moderator
                                last edited by 19 Aug 2022, 18:05

                                Some decompression apps 'hijack' .jar files and then Java can't open them.
                                Check that none of your compression apps is doing that.
                                Find one of the .jar files and right-click to see what's set to open it...
                                Use Open with... from the context-menu and choose Java and set it to always open .jar files.
                                Of course you also need to Java installed on your computer !
                                Double check for that...

                                TIG

                                1 Reply Last reply Reply Quote 0
                                • boofredlayB Offline
                                  boofredlay
                                  last edited by 19 Aug 2022, 18:34

                                  Yeah I installed Java prior to posting this and associated .jar with it. Not sure if I did it correctly but you can see the icon next to the .jar files as Java.


                                  java.JPG

                                  http://www.coroflot.com/boofredlay

                                  1 Reply Last reply Reply Quote 0
                                  • T Offline
                                    TIG Moderator
                                    last edited by 19 Aug 2022, 19:31

                                    Looks OK, but of course a ZIP app could be hijacking it too ?
                                    If you right-click on a .jar file what is listed to 'Open' it ?
                                    What is listed for it in 'Open with...' ?

                                    TIG

                                    1 Reply Last reply Reply Quote 0
                                    • boofredlayB Offline
                                      boofredlay
                                      last edited by 19 Aug 2022, 20:15

                                      It seems to be opening with Java...


                                      java2.JPG

                                      http://www.coroflot.com/boofredlay

                                      1 Reply Last reply Reply Quote 0
                                      • T Offline
                                        TIG Moderator
                                        last edited by 19 Aug 2022, 22:49

                                        Your .jar / Java set up seems fine.
                                        Dave R got your image to trim OK - so did I.
                                        So something is wrong on your side ??
                                        Any Ruby Console error messages ?

                                        TIG

                                        1 Reply Last reply Reply Quote 0
                                        • boofredlayB Offline
                                          boofredlay
                                          last edited by 23 Aug 2022, 21:27

                                          Sorry for the late reply, super busy lately.

                                          This is what I get after I run the script.

                                          Error: #<Errno::ENOENT: No such file or directory @ rb_sysopen - C:\Eric Miscellaneous\TrimmedImages\15098587-PcbMIOCd[Edges].dat>
                                          C:/Users/elay/AppData/Roaming/SketchUp/SketchUp 2022/SketchUp/Plugins/SKMtools/ImageTrimmer.rb:277:in readlines' C:/Users/elay/AppData/Roaming/SketchUp/SketchUp 2022/SketchUp/Plugins/SKMtools/ImageTrimmer.rb:277:in make_edges'
                                          C:/Users/elay/AppData/Roaming/SketchUp/SketchUp 2022/SketchUp/Plugins/SKMtools/ImageTrimmer.rb:201:in process_image' C:/Users/elay/AppData/Roaming/SketchUp/SketchUp 2022/SketchUp/Plugins/SKMtools/ImageTrimmer.rb:170:in initialize'
                                          C:/Users/elay/AppData/Roaming/SketchUp/SketchUp 2022/SketchUp/Plugins/SKMtools/ImageTrimmer.rb:834:in new' C:/Users/elay/AppData/Roaming/SketchUp/SketchUp 2022/SketchUp/Plugins/SKMtools/ImageTrimmer.rb:834:in block in <top (required)>'

                                          http://www.coroflot.com/boofredlay

                                          1 Reply Last reply Reply Quote 0
                                          • 1
                                          • 2
                                          • 5
                                          • 6
                                          • 7
                                          • 8
                                          • 9
                                          • 8 / 9
                                          • First post
                                            Last post
                                          Buy SketchPlus
                                          Buy SUbD
                                          Buy WrapR
                                          Buy eBook
                                          Buy Modelur
                                          Buy Vertex Tools
                                          Buy SketchCuisine
                                          Buy FormFonts

                                          Advertisement