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

    Edge length question

    Scheduled Pinned Locked Moved Plugins
    3 Posts 2 Posters 180 Views 2 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.
    • K Offline
      ktkoh
      last edited by

      cface=codef.entities.add_face(@pt)
      							orig_ents = codef.entities.to_a
      							cface.pushpull(-1*@c2depth)
      							if @edge == "Round"
      								fin_ents = codef.entities.to_a
      								added_ents = fin_ents - orig_ents
      								added_ents.each {|e| e.smooth="true" if e.is_a?(Sketchup;;Edge) }
      								added_ents.each {|e| e.soft="true" if e.is_a?(Sketchup;;Edge) }
      							end #if Round
      

      I am using the code to smooth the edges of a Mortise however I don't want to smooth the bottom edges. I have tried several ways to add the test "e.length == @c2depth" but have been unsucessful. Any ideas how to do this??

      Keith

      1 Reply Last reply Reply Quote 0
      • TIGT Offline
        TIG Moderator
        last edited by

        When you make the new face immediately set
        normal=cface.normal
        then after you pushpull it to make the hole [and it's 'gone'] and you've checked it's 'round' and you've got the new geoemtry, you can smooth only those new edges that are parallel to the 'normal' thus:
        added_ents.each{|e|(e.smooth=true;e.soft=true) if e.is_a?(Sketchup::Edge) and e.line[1].parallel?(normal)}
        Note how you can combine the smooth/soft setting into the one test, which halves the processing time.
        Note too that it's =true/ =false boolean NOT strings ="true"/ ="false" [which would both return true because they have a value]

        TIG

        1 Reply Last reply Reply Quote 0
        • K Offline
          ktkoh
          last edited by

          Thanks TIG That was exactly what I needed!!!

          Keith

          11

          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