sketchucation logo sketchucation
    • Login
    1. Home
    2. chrisglasier
    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 103
    • Posts 1,031
    • Groups 2

    Posts

    Recent Best Controversial
    • RE: [Logic emerged] Articulation in animation

      @dan rathbun said:

      EDIT: Ok, I know you are already iterating the train...

      .. I mean specifically that you must pass the preceeding car's position, to the next car.

      I don't think the relationship is between wagons but between wagon and path.

      @dan rathbun said:

      If you wish to get more "real", each car actually has two pivot points, under the front and rear carriage assembly.

      The wagons are fixed axle coal wagons 6 x 2.5m on plan; the curves are 60m radius. One purpose of the animation is analytical so the calcs have to be real even though the display maybe a bit squiffy due to the radical scaling.

      posted in Developers' Forum
      chrisglasierC
      chrisglasier
    • RE: [Logic emerged] Articulation in animation

      @dan rathbun said:

      Don't know the exact logic, but each wagon needs to follow the car in front of it (be it loco or wagon.)

      How about logically, moving the loco, then iterating the train's members ??

      The straight runs do this - rather in each frame each wagon's x value is properly spaced behind the loco; the Y value is the same. The way I have it when the Y-value needs to be offset to take up the curve it gets applied to all. Here is where I get stuck;

      Each wagon needs its own animation to follow the same path, the stagger being set by its starting position,

      or

      Somehow each wagon needs to know when to apply the Y offset (and rotation)

      posted in Developers' Forum
      chrisglasierC
      chrisglasier
    • [Logic emerged] Articulation in animation

      I am trying to figure out how to sequence the train animation so I can offset and rotate each wagon in turn around curves. I am developing it using KineticJS in 2d with the intention of using the same data and functionality via an .rb bridge to make a more dramatic display in Sketchup.

      trainset.png

      If you have Chrome or another fully HTML5 compatible browser you can see on Route_51 all the wagons follow the black loco at the same time. I just cannot figure out yet how to create the stagger. Here is a zoom screenshot to show the situation:

      non articulated.png

      Here is my code for running the straight sections:

      
      function animate(nr,path,incr,train,dirX,dirY){
        var steps,offsetX,offsetY,count,a;
        steps = Math.round(path[nr][2] / incr);
        offsetX = path[nr][2]/steps;
        offsetY = path[nr][3]/steps;
        count = 0;
        stage.onFrame(function(frame){
          layer = train[0].getLayer();
          if(count < steps){
              for(a=0; a<train.length; a+=1){ 
                  incrX = train[a].getX() + offsetX * -dirX;
                  incrY = train[a].getY() - offsetY * -dirY;
                  train[a].setX(incrX);
                  train[a].setY(incrY);
              }
              layer.draw();
              count += 1;
          }
          else{
              stage.stop();
              nr += 1;
              if(path[nr]){
                  animate(nr,path,incr,train,dirX,dirY);
              }
          }
        });
        stage.start();
      }
      
      

      I don't seem to be able to grasp the logic (getting too old).

      Any help appreciated. Thanks.

      posted in Developers' Forum
      chrisglasierC
      chrisglasier
    • RE: Trimble is having SketchUp pay its way!

      @unknownuser said:

      @jgb said:

      The "paperless office" has about as much chance of success as the paperless toilet! 🀣 🀣

      This is why most offices cannot do it. They think like this. You just have to change your attitude and approach. You're probably still writing checks 🀣

      ...

      I just wonder how long it will be before the last part reads: "You're probably still drafting drawings".

      Thanks for the info about the site office btw.

      posted in SketchUp Discussions
      chrisglasierC
      chrisglasier
    • RE: Trimble is having SketchUp pay its way!

      @unknownuser said:

      I'm doing quite well at it right now - not a single roll of drawings in my office.

      But are there still huge piles of drawings in your projects' site offices?

      posted in SketchUp Discussions
      chrisglasierC
      chrisglasier
    • RE: Re: Some Funny Pics.

      builderbum.jpg

      posted in Corner Bar
      chrisglasierC
      chrisglasier
    • RE: Trimble is having SketchUp pay its way!

      @mike lucey said:

      ...... good point. I write very few cheques these days ALSO very few letters, its nearly all email. So I think the paperless office is somewhat well over 50% here already!

      Maybe not off topic after all.

      I don't think you can claim "paperless" while paperwork processes persist. For example I remember seeing cheques being sorted by hand in long file boxes before being bundled and sent off to the clearing house. Later, cheques were coded so that the sorting was automated to a degree but the basic process was unchanged until real computerisation took over.

      I think we are at the same basic stage with construction project documentation and it won't change until in simple terms every little thing becomes clickable. We may well be able to produce the finest drawings but really we need to be assembling pertinent self-organising networks.*

      A good Sunday topic you may think needs its own space.

      *After Toffler's well-worn: "Static competition may well produce the thoroughbred racehorse but would never produce the automobile."

      posted in SketchUp Discussions
      chrisglasierC
      chrisglasier
    • RE: Trimble is having SketchUp pay its way!

      [off:2a15cxe0][/off:2a15cxe0]
      @jgb said:

      @unknownuser said:

      Agreed. I am in the process of going almost completely paperless.

      The "paperless office" has about as much chance of success as the paperless toilet! 🀣 🀣

      Think about getting cash without writing a cash cheque and stop being such a Luddite.

      posted in SketchUp Discussions
      chrisglasierC
      chrisglasier
    • RE: [Webdialog] Javascript lerts with object bypass

      @dan rathbun said:

      This applies to WebDialogs ??

      Why is the example a Chrome window ?

      Only because I am currently using common (json) data with Kineticjs to display 2D shapes on html5 canvas. Later I intend the same data to be displayed as components in a Sketchup file (as I have demonstrated before). Same URL sits in a web dialog so the lert window will open with IE.

      Bit like going sideways to go forward, but 2D is easier on my limited coding ability to revamp old ideas.

      Did not mean to offend!

      posted in Developers' Forum
      chrisglasierC
      chrisglasier
    • RE: In the begining of a Custom Computer Desk

      Click this: http://forums.sketchucation.com/viewtopic.php?t=24390#p208807

      posted in Newbie Forum
      chrisglasierC
      chrisglasier
    • RE: [Webdialog] Javascript lerts with object bypass

      I wanted to review objects that collects data from different activities/sources. If some are objects an error is called on the whole call. This bypasses the objects. I post this in case anyone has a similar need.

      
      <script>
      		var wlert;
      		
      		function lert(v,json){
          		var html,arr;
          		if(!wlert || wlert.closed){
         				wlert = window.open("","_blank","width=300,height=400,resizable=yes,scrollbars=yes");
         			 }
         			html = "<pre>";
         			if(json){
         				arr = [];
         				for(n in v){
         					arr.push(n + "; " + v[n]);
        				}
         				html += arr.join("<br>");
         			}
          		else{
         				html += v;
             		}
          		html += "</pre>";
          		wlert.document.write(html);
      		}
      		
      		function lertClose(){
          		if(wlert && !wlert.closed){
             		 	wlert.close();
         			}
      	}
      	
      	//call ; lert(variable,[optional]);
      	</script>
      

      lert2.png

      posted in Developers' Forum
      chrisglasierC
      chrisglasier
    • RE: Draw calls - ????

      There is always Google of course. I wanted to know as well.

      posted in SketchUp Discussions
      chrisglasierC
      chrisglasier
    • RE: [Webdialog] Javascript lerts with object bypass

      Also found it better to close lert window with reload.

      
      <body onBeforeUnload = "lertClose()">
      <script>
      function lertClose(){
          if(wlert && !wlert.closed){
              wlert.close();
          }
      }
      </script>
      
      
      posted in Developers' Forum
      chrisglasierC
      chrisglasier
    • [Webdialog] Javascript lerts with object bypass

      Here is an alternative to using alert() I call lert:

      
      <script>
      var wlert;
      function lert(v){
          var html;
          if(!wlert || wlert.closed){
      	wlert = window.open("","_blank","width=300,height=400,resizable=yes,scrollbars=yes");
          }
          html = "<pre>";
          html += v;
          html += "</pre>";
          wlert.document.write(html);
      }
      
      //sample call = lert(JSON.stringify(nset[lab],null,'\t'))
      </script>
      
      

      lert.png
      Keeps format - useful for examining JSON strings as above
      While open collects results of any "lerts" in code.
      Close clears lerts
      Use deskpins to keep on top
      Scrollable/resizable/reconfigurable

      posted in Developers' Forum
      chrisglasierC
      chrisglasier
    • RE: How to draw Air

      You may like to have a go with HTML5 canvas. I have been using the KineticJS library which makes things much easier. You could create the smoke effects using the shapes, shaders and filters there and make a png image overlay with its dataToUrl method. You can do it manually or use JavaScript to set up criteria to generate it (if varying conditions were important).

      posted in Newbie Forum
      chrisglasierC
      chrisglasier
    • RE: Multiplatform editor Sublime Text 2

      @unknownuser said:

      every programmer with his 'own' taste πŸŽ‰

      BracketHighlighter plugin:

      https://github.com/facelessuser/BracketHighlighter/raw/master/example.png

      That reminds me of the blobby Apricot LCD screen I struggled with in the late eighties (except that was a calmer green and black). But if you are looking for some more objective comment, I have been using NP++ and Sublime almost alternately for the last week or so.

      The Sublime lefthand file navigation sidebar is far better than the chaotic NP++ recent file list in its dropdown menus.

      Sublime's optional map scroller is good because you can do more informed stab as well as scroll navigation.

      If a file is updated outside the editor, Sublime updates its file whereas NP++ asks whether it should do so. I prefer the latter in case I change my mind and use saveAs to restore.

      I am using Sublime's Mac Classic which suits me.

      Mac Classic on Windows!

      posted in Developers' Forum
      chrisglasierC
      chrisglasier
    • RE: Layers list

      Well you could learn Ruby and make yourself a plugin.

      Or you could dream up a compromise like giving blocks of similar items the same number prefix - 5 window_80x80, 5 window_120x140, 6 door_outside door_90x210, 6 door_room door_90x120.

      In other words you could get a better solution for you than exists by changing the technology or changing the information, or both. In the end it will be down to you, so think deeply about it.

      posted in Newbie Forum
      chrisglasierC
      chrisglasier
    • RE: Layers list

      @giorgio78 said:

      I wonder if there's any way to sort the layers by the serial number that would indicate when the parts of that layer are instaled. The problem is that layers can be now sorted only by name, colors and visibility. My wish is to have a column in the layer drop list where I would determine serial numbers (1, 2, 3, 4, 5, ....) that would alloud me to sort layer by sequence of integration.

      Thanks for the answers

      How about naming them sequentially - 01 Ground floor ... 12 Hardware as a workaround

      posted in Newbie Forum
      chrisglasierC
      chrisglasier
    • RE: [Code] WebDialog communication

      May I put up another part of my modus operandi (extra Roman flavour) which seems to be parallel to yours.

      Here is a copy of the parts I noted before:

      @unknownuser said:

      **> 1 - one to hold all the records (eg all properties and attributes of entities, layers and scenes and special collections),
      2 - one that holds the main display configuration plus built-in menus and device keys and value options,
      3 - one as 2 above but specifically for the only connected device.
      **

      A configurable display and supporting operating functions (prefixed core or mac) live on a web site. These belong to the website owner (a consortium or individual). These functions facilitate the assembly, uploading and downloading of plain text files of the json objects noted with links to external js files for optional devices. In the case of Sketchup the website sits in the webdialog and calls Ruby commands from there.

      The text files belong to whoever made them. The device files belong to whoever made them. The power source belongs to the website owner.

      posted in Developers' Forum
      chrisglasierC
      chrisglasier
    • RE: [Code] WebDialog communication

      @dan rathbun said:

      OK.. well that is all fine and dandy.

      ...

      So I guess my question to you is, are you loading your devices / functions into the global Js namespace, or do you use a Glasier namespace ??

      All variables are parts of three global json objects:

      1 - one to hold all the records (eg all properties and attributes of entities, layers and scenes and special collections),

      2 - one that holds the main display configuration plus built-in menus and device keys and value options,

      3 - one as 2 above but specifically for the only connected device.

      Apart from these only functions are global variables. Device functions can be called anything provided they are not prefixed core or mac (dedicated to 1 and 2). Any conflicts with previously loaded devices are resolved by having the active device functions loaded last.

      In these circumstances is there any point in having a dedicated namespace?

      @aerilius said:

      Since the code of all <script> elements goes into memory when the script tag is loaded, it shouldn't matter if we just delete all script tags.

      Precisely ... in a way I was responsible for muddying the waters with script id's - sorry.

      posted in Developers' Forum
      chrisglasierC
      chrisglasier
    • 1 / 1