sketchucation logo sketchucation
    • Login
    πŸ€‘ SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

    Problem with imported geometry.

    Scheduled Pinned Locked Moved Developers' Forum
    11 Posts 3 Posters 933 Views 3 Watching
    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.
    • S Offline
      Skastafari
      last edited by

      I am having an issue with some imported geometry.
      When exploded down, my models faces combine to form a surface with smoothed rounded edges.
      I don't want this.

      I tried this...
      entities.grep(Sketchup::Edge).each{|e| e.smooth=false;e.soft=false;e.hidden=false }
      But the above takes a long time and often crashes SU.

      I found this in the API...
      smooth_flags = Geom::PolygonMesh::NO_SMOOTH_OR_HIDE
      It looks like something added for 2014 release?
      I am trying to figure out how I can apply this to my exploded geometry, if at all.
      Any possible solution would be appreciated.

      1 Reply Last reply Reply Quote 0
      • thomthomT Offline
        thomthom
        last edited by

        @skastafari said:

        I am having an issue with some imported geometry.
        When exploded down, my models faces combine to form a surface with smoothed rounded edges.
        I don't want this.

        Are you using a SU version older than SU2016? There has been a long standing bug which got fixed in SU2016. Previously you might find that under Windows, if SU did a slow operation it might some tiems apply soft+smooth to your selection. Explode is an example of such an slow operation. If this is the case you could perform an undo right afterward and that would correct the unwanted soft+smooth.

        Thomas Thomassen β€” SketchUp Monkey & Coding addict
        List of my plugins and link to the CookieWare fund

        1 Reply Last reply Reply Quote 0
        • S Offline
          Skastafari
          last edited by

          I tried using an array similar to how John suggested, but get no method error on smooth=, I am not sure what causes that. If I undo the the explode, sure It gets rid of the smooth, hide, & soft, but it also brings back the group I don't want. What I really want is to explode with the smooth, hide etc. set to false. It seems like it is on by default? I tried 2016 and got the same problem. The geometry is coming from an OBJ file using Simlab importer. The method I have works, but takes too long and is too unstable to use productively. I have a lot of models to process. I do appreciate the help any other ideas?

          1 Reply Last reply Reply Quote 0
          • D Offline
            driven
            last edited by

            sorry I should have tested my snippet...

            needs edges[0].each to get inside the array...

            I'll edit it above...

            learn from the mistakes of others, you may not live long enough to make them all yourself...

            1 Reply Last reply Reply Quote 0
            • D Offline
              driven
              last edited by

              collect your edges, then run the loop on the collection...

              
              entities = Sketchup.active_model.active_entities # or whatever
              edges = [] # add empty array
              t1  = Time.now
              edges << entities.grep(Sketchup;;Edge) # add edges to the empty array
              edges[0].each{|e| e.smooth=false;e.soft=false;e.hidden=false } # process the array items
              p Time.now - t1 # get a timing to compare with your other method
              
              

              john

              learn from the mistakes of others, you may not live long enough to make them all yourself...

              1 Reply Last reply Reply Quote 0
              • S Offline
                Skastafari
                last edited by

                It's okay John, The result was the same... 8-10 minutes of beach ball followed by either my desired result or a bug splat; toss a coin. What is this used for in API ?..
                smooth_flags = Geom::PolygonMesh::NO_SMOOTH_OR_HIDE
                Is there a way to use this setting on a array?

                1 Reply Last reply Reply Quote 0
                • D Offline
                  driven
                  last edited by

                  are you on a mac now?

                  you should update your profile as it makes a difference...

                  do you import with materials?

                  can you share a smallish .obj file?

                  I may be able to suggest an alternate approach on a mac [that's all I use]...

                  john

                  learn from the mistakes of others, you may not live long enough to make them all yourself...

                  1 Reply Last reply Reply Quote 0
                  • S Offline
                    Skastafari
                    last edited by

                    Honestly John, it is not going to matter. I was trying to get useful geometry from Simlab's OBJ importer, but I am afraid I may have to drop it like a bad habit. There are other issues like the creation of tens of thousands of component definitions that emerge when groups are exploded. I do appreciate all the help I have got here. Thanks for making this community so awesome. πŸ˜„

                    1 Reply Last reply Reply Quote 0
                    • D Offline
                      driven
                      last edited by

                      Jim's Mesh Importer plugin brings in skps that are converted from obj files externally, it's very quick, items fully triangulated [no soft, smooth hidden] but, has no texture...

                      john

                      learn from the mistakes of others, you may not live long enough to make them all yourself...

                      1 Reply Last reply Reply Quote 0
                      • S Offline
                        Skastafari
                        last edited by

                        Yeah, Jim's was kind of ground breaking for the day. I liked Tig's rework with textures, but I still had enough mesh trouble to make it not worth the trouble. I am importing whole house floor plans, and need groups to come in correctly to sort fixtures and the like. This is fairly large scale, over a hundred a week. I don't have a lot of room for error. SimLab offered groups, but when exploded, they turn to components named geom or something. I can easily end up with 70,000 plus unwanted component definitions, so no go with the long purge times. I had a custom build of fluid importer, but it is no longer supported. It looks like fluid obj importer might have a pro version coming out, so I might go that route instead. Thanks

                        1 Reply Last reply Reply Quote 0
                        • D Offline
                          driven
                          last edited by

                          Jim's was updated to use Assimp and the external SU C++ SDKrecently in the last 3 months...

                          just sayin...

                          john

                          learn from the mistakes of others, you may not live long enough to make them all yourself...

                          1 Reply Last reply Reply Quote 0
                          • 1 / 1
                          • First post
                            Last post
                          Buy SketchPlus
                          Buy SUbD
                          Buy WrapR
                          Buy eBook
                          Buy Modelur
                          Buy Vertex Tools
                          Buy SketchCuisine
                          Buy FormFonts

                          Advertisement