sketchucation logo sketchucation
    • Login
    1. Home
    2. mptak
    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
    M
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 34
    • Posts 185
    • Groups 1

    Posts

    Recent Best Controversial
    • RE: Worm Gear Assembly Not Interacting

      Cool beans! I'm glad to see that others are struggling with all this and sticking with Sketchy Physics.

      I'm by far not an expert but have picked up a thing or two. Your model looks great but I fear that the base cylinder around which your screw is attached may not be being read as a cylinder. It tends to cease a bit on me and I would guess that the large wheel is correctly modeled. Once I get it spinning I'll try to do some of the movie capture I have been playing with and share it back to you. Mr. K provides a great script to enable good capture.

      posted in SketchyPhysics
      M
      mptak
    • RE: Worm Gear Assembly Not Interacting

      Nice design. I think the screw needs to be assembled by a bunch of small incremental inits made up of convexhulls and then bound to the base crank cylinder.

      posted in SketchyPhysics
      M
      mptak
    • Sketchy physics replay - Mac

      I'm trying to take advantage of one of the great assets of the mac version of sketch up and sketchy physics, the transparent background. Any suggestion on how to capture frames in sketchy physics so that the background is transparent. For now I am just exporting an image per frame so that I can control the resolution and frame size but I would guess there is a better way and a better tinkerer out there who can tell me. This code was nicked from Mr. K and works to interpolate camera positions between scenes while saving an image every frame. Put the code in the on tick box of any sketchy physics solid.

      if frame==0
        @transition_time=100
        @pages=Sketchup.active_model.pages
        @cam=Sketchup.active_model.active_view.camera
        @view=Sketchup.active_model.active_view
        @page_num=@pages.count-1
        @cur_page=0
        @next_page=1
      end
      
      if frame>0
        per=frame%@transition_time
        if per==0
          @cur_page+=1
          @next_page+=1
          @cur_page=0 if(@cur_page>@page_num)
          @next_page=0 if(@next_page>@page_num)
        end
        per=per.to_f/@transition_time
        page_cam1=@pages[@cur_page].camera
        page_cam2=@pages[@next_page].camera
        fov,eye,target,up=interpolate_camera(page_cam1,page_cam2,per)
        @cam.fov=fov
        @cam.set(eye,target,up)
        @newview=@view.refresh
        framet=frame.to_s
        while framet.length< 4
          framet="0"+framet
        end
        @name="/Users/markptak/Desktop/tempimage/write_image."+framet+".png"
        keys={
            ;filename => @name,
            ;width => 1924,
            ;height => 1080,
            ;antialias => false,
            ;compression => 0.9,
            ;transparent => true
            }
        @newview.write_image keys
      end
      
      if frame==0
       def interpolate_camera(cam1,cam2,per2)
         per1=1-per2
         fov1=cam1.fov
         fov2=cam2.fov
         fov=fov1*per1+fov2*per2
         eye=[]
         eye1=cam1.eye.to_a
         eye2=cam2.eye.to_a
         (0..2).each{|index| eye[index]=eye1[index]*per1+eye2[index]*per2}
         tar=[]
         tar1=cam1.target.to_a
         tar2=cam2.target.to_a
         (0..2).each{|index| tar[index]=tar1[index]*per1+tar2[index]*per2}
         up=[]
         up1=cam1.up.to_a
         up2=cam2.up.to_a
         (0..2).each{|index| up[index]=up1[index]*per1+up2[index]*per2}
         return fov,eye,tar,up
        end
      end
      
      
      posted in SketchyPhysics
      M
      mptak
    • RE: Record camera positions

      There are any number of ways to do this but the most simple is to name two objects trackme and followme and then hide them during the animation if you don't want them to be seen. Then in the scene description type:
      camera track trackme. camera follow followme.

      This should work. I think this is described elsewhere in this forum and I will try and find those posts but here is a model I put up on Trimble warehouse. One can then just control the location of the camera and target by controlling the location of the two objects. I assume that the "up" position of the camera will remain [0,0,1] but that too could be changed with the script. In this case I use the teleport function on the camera follow object.

      http://sketchup.google.com/3dwarehouse/details?mid=78bf2f5339e5b412706627b112998eff

      posted in SketchyPhysics
      M
      mptak
    • RE: [Info] WebDialogs - The Lost Manual on GitHub

      I think this will inspire me to finally make the leap fully into github! Thank you ThomThom.

      posted in Developers' Forum
      M
      mptak
    • RE: Time for a change for me...

      Congrats. Looking forward to great things. Drones for everyone!

      posted in Corner Bar
      M
      mptak
    • RE: Copying Scripts

      I believe that the scripts that are embedded in objects in sketchy physics travel with them (they must be attributes) when you copy items but they often go awry because of the naming conventions. I actually have started to put my regular webconsole scripts into an object using sketchy physics as it seems a pretty good way to keep scripts within the file. I just leave a note to copy the script back out of the object and into the webconsole (or what has become the developer console).

      posted in SketchyPhysics
      M
      mptak
    • RE: Controle Servos External

      I must say that simfonia was pretty impressive at BaseCamp 2012. I think I'll have to dive back into that first chance I get.

      posted in SketchyPhysics
      M
      mptak
    • RE: Controle Servos External

      Try again. Worked for me this morning. Perhaps the server was down.

      In general I find Mr. Rinehart's Edges to Rubies one of the goto books even if it doesn't specifically target Sketchy Physics.

      posted in SketchyPhysics
      M
      mptak
    • RE: Controle Servos External

      Link Preview Image
      Sharing data between SketchUp Ruby and Javascript

      Posted by Scott Lininger, SketchUp Software Engineer If you are building rich WebDialogs in your SketchUp Plugin, then you are probably usin...

      favicon

      (sketchupapi.blogspot.com)

      http://www.martinrinehart.com/models/rubies/ruby2javascript_javascript2ruby.html

      This post by the illustrious Martin Rinehart as well as Scott L. gets you most of the way and then the code looks something like this

      In the servo value field place this getVar("@@servovalue") #yes you need the quotes

      #Try and avoid global variables and somehow using the getVar and setVar functions makes things crash a little less.

      In the callback function set an instance variable like @@servovalue1 = callbackarray[1] #the callback returns a string
      #so you need to deal with
      #the sub values

      In reality this can all be done without using the ontick function with the variable value update period being controlled by the setTimer function in the javascript. This give a bit of a choppy simulation as it pauses to get the values from the sql database but if you capture the animation frames you should be able to take the choppiness out.

      I'll clean up what I have built on some suggestions and insights from folk like Mr. K and try to post something less cryptic.

      http://sketchucation.com/forums/viewtopic.php?f=61&t=38368 is a link back to some work just pulling from a file.

      Ciao.

      posted in SketchyPhysics
      M
      mptak
    • RE: Controle Servos External

      I'll try and follow-up with a better post but if look at webdialogs and getting ruby to talk to javasript which can make ajax calls you might find your answer. I am doing the same to animate data from an SQL database into a regular sketchup animation so servos should be no different. This may become easier if Sketchup incorporates the a more fully functional Ruby as has been hinted at. Websockets would make this much easier.

      posted in SketchyPhysics
      M
      mptak
    • RE: Trouble with SketchyPhysics 3.2 (installs as 3.1)

      I believe that Chris Phillips is working on a new maintenance release. While it presently has its issues it still is too cool for school even as is.

      posted in SketchyPhysics
      M
      mptak
    • RE: SketchUp-Ruby Resources

      http://rubyjs.org/

      Javascript implementation of Ruby. For what its worth.

      posted in Developers' Forum
      M
      mptak
    • RE: Popcorn Maker for web video integration

      http://highrise.nfb.ca/onemillionthtower/1mt_main_story_anim.php

      Not sure if they used sketchup but if not they could have....

      posted in Hardware
      M
      mptak
    • RE: My Blender journey

      http://ocw.tufts.edu/Course/57

      I remembered this open course from Tufts. I wonder if there is a more current one or how well it travels to the current version.

      posted in Freeware
      M
      mptak
    • Popcorn Maker for web video integration

      I'm not sure if this is the place to post this but for those trying to add a little extra to their web or teaching tutorials this looks impressive. The Ted talks on which Popcorn Maker is demoed are cool in and of themselves.

      favicon

      (blog.ted.com)

      posted in Hardware
      M
      mptak
    • RE: Problem with group.copy

      Enjoyed the thread and look forward to the maintenance revision of Sketchy Physics as I presume it was some of its redefinition/augmentation of classes which led to this snafu. I think removing SP should be part of any troubleshooting until it is made a bit tighter. Great program though.

      posted in Developers' Forum
      M
      mptak
    • RE: Mantinence release coming soon.

      Look forward to any and all updates. I have avoided updating to the latest su release partly cause I can't bear to part with the Sketchy Physics Piano but would love to take the plunge so I could dive more into Layout.

      posted in SketchyPhysics
      M
      mptak
    • RE: New Member - Skatepark Designer

      Wonder if anyone has played around using Sketchy Physics on those awesome skateparks. I hear a maintenance release is due soon and once it gets released I'm dying to give it a try. Simfonia is also worth a look after their excellent presentation at SU Basecamp 2012.

      posted in Newbie Forum
      M
      mptak
    • RE: New user in need of some advice designing freestyle ski park

      Depending on the location of the resort you might have access to better topographic information than is available in Google Earth (though some of that can be really spot on I think). County GIS's or even the developer may have more dense terrain information and if accuracy and dimension is important it might be worth the extra legwork on the front end. Once you get the info there are a variety of plugins or scripts to get the information into sketchup. Though sometimes problematic Sketchy Physics is also worth a look as you proceed.

      I would guess that you may also want to cut cross-sections of the run, this can be done by using the section tool and creating a slice from each cross-section. Hope this helps a bit.

      posted in Newbie Forum
      M
      mptak
    • 1 / 1