sketchucation logo sketchucation
    • Login
    1. Home
    2. jolran
    3. Posts
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 37
    • Posts 1,027
    • Groups 2

    Posts

    Recent Best Controversial
    • RE: Get rotation(transformation)

      I finally got TIG's version going(forgot to comment out #def.self when running it in R.code.editor, amanidiot!)
      SOme funky thing going on when changing hatch_angle. But its stable and works in any axis.

      Not what can be said about "my" script. A bit unstable, until the intersectionpart.
      My intuition tells me doing copying edges within groups + intersection gives more predictable hatch_result when rotating hatches. But is alot more unstable when gathering and erasing?

      Plan A: Stop whining and get the work done so Layout-users finally have a hatch-plugin πŸ˜„

      Plan B: Adjust TIG's script so it works in all angles, with menus and such.
      (will be difficult, since I don't totally understand it yet)

      PlanC: Continue to work on mine(a bit egoistic but I won't learn from copy/paste), integration as much of TIG's script as I can, thus make my script more stable if possible.
      However. That might not be possible, and I would have to do at least 5 different methods for views.

      I guess I'm asking if there is any pointers for things to avoid that make this script crash.

      posted in Developers' Forum
      jolranJ
      jolran
    • RE: Get rotation(transformation)

      I'm getting it to work almost.

      @unknownuser said:

      vector.length=20.0

      The copied distance will always be desired length on the vectors line, but depending on the angle of diagonal the edges will not be same distance apart. So I guess I will have to do another compensation? Or is there some Quick fix like the last one(thank you TIG)

      I'm guessing will have to do a comparison between Diagonal, user(desired angle, here 45 deg) and somehow
      compensate the copy distance for that. Boy this is hard..

      mod = Sketchup.active_model # Open model
      ent = mod.entities # All entities in model
      sel = mod.selection # Current selection
      
      =begin
      TODO
      Wrap in module.
      Get proper names. Shorter strings.
      def methods for different Axis. Name them as SU views.
      After Inputbox call appropriate method.
      Use instance or global variables, necessary?
      INPUTBOX promt; Hatch line degrees, distance between edges.
      Extras; Background color, keep background?
      Intersect with method.
      =end
      
      
      
      face_group = ent.add_group(sel)
      Sketchup.active_model.selection.add( face_group )
      
      bbox = face_group.bounds
      
      bpt1 = bbox.corner(0)
      bpt2 = bbox.corner(1)
      bpt3 = bbox.corner(2)
      bpt4 = bbox.corner(3)
      bpt5 = bbox.corner(4)
      bpt6 = bbox.corner(5)
      bpt7 = bbox.corner(6)
      bpt8 = bbox.corner(7)
      
      pt1 =bpt1
      pt2 =bpt2
      pt3 =bpt3
      pt4 =bpt4
      pt5 =bpt5
      pt6 =bpt6
      pt7 =bpt7
      pt8 =bpt8
      
      # get center, diagonal vector directions from bbox
      # mesure angle between x and diagonal
      
      x_cen = bbox.center
      x_diag = bbox.diagonal
      x_vect = pt1.vector_to pt4   # horisontal X-axis line
      diag_vect = pt1.vector_to pt6  # vector across
      x_ang = x_vect.angle_between(diag_vect).radians   
      user_input = 45   # Will get shorter alias
      user_length = 20.cm # Will get shorter alias substitute for cm? Must work in inches.
      
      
      h_group =ent.add_group()
      line_group=ent.add_group() ###==new empty groups
      line_group.entities.add_line(pt1, pt6)
      
      # rotate and reset parallel to X
      tr1 = Geom;;Transformation.rotation x_cen, [0,1,0],(x_ang).degrees
      tr2 = Geom;;Transformation.rotation x_cen, [0,1,0],(user_input).degrees
      ent.transform_entities tr1, (line_group)
      ent.transform_entities tr2, (line_group)
      
      cop_dist = x_diag/2   #copy distance/2 copies from center to top corner
      cop_times = cop_dist/user_length   
          
      vector=diag_vect
      vector.length= user_length
      gp=line_group
      groups=[gp]
      cop_times.to_i.times{|i|
      tgp=gp.copy
      tgp.transform!(Geom;;Transformation.translation(vector))
      gp=tgp
      groups << gp
      } 
      #my_transformed_vector.length=20.0   
      
      
      
         
      
      
      
      
      posted in Developers' Forum
      jolranJ
      jolran
    • RE: [Plugin] Hatchfaces (v1.8 beta) UPDATED 15-Dec-2012

      Strange. Should work, but no innerface is created.
      Hatch gets created over whole face. I tried different combinations with
      these new lines added, but get errors then..

      gp=ents.add_group()
            gp.name=name
            gents=gp.entities
            face=gents.add_face(face.outer_loop.vertices) # adds a faceclone from outer vertices loop
            faces2go=[]  # was faces2gp? Typo? array for innerloups faces
            face.loops.each{|loop|gents.add_face(loop.vertices)}   # creates inner loop 
            gents.each{|face|
            next if face.class!=Sketchup;;Face     
            face.edges.each{|e|
            if not e.faces[1]
            break
            end
          faces2go << face
        }
      }
            gents.erase_entities(faces2go)                #erase the faces in the holes 
      
      posted in Plugins
      jolranJ
      jolran
    • RE: [Plugin] Hatchfaces (v1.8 beta) UPDATED 15-Dec-2012

      Yes that make sence. I had already put a similar code from your pm in my editor where I had used ents.

      That was wrong then from my part. Makes thing clearer. Thanks! πŸ˜„

      posted in Plugins
      jolranJ
      jolran
    • RE: [Plugin] Hatchfaces (v1.8 beta) UPDATED 15-Dec-2012

      Great info! Will work on that.

      Do you mean {|loop|gents.add_face

      or {|loop|ents.add_face ?

      Thank you TIG. Got me some homework πŸ˜„

      posted in Plugins
      jolranJ
      jolran
    • RE: [Plugin] Hatchfaces (v1.8 beta) UPDATED 15-Dec-2012

      He he! As easy as that, huh? πŸ˜„ Well there you have it guys!

      I will work on those things. And put an option of angle on second hatching. That would give you as much flexibility as
      needed for linehatching I presume?

      The "holes"... Hmm difficult. I have been searching posts about that subject(Don't just want to add anything unless I actually understand what is going on). If I understood it right, holes are somewhat problematic in Sketchup. One have to
      use both face.outer_loops AND face_loops to get to the face hole geometry? Where face_loops is innerloop? Or include.all loops? That is a big difference.

      In API it says: Face outer_loops retrieves a "face loop object" But what does that mean?
      Edges, vertices? Both? Is it an array?

      For a newbie like me to interprate the API is quite difficult.
      The posts in here are very helpful, but it takes time to search specific posts. There are currently around 146 pages * 25 * (number replies) in just the developper section. πŸ˜„

      So with that said, I am very greatful for your help TIG.

      posted in Plugins
      jolranJ
      jolran
    • RE: [Plugin] Hatchfaces (v1.8 beta) UPDATED 15-Dec-2012

      About added features:

      To put hatches in a layers(newly created OR selected) is possible, at least create a new layer. I was thinking of adding that anyway.

      @unknownuser said:

      If you do two hatches of the same face, is it possible to get both hatches in the same group.

      It is a good idea, looking at how the plugin works right now. But it's risky business adding geometry inside groups, and you probably have to select the created hatchgroup before running. Wich in turn will not add that much improvement in workflow?
      But if you really, REALLY want that feature... It won't hurt testing..

      My personal view is that I should rather investigate the possibilitie to improve the plugin with a "pattern library" instead. No promises can be made in that regard though. It seams difficult.

      @unknownuser said:

      TIG, kyyu, please do not leave jolran alone
      πŸ˜„

      TIG's been helping me a LOT! Through PM's and more, otherwise this plugin would not exist. KYuu fixed the spacing and that was mucho importante.

      posted in Plugins
      jolranJ
      jolran
    • RE: [Plugin] Hatchfaces (v1.8 beta) UPDATED 15-Dec-2012

      Thank you for your input guys!! Good points!

      I will answer more profound tomorrow. I'm a bit in a hurry! For Now, here is a minitut or tips, as a compensation that the hole "issue" isent fixed yet. πŸ˜‰


      Hatchtut2-1.jpg

      posted in Plugins
      jolranJ
      jolran
    • RE: [Plugin] Hatchfaces (v1.8 beta) UPDATED 15-Dec-2012

      Why thank you 😳 But I really think you should thank TIG and Kyuu.

      Feel free to ask for ways to improve! Or even come up with ideas πŸ‘

      posted in Plugins
      jolranJ
      jolran
    • RE: [Plugin] Hatchfaces (v1.8 beta) UPDATED 15-Dec-2012

      Yeeyy!!! It works now!

      I had to think a little bit πŸ˜„ Where some typos(I hope I did not destroy anything ❓ )

      Anyway it works. Will post update soon..

      gents.to_a.each{|e|e.erase! if e.valid? and e.class==Sketchup;;Edge and e.faces.length==0}
            edges2go=[]
            gents.each{|e|edges2go << e if e.class==Sketchup;;Edge and not e.faces[1]}
            gents.erase_entities(edges2go)
      

      Thanks to TIG this plugin gets updated once more πŸ˜„

      posted in Plugins
      jolranJ
      jolran
    • RE: [Plugin] Hatchfaces (v1.8 beta) UPDATED 15-Dec-2012

      Ver 1.2 zip added at first post.

      posted in Plugins
      jolranJ
      jolran
    • RE: [Plugin] Hatchfaces (v1.8 beta) UPDATED 15-Dec-2012

      He he! I can't make this work. I wish it was as simple for me as it is for you 😳

      @unknownuser said:

      before your code to finally erase all faces.

      By that you mean after the intersection and before the erasing?

      The "hole" issue is putting a hole in my brain.

      posted in Plugins
      jolranJ
      jolran
    • RE: [Plugin] Hatchfaces (v1.8 beta) UPDATED 15-Dec-2012

      Been at it all morning. Seems not that easy to erase surrounding edges as I thought.
      Outer edges are most possible, but I suspect you just want the hatched (eg45 deg or so) lines remained? Probably missing something in my code..

      @unknownuser said:

      Takes alot of time at our level, to do even simple stuff.

      Damn right about that 😠 πŸ˜„

      But you are far ahead of me in Ruby-knowledge 😳

      Cheers Sadyo

      I guess this thread is supposed to be about updates and wishes? So won't discuss too much code in here.

      posted in Plugins
      jolranJ
      jolran
    • RE: [Plugin] Hatchfaces (v1.8 beta) UPDATED 15-Dec-2012

      Hi Atelerpaar!

      I did not think of that until you mentioned it now. Good suggestion πŸ‘ That would be the behaivior one would expect. Also files would get smaller. I will try my best πŸ˜„

      I have an new idea for getting different patterns. 2d DCs with intersection. Don't know if it is possible, have to do some research. But then a library of concrete and such could be made with a webdialog and thumbnails. Needles to say, quite a project..

      Any interest in that? Or are textures already sufficient as they are for that purpose?

      (my personal feeling is that textures get ugly in Layout unless perfectly scaled, Richards masking-method works ok, but is not 100% flexible)

      posted in Plugins
      jolranJ
      jolran
    • RE: [Plugin] Hatchfaces (v1.8 beta) UPDATED 15-Dec-2012

      Thanks KYYU πŸ˜„

      And thank you for that explanation. You are most helpful!

      posted in Plugins
      jolranJ
      jolran
    • RE: Hatching

      He he!! Thats the price to pay!

      Interesting you should mention. I was doing a test.

      Thats quite a few hatches....


      Quantity.jpg

      posted in LayOut Discussions
      jolranJ
      jolran
    • RE: [Plugin] Hatchfaces (v1.8 beta) UPDATED 15-Dec-2012

      The thing about curved surfaces in Sketchup is.. They consist of a bunch of lines!
      Look at the half cylinder in revealed hidden lines, one see how the cylinder is made out
      of edges. When running the plugin, even if the lines are hidden they will get detected,
      with following result.

      For NOW! A temporary fix for faces with holes (until I have included TIG's solution)
      is to create a temporary edge across the face(before running the plugin). It will need to be deleted in both the hatches and on the face...

      Alignment is still a little problematic. When running 2 faces next to each other(2 separate times) one would expect the lines to get aligned to each other, where the vertices meet.
      In my original idea the grouped edges where copied FROM center outwards 1 time in each direction, so maybe try to implement that behavior in this version too if possible.


      Hatch_minitut2.jpg

      posted in Plugins
      jolranJ
      jolran
    • RE: [Plugin] Hatchfaces (v1.8 beta) UPDATED 15-Dec-2012

      Spacing should be working now! Ver 1.1 added(in first post)

      Thanks KYYU!

      posted in Plugins
      jolranJ
      jolran
    • RE: [Plugin] Hatchfaces (v1.8 beta) UPDATED 15-Dec-2012

      Guys, I'm glad youre showing interrest in this plugin! I will try to do by best to improve it.
      About Autocad compability.. You have to realize, 2 months ago I had no programming experience att all and
      that feature sounds fairly complex. I think priority must be made to get spacing OK, and holes get filled.

      Now with the help of TIG and KYYU here things can go quite faster.
      TIG pm me about the "hole" issue, so his given me "homework" on that πŸ˜„

      KYYU! Really appricate your effort!
      I will try you fix!

      @unknownuser said:

      file_loaded("Hatchfaces.rb")

      Hmmm, thought I did not need that. It's not loading right for you?
      
      posted in Plugins
      jolranJ
      jolran
    • RE: [Plugin] Hatchfaces (v1.8 beta) UPDATED 15-Dec-2012

      Hi.

      It,s all edges= geometry. It will get detected in other Cad-programs(hopefully) through export.
      Not all Cad programs use materials with textures, Doublecad for ex(as far I know).
      Also I can Imagine an advantage with edges against tetxtures in Layout as well. Vector vs raster vs Hybrid, when zooming for ex. printing.

      I am thinking of getting into Layout, doing all the bits in there. CD, buildingpermits etc.

      How long is setuptime using textures? How difficult is it to get correct alignment with textures?
      How "big" do the textures have to be to not get jaggy? These are all questions I would like to have answered for a good
      workflow with Layout.

      So I am glad you brought it up.

      posted in Plugins
      jolranJ
      jolran
    • 1
    • 2
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 48 / 52