sketchucation logo sketchucation
    • Login
    1. Home
    2. voljanko
    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!
    πŸ›£οΈ Road Profile Builder | Generate roads, curbs and pavements easily Download
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 22
    • Posts 142
    • Groups 2

    Posts

    Recent Best Controversial
    • Entities.add_group bug?

      Reading the

      @unknownuser said:

      NOTE: calling add_group with entities in its parameters has been known to crash SketchUp before version 8.0. It is preferable to create an empty group and then add things to its Entities collection.

      I'm asking if this is the bug case or is my mistake?
      I have a group of 2 lines and want to group the first line.
      I have put this in the ruby console:

      group1=Sketchup.active_model.selection[0]
      group1.entities.add_group(group1.entities[0])
      

      The result is that the line is not in the subgroup ,but in the new group outside the group1.
      If I delete it,it is also deleted in the group1.
      I would expect to have 1 group(group1) , 1 subgroup with the line and 1 ungroupped line inside group1.

      Is it a bug?

      posted in Developers' Forum
      voljankoV
      voljanko
    • RE: Which face is closest?

      @tig said:

      If you want to know the orientation of a face relative to its edge, then use this http://code.google.com/apis/sketchup/docs/ourdoc/edge.html#reversed_in?
      You can then compare the three faces sharing a common edge and if one is 'backwards' used face.reverse! OR use face.normal.reverse in the testing ???

      This could be exactly what I need,have to test first.
      Thanks.

      posted in Developers' Forum
      voljankoV
      voljanko
    • RE: Which face is closest?

      @tig said:

      You cannot have arbitrary rules about the front/back of the face.

      This is the biggest sub-problem in this problem,I think.
      There is a face side entity missing.

      posted in Developers' Forum
      voljankoV
      voljanko
    • RE: Which face is closest?

      @kyyu said:

      How about comparing distance to face center points (face.bounds.center)?

      Hmm,seems too dependent of the face size.Should be size independent and also face shape independent.

      posted in Developers' Forum
      voljankoV
      voljanko
    • Which face is closest?

      3 faces connected on 1 edge.
      Want to know which face is closest to face1 (face2 or face3),if I look from the back face side.
      I know face2 is closest,but want Ruby to decide πŸ˜„
      I have experimented with normal.angle_between but no success.
      Any suggestions?


      3faces.JPG

      posted in Developers' Forum
      voljankoV
      voljanko
    • RE: Double bounding box

      @dan rathbun said:

      group.local_bounds()

      Yes,it is working,I have test it....BUT,it is only available for groups,not components. 😞

      posted in Developers' Forum
      voljankoV
      voljanko
    • RE: Double bounding box

      Ok,I got it.
      The mistake was that I was taking the bbox of the group,but should take a bbox of the definition of the group,like in your plugin.
      But why didn't you told me to look in your plugin? πŸ˜„

      posted in Developers' Forum
      voljankoV
      voljanko
    • RE: Double bounding box

      Ok,I have check your plugin and find the line

             pts = self.bound_points(bb).map { |pt| pt.transform( entity.transformation ) }
      

      interesting.But I have already try to put the transformation to my point,but the result is wrong:

      cube=Sketchup.active_model.selection[0]
      point=cube.bounds.corner(0)
      point.transform!(cube.transformation)
      UI.messagebox point.to_s
      

      The result that I get is wrong (-0,-1.707,0).
      As you can see on the picture it should be (-0,-0.707,0).
      What em I doing wrong?


      bbox.JPG

      posted in Developers' Forum
      voljankoV
      voljanko
    • RE: Double bounding box

      No,I will explain more:
      I have rotated the group for 45 degrees.
      If I call the group.bounds.corner(0) ,I get the point of the axis aligned bbox (green circle on the picture).
      Instead,I want to have the coordinates of the bbox on the screen ,witch is NOT axis aligned(red circle on the picture).


      doublebbox.JPG

      posted in Developers' Forum
      voljankoV
      voljanko
    • RE: Double bounding box

      Thanks,but I don't need the real bbox.I just need to retrieve the coordinate of one of the corners of the bbox on the picture.
      It should be (-0.707 , 0 , 0) or (0 , -0.707 , 0) .

      posted in Developers' Forum
      voljankoV
      voljanko
    • Double bounding box

      Hello.
      I have a problem to get the coordinates of the rotated bonding box corner.
      On the screen is different bounding box than what I get with group.bounds.corner[0] (this is why "double bounding box" tittle). You can see it on the picture.
      I have tried to apply the transformation of the group to the corner point,but the result is not right.

      I want to have the coordinates of the corner of the bounding box that is on the screen,so x or y should be 0.


      doublebbox.JPG

      posted in Developers' Forum
      voljankoV
      voljanko
    • RE: Draw on face

      Uff,I missed this one,thanks.
      The only problem that I see is that I need a reference to the face.So ,if I don't have it,I have to loop all faces.That is not very nice πŸ˜‰
      I have another solution in my mind,but didn't test jet: edge.faces.length should be more than 0.
      But I'm not shure if the line that I draw on the face will be somehow connected with the face.
      I remember the old versions of sketchup,where the line was floating on the face (bold).

      posted in Developers' Forum
      voljankoV
      voljanko
    • Draw on face

      I'm not trying to make a tattoo on my face πŸ˜„ ,just want to detect ,if the line (edge) that I draw,is on the face.
      Example:

       model.active_entities.add_line( start, end )  
      

      Now I want an information if this entire line is on some face.

      posted in Developers' Forum
      voljankoV
      voljanko
    • RE: Unicode characters problem

      The problem was in the file,not in the code.
      I have saved the file in notepad as UFT-8 ,so I can "unpack" the character.
      I have tried to save the file in other formats (unicode,ANSI,unicode big endian) and is always giving me errors.
      So only UFT-8 is ok.
      Problem solved πŸ˜„

      posted in Developers' Forum
      voljankoV
      voljanko
    • RE: Unicode characters problem

      Hello.
      Another unicode related problem.I can repeat this one only reading from a file,so the file with 1 character is attached.
      I can read a character,but is causing some problems if I want to unpack it or concatenate it with other strings.
      Here is the sample,where I want to unpack it:

      	langfile= Sketchup.find_support_file("fr1.lang" , "Plugins/")
      
      	IO.foreach(langfile) do |line|
      		UI.messagebox line.unpack('U*')
      	end
      

      The error is :"Error Loading File new.rb
      malformed UTF-8 character (expected 3 bytes, given 2 bytes)"

      Why is this,how to deal with it?


      fr1.lang

      posted in Developers' Forum
      voljankoV
      voljanko
    • RE: Unicode characters problem

      Yes, I'm implementing my own translation system.Strings are in files,like you suggested.

      posted in Developers' Forum
      voljankoV
      voljanko
    • RE: Unicode characters problem

      Thank you for the very useful reading.
      Seems that is a lot of work to implement multilingual support.

      posted in Developers' Forum
      voljankoV
      voljanko
    • Unicode characters problem

      Hello.
      If I put the code

      UI.messagebox "weiß"
      

      in the Ruby console inside Sketchup,is working ok.
      But the same code inside the plugin is giving me an error.
      I have try it in notepad++ and NetBeans with the some result.

      Why is that,what to do about?

      posted in Developers' Forum
      voljankoV
      voljanko
    • RE: Bug Splat on erase!

      But also Dan's suggestions have positive results:
      In the activate method of the tool I have put the

      Sketchup.active_model.start_operation "myTool",true,true,false
      

      And I have put the

      Sketchup.active_model.abort_operation
      

      in the deactivate method of the tool and in the onPreSaveModel model observer.
      Now the group is disappear before saving the model.
      Thank you both.

      posted in Developers' Forum
      voljankoV
      voljanko
    • RE: Bug Splat on erase!

      Thank you for pointing this out,I was really stacked wit this BugSplat.
      So, more new functions to learn. πŸ€“ πŸ˜„

      posted in Developers' Forum
      voljankoV
      voljanko
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 5 / 8