sketchucation logo sketchucation
    • Login
    1. Home
    2. jolran
    3. Posts
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    πŸ«› Lightbeans Update | Metallic and Roughness auto-applied in SketchUp 2025+ Download
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 37
    • Posts 1,027
    • Groups 2

    Posts

    Recent Best Controversial
    • RE: Soften coplanar ?

      @unknownuser said:

      We have updated docs pending for release.

      That's awesome news!

      @unknownuser said:

      entities.fill_faces_from_mesh(mesh, true, 2 | 😎

      Right. Will try that.

      I persume you mean one can choose between 2 or 8, not apply expression in argument?

      posted in Developers' Forum
      jolranJ
      jolran
    • RE: Soften coplanar ?

      Yeah, I noticed some "irregularities" during some tests. This won't cover all scenarious, and to add many validychecks on top of fill from mesh would be to compute intensensive when dealing with plenty of geometry.

      Since TIG is not a "mindreader" ( or is he πŸ˜„ ), I probably should have mentioned that the motif for creating this method is to try to restore a polygonsmesh to it's true geometry when baking. And the true meaning faces from a Component or Group.

      Unfortunately if having faces with holes they don't come out well when baking the mesh unless I triangulate the faces. And since I probably will do something to the Mesh, the original face-Component cannot be used as a reference for removing holes after an intersection. At the moment I'm only triangulating faces with 5 or more vertices..
      A face with a hole have minimum 6 vertices (?)

      edit: removed some irrelevant...

      posted in Developers' Forum
      jolranJ
      jolran
    • RE: Soften coplanar ?

      The polygonmesh class is really a piece of art filled with mysterious behavior.

      Dug up this old thread:

      http://sketchucation.com/forums/viewtopic.php?f=180%26amp;t=27470%26amp;p=237996%26amp;hilit=PolygonMesh#p237996

      It does not seam to be accurate what says there.

      I'm using Thomthoms example for hidding edges with negative index values.
      Creating a Group and adding entities with add_faces_from_mesh or fill from mesh.

      Following that example mesh.add_polygon(1,-2,3) etc. Using positive values VS negative values has no effect.
      No smooth_flags argument sets default to (12 ?)
      So using mesh.add_polygon(1,2,3) gives same result as mesh.add_polygon(1,-2,3)

      Am I missing something ? There's no follow up in that thread stating what I'm experiencing here..

      posted in Developers' Forum
      jolranJ
      jolran
    • RE: Soften coplanar ?

      This gives a little more flexibility if put as options. Could be better written..
      Bit dangerous deleting edges like that..

      
      edges = bake_group.entities.grep(Sketchup;;Edge)
      		
      # Options for ex dialog
      delete_coplanar = true
      angle_a = 0.001
      angle_b = 35
      		
      for e in edges 
        next if e.deleted? 
        next unless e.faces.length == 2  
        ang = e.faces[0].normal.angle_between(e.faces[1].normal)
      			
        case ang
        when delete_coplanar && 0.degrees 
          e.erase!
          next
        when [angle_a, 0.0001].max.degrees...angle_b.degrees 
          e.soft=true && e.smooth=true 
        when ang > angle_b.degrees
          #e.material = "red" #debug!
          e.soft=false && e.smooth=false 
        end
      		
      end
      
      posted in Developers' Forum
      jolranJ
      jolran
    • RE: Soften coplanar ?

      Yeah, that works for me too.

      rest of code ? I'm just grepping edges after add_faces_from_mesh.
      And then running the code you provided.

      Had to use add_faces_from_mesh not to get smoothed edges (?).
      Strange.. Must have broken something cause did not have any problems with fill from mesh before. Need to laborate with the fill_from_mesh parameters..

      edit: β˜€ must have removed the second parameter in fill_from_mesh( mesh, true, 0)
      accidentially. now it works, and much faster!

      edges = bake_group.entities.grep(Sketchup;;Edge)
      for e in edges 
         next unless e.faces.length==2 && e.faces[0].normal.parallel?(e.faces[1].normal)
         e.soft = true && e.smooth = true 
      end
      
      posted in Developers' Forum
      jolranJ
      jolran
    • RE: Communication best practice

      If I remebered correctly Thomthom recommended JSONP for that. Have tried yet, but I have seen the recommendation in other places.

      Edit: Here's the thread. but when rereading the post I realize this may not be relevant

      http://sketchucation.com/forums/viewtopic.php?f=180%26amp;t=54288%26amp;p=492113#p492113

      posted in Developers' Forum
      jolranJ
      jolran
    • RE: Soften coplanar ?

      Works well if I add:

      next unless e.faces.length==2 && e.faces[0].normal==e.faces[1].normal && e.faces[0].normal.reverse==e.faces[1].normal.reverse
      

      Could be something messed up in my mesh, but face down faces at ORIGIN plane got ignored.

      An API method might have been faster, but this will do well.

      Thanks!

      posted in Developers' Forum
      jolranJ
      jolran
    • RE: Soften coplanar ?

      Thanks TIG! I'll try that.

      Although I wished not having to loop Everything one more time πŸ˜„

      posted in Developers' Forum
      jolranJ
      jolran
    • Soften coplanar ?

      Hi.

      Is there anything like Sketchups native soften coplanar in the API ?

      It would be convienient for when baking Polygonsmesh with triangualted faces.

      posted in Developers' Forum
      jolranJ
      jolran
    • RE: Colored faces

      try changing matl = Sketchup::Color.new(0,250,154) to (0,250,154, 100)

      and

      faces.each{|face|
      	  face.back_material = face.material = matl
      	  face.material.alpha = 0.5
          }
      

      edit: Updated code for backface as you wanted. And the 4rth argument is actually not needed in th Color object..

      posted in Developers' Forum
      jolranJ
      jolran
    • RE: General question - definition of units (inch/metric)

      Heh, it was like this for 100 puts statements in the console.

      to_s_to_l: 2.884
      using send: 2.915

      Rookie premature refactoring gone bad πŸ˜„

      posted in Developers' Forum
      jolranJ
      jolran
    • RE: General question - definition of units (inch/metric)

      Your right! 😳

      I wrongly assumed using send instead would be faster, which it isent.

      posted in Developers' Forum
      jolranJ
      jolran
    • RE: General question - definition of units (inch/metric)

      Normally the user would like to work in current set Units.

      To convert numbers to that, you could use this for starters ?
      Someone else may come up with better idea, just a rough idea..

      edit: ah! I missed Thomthoms SketchUp-Units-and-Locale-Helper

       #default
      @su_units = ;inch
      
      def set_model_units
      	current_unit = Sketchup.active_model.options["UnitsOptions"]["LengthUnit"]
      	return case current_unit
      		when 0 then @su_units = ;inch
      		when 1 then @su_units = ;feet
      		when 2 then @su_units = ;mm
      		when 3 then @su_units = ;cm
      		when 4 then @su_units = ;m
      	end
      end
      
      # init 1 time in your module
      set_model_units
      
      puts 5.to_l
      
      puts (5).send( @su_units )
      
      posted in Developers' Forum
      jolranJ
      jolran
    • RE: How to create a face with a hole touching its edge?

      πŸ‘

      Not too much code either.

      posted in Developers' Forum
      jolranJ
      jolran
    • RE: How to create a face with a hole touching its edge?

      That's a bug. Won't intersect either.

      I wonder if it's related to this problem.. Some funny thing going on here,
      although this is done by hand.

      Face is recognized somehow although deleted..


      materialVanish.jpg

      posted in Developers' Forum
      jolranJ
      jolran
    • RE: They (sell >> correction >>) USE our plugins in China

      What the heck 😲

      What's up with that ?

      posted in Plugins
      jolranJ
      jolran
    • RE: Webdialogs for SketchUp ......RIP!

      Strange I don't seam to be able to paste the link properly. Never mind. The topic was called UI.timer or something like that.

      From what I understand the outcome from that topic was about the same as you says.

      I think I misstook c++ threads for Ruby threads. You could probably say anything regarding C code, and I believe it..

      posted in Developers' Forum
      jolranJ
      jolran
    • RE: Webdialogs for SketchUp ......RIP!

      That doesent confuse me less πŸ˜„

      About threads, I was under the impression Sketchup threads was a bit shaky ? Although I can't really tell the outcome from this topic.

      http://sketchucation.com/forums/viewtopic.php?f=180&t=51701&p=467287&hilit=threads#p467287

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

      Right, that was my opinion too. Not Always good printing result.

      There may be a possibility to pull off a few simpler pattern combinations in code.
      Which would be faster to intersect.

      OK, I pull up this one a notch in priority then. No promises made. Gotta try and finish some projects and not just start new ones πŸ˜„

      posted in Plugins
      jolranJ
      jolran
    • RE: Webdialogs for SketchUp ......RIP!

      Aha, interesting. Will chew on it a little..

      My brother is a .net developper with quite a bit of knowledge of C++, so I could probably get a big kickstart and set up. Otherwise I woulden't even consider trying..

      Anyway, thanks again! I'll keep an eye on you projects πŸ˜‰

      posted in Developers' Forum
      jolranJ
      jolran
    • 1
    • 2
    • 11
    • 12
    • 13
    • 14
    • 15
    • 51
    • 52
    • 13 / 52