sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    Fill component with lines

    Scheduled Pinned Locked Moved Newbie Forum
    sketchup
    4 Posts 2 Posters 145 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.
    • M Offline
      motleypower
      last edited by

      Hello,

      I'm new here although I have been playing around with ruby & vba on and off for a couple of years

      I want to be able to "fill" a component with parallel edges so they form a grid. I've managed to write a very basic repeater that can draw a grid of lines and then I can manually drop a component into the box of lines and then intersect all the lines and then cut off all the ends but how can I make the code do the fill without having to go through all of that.

      Maybe the code would do all of that or maybe it would be smarter and only put lines where they were required in the first place
      Here is what I've written so far, if you set the parameters too high it hangs up
      I work in mm with accuracy 0.1mm in the units settings
      prompts = ["Scan spacing?", "x axis max?", "y axis max?", "z axis max?"]
      defaults = ["0.1", "10", "10", "10"]
      list = ["0.1|0.2|0.4","10|20|30","10|20|30","10|20|30"]
      input = UI.inputbox prompts, defaults,list, "Set up lines."

      scan = input[0].to_l
      xmin = 0
      xmax = input[1].to_l
      ymin = 0
      ymax = input[2].to_l
      zmin = 0
      zmax = input[3].to_l
      lines = (xmax/scan)
      UI.messagebox (lines)
      UI.messagebox (scan)

      while zmin < zmax

      while ymin < ymax

      pt1 = [xmin,ymin,zmin]
      pt2 = [xmax,ymin,zmin]
      ymin += scan
      Sketchup.active_model.entities.add_line(pt1,pt2)

      end
      ymin = 0
      zmin += scan
      end

      ?

      Any pointers in the write direction would be great.

      thanks , Tom


      demonstration of lines

      1 Reply Last reply Reply Quote 0
      • J Offline
        Jim
        last edited by

        Hi Tom,

        There is a plugin named Hatchfaces that sounds like it would meet your requirements.

        http://forums.sketchucation.com/viewtopic.php?t=38637

        Hi

        1 Reply Last reply Reply Quote 0
        • M Offline
          motleypower
          last edited by

          Jim,

          hatch faces looks to be area only. I am trying to do volume. The script I wrote works to generate the box but how would I perform an intersect & trim extents command in ruby so I'm just left with the volume of the component filled with an array of lines ?

          Regards ,
          Tom

          1 Reply Last reply Reply Quote 0
          • M Offline
            motleypower
            last edited by

            I think I'll re visit that area plugin, maybe it can be tweaked.

            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