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

    Topics

    • G

      Inputbox too narrow

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      12
      0 Votes
      12 Posts
      469 Views
      G
      I've now made a simple video of the door maker. http://www.youtube.com/watch?v=vBeug0CTA7k
    • G

      Web dialog fractions conversion

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      8
      0 Votes
      8 Posts
      362 Views
      Dan RathbunD
      @garry k said: This is NOT as expected - regardless. I know myself that I work mostly in millimeters but feel quite at home going back and forth. All the other built in conversions work just fine. Just not this one. Yes I think it IS a bug. Today I tested with a model set to decimal feet (0.001) and got this: ` '2 1/2"'.to_l 30.0 Sketchup::format_length('2 1/2"'.to_l) 2.500'` So the inch symbol is ignored. But in a model set to inches: "2.54'".to_l %(#008000)[30.48] So it seems the foot symbol works, IF the numeric is decimal. But IF it is fractional (model set to inches): "2 1/2'".to_l %(#008000)[24.0] **So I agree. It is a bug issue with fractional expressions. ADD: The error also occurs within the VCB (Measurements Box) !**
    • G

      Get MAC Address

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      55
      0 Votes
      55 Posts
      5k Views
      G
      I've run into issues with taking the fist or second Mac Address out of ifconfig or ipconfig /all. I've changed the code to look at the entire file and then to step through it line by line and treat it as a bit of a state machine. Thanks to pgarmyn and Driven I think I've got some code that will work. They both helped with files as have a handful of other people. With windows I've tested files in English, French, Russian and some with VMWare set up. With OSX I've just tested in English. Mac Address
    • G

      Communication best practice

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      9
      0 Votes
      9 Posts
      298 Views
      tt_suT
      Yes, you must make the server dish out JSONP to comply with same-origin policy.
    • G

      Find plane at intersection of 2 vectors

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      13
      0 Votes
      13 Posts
      584 Views
      G
      I know exactly what you mean - I've built a lot of curved staircases. The challenge when it comes to modelling is to try an approximate the handrail profile and to manage ( or control ) the distortion. You feather the distortion over a distance so as to minimize it visually.
    • G

      Transforming an array of points

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      27
      0 Votes
      27 Posts
      567 Views
      jolranJ
      Yet Another test Don't know how reliable this test is but it appears face get appended in the same order as indexed in Polygonmesh. But Polygonmesh Count indexes starting at 1. Edit: Updated for adding c_point in polygonmesh index as well. But wonder how hidden edges affect the Index ordering.. The API says: @unknownuser said: The negative values should not be used as an index for point_at, take the positive value of the index value in the polygon array Perhaps hidden edges will only happend if mesh is constructed from a collection of Sketchup::Face's. Not relevant in this case. In that case maybe use index.abs or perhaps double negation: index = index<0 ? -index : index ents = Sketchup.active_model.active_entities def centerpoints(f) cx = (f[0].x + f[1].x + f[2].x + f[3].x)/4 cy = (f[0].y + f[1].y + f[2].y + f[3].y)/4 cz = (f[0].z + f[1].z + f[2].z + f[3].z)/4 return Geom;;Point3d.new(cx, cy, cz) end face1 = [ Geom;;Point3d.new(-5,-5,0), Geom;;Point3d.new(5,-5,0), Geom;;Point3d.new(5,5,0), Geom;;Point3d.new(-5,5,0) ] #create points for 4 faces faceHash = {} for i in (0...4) faceHash[i] = face1 face1 = face1.collect{|pt| pt.offset([20,0,0])} end #get refference to the center of "face"#3 Before appending to mesh. fC = centerpoints(faceHash[2]) ents.add_cpoint(fC) # Bit strange to loop hash this way, but they get ordered. msh = Geom;;PolygonMesh.new for n in (0...faceHash.length) msh.add_polygon(faceHash[n]) end #Test PolygonMesh index. How does hidden edges affect indexes for this ? # +1 index for polygons in Mesh. 2 c_points should get added at same spot meshface3 = msh.polygon_points_at(2+1) mc = centerpoints(meshface3) ents.add_cpoint(mc) group = ents.add_group group.entities.add_faces_from_mesh(msh) faces = group.entities.grep(Sketchup;;Face) #Red material to face 3 faces[2].material = "red"
    • G

      Co planar test

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      27
      0 Votes
      27 Posts
      661 Views
      tt_suT
      With an Point3D version of the Oct tree I don't think the point comparison will be an issue any more. From the tests with vertices it scaled very well. Though I have some more ideas for the PolygonMesh class.
    • G

      Combining Edges

      Watching Ignoring Scheduled Pinned Locked Moved Plugins
      5
      0 Votes
      5 Posts
      393 Views
      G
      The next thing I need to do is take a handrail profile such as the image on the left which is a cross section of a handrail for level handrail. Then I want to create a sorted array of the edges used to describe the level handrail profile. - I'm thinking the outer_loop should work. Then I stretch the profile based on the slope of the handrail - just store the vertices in an array. After that I rotate the vertices the appropriate amount for the next section of handrail. Create edges that go from the first adjusted profile to the next section of profile. The catch is that these handrails may not have a consistent slope. There may be a small section of handrail that transitions from one slope to another. For instance there could be a tight radius for the inside stringer that has a steep slope and then over a couple of feet at the top of the stair the handrail levels out for level balcony handrail. This means that I have to adjust the profile for the handrail for each small section. I'm thinking of using the top center of the handrail for registration purposes. This makes sense to me as building codes talk about the height of the handrail for level rail and for stair rail. Residential codes are usually 36" for level handrail and 32" for stair rail - measured vertically up from the edge of the tread nosing. Commercial codes are usually 42" and 36" respectively. The top center is consistent regardless of the height of the rail profile. [image: 9oLz_railprofile.JPG]
    • G

      Creating revenue from plugins

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      9
      0 Votes
      9 Posts
      674 Views
      renderizaR
      Hi, With the introduction of 'PluginStore' and 'Extension Warehouse' it has become more accessible for developers to share plugins and maybe in the near future these platforms will allow authors to sell them as well. (fingers crossed) As of right now donations are a welcome addition to 'PluginStore' and even though there are people who have generously donated, this kind of appreciation is considered a rare event. Most of them will thank you by leaving a nice comment and this can be very rewarding as well. Selling plugins will hopefully inspire developer to increase the production value of their plugins so they can have an edge vs competitors. Not only the code should improve but also the interface, graphics, documentation, ect... On the other hand I am afraid to see the dark side of competition which I am sure you guys can think of a few. Cheers!
    • G

      Add_face gives error duplicate point in array

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      16
      0 Votes
      16 Posts
      2k Views
      G
      In this example I increased the width of the stringer which results in a small triangle that you can see. Width is 304 mm. Where the sketchup error occurs the stringer width was 300 mm and the small triangle would not be visible at this zoom. What I have done for now, which works in these type of situations, is simply use a rescue block. I would normally consider this bad form as it can hide errors. This code only works on the last section when the stair has a heel and when we should have a triangle. The sketchup error was misleading and cost me a bit of time trying to track this down. begin # try to add the face ent.add_face( pts ) rescue puts( pts ) if ( debug_level > 0 ) end Any thoughts on this? [image: EYAC_collinearissue.JPG]
    • G

      Rotate and Intersect a plane

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      7
      0 Votes
      7 Posts
      470 Views
      TIGT
      Please stop calling them 'lines' - I know that's the CAD name but in SketchUp Ruby code they are best called 'edges' - I know some SketchUp tools refer to drawing 'lines' and there's even an API method add_line() that adds an edge BUT when we are talking code - especially if we are taking about edge.line - it's a recipe for confusion to muddle up the two terms... I tried to explain the difference between an edge and a line [edge.line]... The two perpendicular edges you drew will only return a point with the intersect_line_line() IF they intersect - i.e. they are 'coplanar'... looking down 'in plan' does not mean they do intersect if their 'z' values not equal... Assuming they do return a point, then my previous post explains how you can then tell if that point falls 'in space', or either of the edges' vertices, or on an edge in between its start/end... It'd be quite possible to slide your example edges around so that they then return a point 'in space' that is on neither edge...
    • G

      Curved Staircases

      Watching Ignoring Scheduled Pinned Locked Moved Woodworking
      171
      0 Votes
      171 Posts
      33k Views
      P
      NICE.. thanks a lot!
    • G

      Tool usability

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      16
      0 Votes
      16 Posts
      749 Views
      G
      Here is a video on making a bifold door http://www.youtube.com/watch?v=oJkfzj9epI4
    • 1
    • 2
    • 2 / 2