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

    Posts

    Recent Best Controversial
    • RE: How do i call subroutine in animation / onclick?

      Since I am not getting any replies about subroutines, I did restructure again so that I can copy DC and make a few changes to produce a component that maintains distances.

      The example would work for a garage door ( using ASIN & ACOS for angles ).

      The calculations were adapted from

      http://local.wasp.uwa.edu.au/~pbourke/geometry/sphereline/
      http://local.wasp.uwa.edu.au/~pbourke/geometry/2circle/

      There are some weird bugs in sketchup when using large numbers, in addition to the SQRT problems.

      skyfish


      trackroller II.skp

      posted in Dynamic Components
      S
      skyfish
    • RE: How do i call subroutine in animation / onclick?

      I restructured the code and changed the algorithm. Now I can create rolling elements by

      • copying typical component
      • make unique
      • renaming
      • change offset

      If you would like to see example, I have attached a file.

      skyfish

      EDIT:
      Oops, now I remember the problem with this algorithm. The
      distance between balls is a measure of the curved path. It
      doesn't maintain a rigid connection between balls. Going
      around the curve, the inter-distance is slightly small.


      trackroller.skp

      posted in Dynamic Components
      S
      skyfish
    • How do i call subroutine in animation / onclick?

      I have a component which rolls on a track. I have been using a formula for intersection of line-circle and line-line to change the component coords at each increment of the animation in Sketchup Pro 7. Works great.

      The formula's are in the enclosing component which holds the sub-components like wheels,track etc.

      With onclick I calculate the coords with every increment of the animation. Unfortunately I have separate intersection calculations for each sub-component and it is getting messy.

      I would like to implement something like Line_Line_intersect(ParmIN, ParmOUT) & Line_Circle_Intersect(ParmIN,ParmOUT) which I would call in my IF().. statement.

      I scanned ruby but it is not clear to me that this is possible. Surprised I couldn't find a clear answer to this anywhere.

      skyfish

      posted in Dynamic Components sketchup
      S
      skyfish
    • RE: Animate stalling

      Its fixed. My error. I hate when that happens. For those of you playing at home, I have attached the fixed version. On to the hairy part

      skyfish

      posted in Dynamic Components
      S
      skyfish
    • RE: Animate stalling

      @chris fullmer said:

      I think the point is that DC's are not made to do what you are trying to do. Its not their fault you're asking for too much... Its cool to push limits, but you can't complain when things won't work beyond their scope. SketchUp is not really made for animation at this point. But some of the animation plugins could help,

      Chris

      I didn't think I was pushing the envelope - just changing coordinates and using the documented intrinsic animate(). The nested IF statements aren't explicitly mentioned, but what good is a single if-then-else. Maybe you should take a look at the model. It works fine except the stalling problem. I have 9MB of work invested in this model (not the test I posted). I am not looking forward to learning Autodesk Inventor to finish this project.

      skyfish

      posted in Dynamic Components
      S
      skyfish
    • RE: Animate stalling

      I am through wasting my time on sketchup. I was hoping to avoid have to learn a less buggy program. Sketchup is too flakey.

      posted in Dynamic Components
      S
      skyfish
    • RE: Animate stalling

      @jim said:

      I'm almost convinced what you are trying to do can be done in a better way. Is it possible to give an overview of what you want to accomplish?

      The goal is very much like a garage door. Panels will move with the wheels and rotate according to position. In addition, the Rod pulling on the panels (attached to top panel) changes angle depending on how far along the close/open operation is.

      Have you tried running the animation? Except for a general lack of commands/data structures/debugging, ugly as it is, the nesting IF statements works (almost). The SU Animate plug-in looks like the sledge hammer approach.

      skyfish

      posted in Dynamic Components
      S
      skyfish
    • RE: Animate stalling

      If I make a substitution for "InHorz", the wheel falls to zero and the animation falls apart. Replace the original value, and the wheel is stuck just past the horz origin, but the rest of the animation works. Substitution works of other cases. I am attaching report.

      skyfish

      posted in Dynamic Components
      S
      skyfish
    • RE: Animate stalling

      It is kinda complicated. I didn't know how and when sketchup evaluates expressions, so I left everything inline. I will definitely group according to your suggestions. After I get this part worked out, I am going need more hairy relations that require trig functions. I am not aware of any alternative, but certainly open to suggestions.

      skyfish

      @jim said:

      Hello skyfish,

      That's awful hard to figure out, and maybe not an ideal application for DC's. To begin with, I would suggest factoring out some of the Boolean expressions into separate attributes. (I think this is what your expressions are doing in essence.)

      Maybe have some extra attributes so you can simplify the expressions that control the wheel position.

      
      > inNip; IF( wheel is in nip, true, false)
      > inHoriz; IF( wheel is in horiz , true, false)
      > inCurve; IF(wheel is on curve, true, false)
      > inVert; IF(wheel is in vert, true, false)
      > 
      

      Also I can't help but think there might be a completely different approach to the entire problem of animating a wheel in a track. As I said, I don't think a DC is the ideal solution. There are a couple of flight-path animation plugins that may make your work simpler. Are you stuck on using DC's?

      posted in Dynamic Components
      S
      skyfish
    • Animate stalling

      I am animating a wheel in a track. The first section of track is linear with a slope. The second section is vertical. The third section is curved. The fourth section is horizontal. The wheel traverses the slope,vertical,curved sections. For some reason I cannot advance the wheel in the horizontal section even if I hard code some numbers.

      Here are the Y,Z values:
      ========================================================= Z value
      =IF(test!delta<=ROUND(vert!Z),SMALLEST(test!delta,vert!Z),
      IF(test!delta<=curve!Z,test!delta,
      IF(AND(test!delta>=curve!Z,test!delta<=horz!Z),(test!radius*SIN(ASIN(OP)))+curve!Z,
      IF(test!delta>=horz!Z,horz!Z))))

      ========================================================= Y value

      =IF(test!delta<=ROUND(vert!Z),SMALLEST((test!deltatest!slope)-0.39403,vert!Y),
      IF(test!delta<=curve!Z,vert!Y,
      IF(test!delta>=curve!Z,test!radius-(test!radius
      COS(ASIN(OP)))+curve!Y,
      IF(test!delta>=horz!Z,horz!Y+test!delta-horz!Z))))

      I have attached v7 model

      skyfish


      test2.skp

      posted in Dynamic Components sketchup
      S
      skyfish
    • 1 / 1