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: Testing Ruby VALUES in C-extension.

      Thanks!

      The first 1 I have read(apperarently not very thourough πŸ˜„ ). The second one looks interesting, will try to get my hands on that.

      In pragmatic P they say ruby VALUES in C with a few execptions simply are pointers to objects/memory.

      edit: Book nr 2. Very interesting read πŸ‘ There's a lot to digest. I have a lot to learn. Sigh.. Not enough daylight..

      posted in Developers' Forum
      jolranJ
      jolran
    • RE: Wind generator

      @unknownuser said:

      But neither he nor I could come up with a clutch to slow the blades down in high winds

      Don't know if possible, but another approach could be changing the angles of the blades in the wind direction ? Like an umbrella ? That could ease the force of the wind.
      Sort of lika a PAX fan closing. Could be problematic if winds changes irradically.
      http://www.pax.se/en/product/accessories-fans/passad-backdraught-shutter

      posted in Corner Bar
      jolranJ
      jolran
    • Testing Ruby VALUES in C-extension.

      I'm using the Hello world C++-extension example and playing around with it, trying to get a grip of things..
      Thank you very much for putting that, up by the way πŸ‘

      This is probably a very basic noob question. But can we compare Ruby objects for equality when they are in C/C++ ? Before converting them to structs or whatever..
      Or maybe do other tests.
      (GC-issue, and altering Ruby VALUES set aside for a moment)
      I was under the impression C dident have a clue what VALUES where..

      Actually I'm testing Sketchup Point3d objects, so I presume it's not entirely correct to say they are real Ruby objects.

      I made a simple test case that seams to give me the correct answer:
      It's just added to the Hello world example..

      
      //C++
      VALUE test_2_objects(VALUE self, VALUE obj1, VALUE obj2) {
      
      	if ( obj1 == obj2 )
      		return Qtrue;
      	else
      		return Qfalse;
      }
      

      Then a simple call to C

      def self.test2objs()
      		
      		pt1 = Geom;;Point3d.new(0,1,3) 
      		pt2 = Geom;;Point3d.new(66,10.55,3) 
      		
      		r1 = EC_CEXT;;test_2_objects(pt1, pt1)
      		puts "2 Equal points. Are equal ? #{r1}" 
      		
      		r2 = EC_CEXT;;test_2_objects(pt1, pt2)
      		puts "2 Not equal points. Are equal ? #{r2}" 
      end
      

      Which then puts:

      2 Equal points. Are equal ? true
      2 Not equal points. Are equal ? false

      Can't be that simple ? Really ? πŸ˜„

      Ive seen conversion from Points to struct. But I was thinking of avoiding that step unless needed to compare x,y,z values or altering the values.

      Testing for ex a vector3d against Point3d does not give an error BTW..

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

      That looks really nice, I must say.

      What I think people want is the edgepatterns in Sketchup, so they can get better print in Layout. (That does come at a cost so I do understand why you use textures)

      I don't think one can insert a DXF in LAyout ?
      So the workflow is to export DXF. Import DXF to SKetchup and Align to sectioncut, or am I missing a step ?

      Best regards/
      Joel

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

      Hi Elvirem.

      Can you be more specific, "than it does not work", please.
      I woulden't even know where to start debugging..

      Since Dave R (Thank you) can provide a screenshot of a working solution the issue is not general.

      @unknownuser said:

      If anybody knows how to develop this plugin for mac, that would be really great

      I havent updated the plugin for quite a while, since working on other plugin. But I intend to update at later point, even have code for doing so. So I would prefer letting me be in charge of updating my plugin.

      As Dave said, please come back with some more information, and I try to help you πŸ˜„
      / Joel

      posted in Plugins
      jolranJ
      jolran
    • RE: Put forward drawings openGL

      It's working πŸ˜„

      posted in Developers' Forum
      jolranJ
      jolran
    • RE: Put forward drawings openGL

      We use the draw2d methods because they DO draw in front of Sketchup Geometry.

      (I'm sure someone is going to pitch in and tidy this info πŸ˜„ )

      The view.screen_coords method converts 3d(x,y,z) positions to screen X and Y positions, (valid as 2nd argument in the draw2d methods).

      For an easy example. to convert a boundingbox cornerpoints to view screen points (untested!):

      # Somewhere in your class...
      bb = @group.bounds # could be any element responding to Bounds.
      @corners_to_screen_position = (0..7).collect{|i| view.screen_coords( bb.corner(i) ) }
      
      # in your toolclass draw-method
      
      view.draw2d( GL_POINTS, @corners_to_screen_position )
      

      You could use any GL constant for drawing other types of geometry, but this should give you the idea.

      posted in Developers' Forum
      jolranJ
      jolran
    • RE: Put forward drawings openGL

      Ahh, ok. Now I see what you meant. Good point.

      I don't think one can have costume tools active alongside Sketchup native tools(They are not written in Ruby?)
      I havent seen that anyway. Would save a lot of effort if possible..

      posted in Developers' Forum
      jolranJ
      jolran
    • RE: Put forward drawings openGL

      Nice Anton_S! Useful code.

      @unknownuser said:

      However, I can't make it work while the other tool is active.

      Can't one just delegate to the other class/tool ?
      Or are you talking about some other issue..

      Initializing an instance of the other toolclass in current tool and delegate the useful methods ?

      Or is that bad practice or do there exist a better way ?
      I'm interested in doing this properly..

      posted in Developers' Forum
      jolranJ
      jolran
    • RE: Put forward drawings openGL

      use view 2d methods and transform to screen cordinates to with view.screen_coords ?

      posted in Developers' Forum
      jolranJ
      jolran
    • RE: Ruby: 3d align components

      Do you want to make the plugin yourself or do you just need the functionality for you own use ?

      I have code for hatching faces with components that hasent made it into Hatchfaces yet..

      You can pm me if you like..

      posted in Developers' Forum
      jolranJ
      jolran
    • RE: Parametric modeling, anyone?

      Hi Joel.

      No, this is a different thing than the one I was working on back then.
      There are no release yet, and no date set.

      You can PM me for specific questions/suggestions, should you wish to πŸ˜„

      posted in Corner Bar
      jolranJ
      jolran
    • RE: Retrievin object's absolute height ??

      Dats true. But I don't understand why you opt to create a new Array for each edge instead of a ternary πŸ˜•

      posted in Developers' Forum
      jolranJ
      jolran
    • RE: Retrievin object's absolute height ??

      @unknownuser said:

      element.bounds.max.z

      Yeah, that's way simpler...
      But as TIG pointed out bbox cp is not always safest way to find highest vertex, so normally one end up traversing the collection anyway.

      I'm starting to wonder if TO wants to measure the face height..

      to reuse the transformation origin maybe try this.. I guess theres more than 1 way to do this.

      targetZ = 0
      org = group.transformation.origin
      
      group.entities.to_a.grep(Sketchup;;Edge).each{|edg|
          sz = edg.start.position.z
          ez = edg.end.position.z
          tmax = (sz > ez ? sz ; ez) + org.z
          next unless tmax > targetZ 
           targetZ = tmax
      }
      puts targetZ.to_l
      
      posted in Developers' Forum
      jolranJ
      jolran
    • RE: Retrievin object's absolute height ??

      πŸ˜„

      I interpreted this as highest point.

      @unknownuser said:

      i would like to calculate the height of a defined point (say toppoint of a bbox)
      above absolute sketchup 0,0,0.

      posted in Developers' Forum
      jolranJ
      jolran
    • RE: Retrievin object's absolute height ??

      I haven't follow along the other discussion so pardon me if butting in..

      But If your only concern is the get the heighest elements point(?) won't this code work regardless of any transformation made ?

      %(#FF0000)[bb = group.bounds # could be any element responding to Bounds.
      cornersZmax = (0..7).collect{|i| bb.corner(i).z }.max]

      I tested and it seams to be working. ?

      posted in Developers' Forum
      jolranJ
      jolran
    • RE: Retrievin object's absolute height ??

      Does this work ?

      If I resue my code with TIG's recommendations..

      gpz = group.transformation.origin.z
      zmax = pts.map{|p| p.z + gpz }.max

      You could also have a look at Bounds.corner.points and get the highest Z value from those,
      unless you are interested in a particular vertice or so..

      posted in Developers' Forum
      jolranJ
      jolran
    • RE: Retrievin object's absolute height ??

      array.max
      For a collection of points you could do for ex:

      zmax = pts.map{|p| p.z }.max

      posted in Developers' Forum
      jolranJ
      jolran
    • RE: Parametric modeling, anyone?

      @unknownuser said:

      I first started using C extensions for Vertex Tools - in order to implement the soft selection feature with any reasonable performance. Scripted languages are usually slow for calculations - Ruby especially so.

      Yeah I have the impression Ruby works fine for a while, but when you hit a wall it slows down exponentionally..

      I'm looking into the C-stuff. Got some help now..

      posted in Corner Bar
      jolranJ
      jolran
    • RE: Set_position for modal dialog

      If I remembered I hustled with this some time ago and lost patience.

      Solution, just make a html div/modal dialog on top and block layers underneath.

      Might be a simpler solution..

      Link Preview Image
      Making a div that covers the entire page

      I would like to make a div that covers the entire page. I put a css style with height:100% but this covers only the viewable area. I want it to also cover the area when I scroll down.

      favicon

      Stack Overflow (stackoverflow.com)

      edit: I think I missread you problem. It's more related to position, rather than creating modal dialog..

      posted in Developers' Forum
      jolranJ
      jolran
    • 1
    • 2
    • 5
    • 6
    • 7
    • 8
    • 9
    • 51
    • 52
    • 7 / 52