sketchucation logo sketchucation
    • Login
    1. Home
    2. Anton_S
    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!
    ๐Ÿ”Œ Smart Spline | Fluid way to handle splines for furniture design and complex structures. Download
    A
    Offline
    • Profile
    • Following 0
    • Followers 7
    • Topics 52
    • Posts 1,261
    • Groups 2

    Posts

    Recent Best Controversial
    • RE: MSPhysics 1.0.3 (16 October 2017)

      Hello TDahl,

      First of all, very professional work here, in a sence of understanding how to use the plugin despite the lack of documentation on it. Great job!

      I'm not sure what is causing the crash. I think that the physics engine has a limit on how much joints it can control at once. I will look into this bugsplat issue when I find the time.

      Meanwhile, there are a couple of things you can do to improve behavior of cable and performance:

      1. Because you are relying on a small timestep (1/300), reducing solver model, to 4 iterations for example, would improve the performance by a good factor. Solver model basically controls the stability of joints. If your timestep is small, reducing solver model would alter the stability joints by an unnoticeable factor.
      2. Specificating the collision shape of "FCC Segment Instance" to Box should improve the performance as well. I assume you already did that for your the edited model, but in case you haven't, here is an easy way to do it for all of them: Because all your cable segments have the same name, you can assign a box shape to one of the segments and use the Assign Props to All with Name button, within the MSPhysics UI, to assign alike properties to all instances with the same name.
      3. Because all joints are flexible, you can simply rely on a Fixed joint, rather than Hinge. This would make the entire cable more stiff and of course improve performance.
        I eddied your model, containing all the addressed suggestions and attached it below.

      Also, if you change a joint within one of the wire segments, which also adds it to all other component instances, you can re-interconnect the segments with their joint by pasting this command into Ruby Console:

      id = 646194 # Change this to desired joint ID.
      instance_name = 'FCC Segment Instance' # Change this to instance name
      ids = [id]
      Sketchup.active_model.start_operation('OP', true, false, false)
      Sketchup.active_model.entities.each { |e|
        if (e.is_a?(;;Sketchup;;ComponentInstance) || e.is_a?(Sketchup;;Group)) && e.name == instance_name
          e.set_attribute('MSPhysics Body', 'Connected Joints', ids)
        end
      }
      Sketchup.active_model.commit_operation
      

      That's the code I used to interconnect the Fixed joints with their segments.

      Once again, great work, TDahl!

      Best regards,
      Anton


      Viking Lander for SSAA FCC Animation Bare.skp

      posted in Plugins
      A
      Anton_S
    • RE: Start and commit operation: how they work?

      I think I figured it out. Enabling transparent mode for an operation will simply merge it with a previous non-transparent one, regardless if the previous operation is active or not. So, even this should work:

      model = Sketchup.active_model
      model.start_operation('Main OP', false, false, false) # A placeholder for all sub operations
      model.commit_operation
      x = 0
      while (x < 100)
        model.start_operation('Sub OP', true, false, true)
        # Do some crazy geometry manipulation,
        # that I don't want the observer to respond while I'm doing it...
        model.commit_operation
        # Committing operation will allow the observers to respond and update view properly.
        # Do something involving view, like exporting proper view into images
        # Increment counter
        x += 1
      end
      

      Edit: Nevermind. transparent flag is limmited to 100 operations. After that it turns into a normal operation, flooding the undo stack. Running one operation with ui_disable set to false does update the view properly, so I'll stick with it, but it's slow...

      posted in Developers' Forum
      A
      Anton_S
    • RE: Start and commit operation: how they work?

      Hello,

      I'm returning to this old topic because of a nested operations question.

      I need a way to do crazy geometry manipulation, multiple times and display results in the process, but without updating the undo stack. If I have one operation, with disable_ui parameter set to false, the operation will be slow. If I have one operation with disable_ui parameter set to true, the operation will be fast but the resulting view will be ugly; that is, the view won't display well until operation is committed. What I need is a way to do multiple fast operations but without flooding the undo stack.

      The fourth parameter of start_operation allows making transparent operations, which is what I need. The code below is what I think is its implementation should be. Although, I have second thoughts; I'm not sure if this is the correct implementation. Docs say that starting a new operation will implicitly end the previous operation. So, should I even bother calling the commit_operation the second time, after the while loop? Does anybody know if this is the right implementation? The docs don't explain this in detail unfortunately.

      model = Sketchup.active_model
      model.start_operation('Main OP', false, false, false)
      x = 0
      while (x < 100)
        model.start_operation('Sub OP', true, false, true)
        # Do some crazy geometry manipulation,
        # that I don't want the observer to respond while I'm doing it...
        model.commit_operation
        # Committing operation will allow the observers to respond and update view properly,
        # but I'm not sure whether it commits the main operation as well...
        # Do something involving view, like exporting proper view into images
        # Increment counter
        x += 1
      end
      model.commit_operation
      

      Also, ignore that I didn't add all the begin/rescue/ensure blocks... They would make this code a lot more complicated to understand.

      Thanks,
      Anton

      posted in Developers' Forum
      A
      Anton_S
    • RE: [Plugin] Souvenir - v2.2b - 07 Apr 24

      Fredo,

      Thank you very much for developing this licencing system! It would be essential for many plugin developers in the future, including me.

      Regards,
      Anton

      posted in Plugins
      A
      Anton_S
    • RE: MSPhysics 1.0.3 (16 October 2017)

      @robibue said:

      My problem is, the system starts to wobble after 10 seconds ๐Ÿ˜ž , and after 30 seconds it spins out of control ๐Ÿ˜ฎ .

      what am I doing wrong?

      If you set simulation solver model to iterative 64 passes and update timestep to 1/120, the wobbling should be significantly reduced.

      @robibue said:

      edit: I wanted to attach a spring (instead of using the angular spring hinge) but I believe that springs are fixed and non-movable) and somehow I can't implement this idea.

      Don't do that. Spring joints are for linear motion, not for angular. Either use angular spring, or since you want to dampen the whole thing, simply change hinge mode to Angular Friction and increase the friction parameter, to say, 4000000.

      posted in Plugins
      A
      Anton_S
    • RE: Creating a plaid on a chair - cloth simulator?

      Almost finished. You can expect it sometime in the beginning of October.

      posted in SketchUp Discussions
      A
      Anton_S
    • RE: MSPhysics 1.0.3 (16 October 2017)

      Faust, replay doesn't record transformation of vertices. There is nothing you can do with it yet, but is a good request.

      posted in Plugins
      A
      Anton_S
    • RE: MSPhysics 1.0.3 (16 October 2017)

      Making relative joints is easy if you know the concept. Here is how it's done: https://drive.google.com/open?id=0B3qg8f4WrNdHUDJrTUsybmU0NGs

      posted in Plugins
      A
      Anton_S
    • RE: MSPhysics 1.0.3 (16 October 2017)

      @jb1016 said:

      Is there a way to utilize multi core processors with msphysics?

      Probably not. When I compiled Newton, I disabled multi-threading, due to issues encountered with it. I will try to enable multi-threading in the next release.

      posted in Plugins
      A
      Anton_S
    • RE: Can I Use MSPhysics for This: One-handed Brake Lever Design?

      In addition to what Rich said, create a copy of your model file prior to extruding it and adding MSPhysics joints. That way your original model will be there whenever you need it.

      posted in SketchyPhysics
      A
      Anton_S
    • RE: MSPhysics tests and questions

      You can rely on MSPhysics::Body.#contacts function. Add this code to an iceberg to see the effect:

      onTick {
        if this.get_velocity.length > 1.0 && frame % 10 == 0
          this.contacts(true).each { |contact|
            body = simulation.emit_body(@@splash4, contact.point, @@dir, 0.4)
            body.collidable = false
          }
        end
      }
      
      posted in Plugins
      A
      Anton_S
    • RE: MSPhysics tests and questions

      Hmm... I think something is wrong in code or with MSPhysics. Try changing the rain dproplet's code to this:

      onStart {
        @instances = {}
      }
      
      onTick {
        dir = this.group.transformation.zaxis
        dir.length = this.mass
        point = this.get_position + Geom;;Vector3d.new((rand()-0.5)*1000, (rand()-0.5)*1000, (rand()-0.5)*10)
        tra = Geom;;Transformation.new(point)
        rain = simulation.emit_body(this, tra, dir, 5)
        rain.collidable = false
        @instances[rain] = true
        @instances.reject! { |k,v|
          next true unless k.valid?
          point = k.get_position(0)
          if point.z < 0
            #k.destroy(true)
            posineu = Geom;;Point3d.new(point.x, point.y, 5)
            tra = Geom;;Transformation.new(posineu)
            body = simulation.emit_body(@@splash2, tra, @@dir, 0.25)
            body.collidable = false
            if frame % 3 == 0
              posineu = Geom;;Point3d.new(point.x, point.y, -2)
              tra = Geom;;Transformation.new(posineu)
              body = simulation.emit_body(@@bubble2, tra, @@dir, 0.2)
              body.collidable = false
            end
            next true
          end
          false
        }
      }
      

      Aside from that, you can use onTouching event for repetitive action, but it only yields toucher parameter and doesn't provide touch position.

      posted in Plugins
      A
      Anton_S
    • RE: MSPhysics tests and questions

      There were a few issues.

      In new version, onTouch is triggered only one time, whenever there is a contact between bodies. In your script you tried to use the onTouch event as a repetitive event for generating trailing waves. It did work, as a bug, in version 0.9.9 but not anymore.

      Another thing is setting emitted bodies non-collidable. Setting the original bodies non-collidable won't make the emitted body non-collidable. You must appply such state explicitly to the emitted body:

      
      body = simulation.emit_body(...)
      body.collidable = false
      
      

      I fixed all these issues and also made rain droplets be independent of touch event.


      Faust's Whale.skp

      posted in Plugins
      A
      Anton_S
    • RE: MSPhysics 1.0.3 (16 October 2017)

      Left-click on the sky/background to suppress the highlighting. You can't unfortunately hide the group from the menu though. I should've thought of adding this command.

      posted in Plugins
      A
      Anton_S
    • RE: [Plugin] AMS Library 3.7.1b (29 May 2021)

      Sorry, I forgot to test it on Windows XP. It should be fixed now. Upgrade to AMS Library, version 3.5.2.

      posted in Plugins
      A
      Anton_S
    • RE: [Plugin] AMS Library 3.7.1b (29 May 2021)

      Hmm. I'm not getting any errors in my SU8. Are you using the latest versions of both plugins? If not, try completely removing both and installing once again.

      Edit: Actually I'm getting a similar error when I attempt to start MSPhysics simulation in SU8. I haven't been able to determine the cause, so try sticking to SU2013+.

      Edit: I will ensure the compatibility with SU version prior to 2013 at some point.

      posted in Plugins
      A
      Anton_S
    • RE: MSPhysics tests and questions

      The green piece can be grouped with the blue pieces: ungroup both of the blue pieces, hold CTRL, select the green piece, and regroup them all together.

      For improvements you can change the collision of the yellow wheels to Cylinder shape. Also, set the solver model to iterative 16 passes and material thickness to zero.

      The only way you will achieve a smooth ride is by relying on the CurvySlider joints and having the entire track set be ignored; relying on contacts will rarely show you good results. Here I attached your model with two CurvySlider joints lining the entire track. I also used Fredo6's Curvyvizard (http://sketchucation.com/forums/viewtopic.php?p=415495#p415495) to smooth the curvy at certain, rough locations.
      soru.skp

      posted in Plugins
      A
      Anton_S
    • RE: Extension Signing

      I came across it. And it works under certain conditions. For me it worked when signing through Microsoft Edge rather than through Chrome.

      posted in Developers' Forum
      A
      Anton_S
    • RE: MSPhysics 1.0.3 (16 October 2017)

      Faust: I fixed it. Update to 1.0.1.


      Ecati: It depends on a model. If your model is working properly, then there is nothing necessary to update; otherwise, adjust the properties of joints, body properties, like emitters, and scripts (if any). If you have trouble doing so, post a model in "MSPhysics Tests and Questions" thread if you need help.

      posted in Plugins
      A
      Anton_S
    • RE: MSPhysics 1.0.3 (16 October 2017)

      Announcing MSPhysics 1.0.0!

      This version comes with a significant amount of improvements and a few new features. Main feature is a custom automated transitioning of scenes, which can transition forward, backward, and loop. Here is a model demonstrating it:
      Planned Steps.skp
      A detailed list of other features and bug fixes can be found here: http://www.rubydoc.info/github/AntonSynytsia/MSPhysics/file/RubyExtension/MSPhysics/CHANGELOG.md

      This requires installing AMS Library version 3.5.0, which is referenced in first post. If you received development versions of AMS Library, you must upgrade to the latest one.

      Also, you no longer have to bother removing original versions as the overwriting should work fine now.

      I have removed geared joints feature until the next release, as it was the only thing that preventing me from releasing this version.

      And one more thing, models creating with prior MSPhysics version might work differently/be incompatible with this version. Make sure to update your models' physics properties and scripts if necessary.

      posted in Plugins
      A
      Anton_S
    • 1
    • 2
    • 11
    • 12
    • 13
    • 14
    • 15
    • 63
    • 64
    • 13 / 64