Search Unity

Welding Physics (MIG, TIG, ARC etc)

Discussion in 'Physics' started by MorGuux, Nov 1, 2018.

  1. MorGuux

    MorGuux

    Joined:
    Jun 4, 2016
    Posts:
    3
    Hi, I've been interested in the idea of creating a VR construction game. Features I'd like to include would be grinding, cutting, bolting, screwing, welding, drilling etc.

    I was thinking about welding. How would it be possible to visually show a weld, in a realistic way. It would need to create a ball of metal with thermal effect, that could build on itself. It sounds like an idea that's far too complicated for a script kiddie like me to even think about :D
     
    JessyMon likes this.
  2. BoogieD

    BoogieD

    Joined:
    Jun 8, 2016
    Posts:
    236
    If you have a look at these 4WD mud driving type games, you could probably get the desired effect in a similar way.


    I suspect they have a mesh with plenty of tris and deform it dynamically.
    That would require fairly complex code accessing the Mesh object in Unity to change the vertices for each frame.
    The below link will get you started with some functional code.
    https://docs.unity3d.com/ScriptReference/Mesh.html
    You will need to study what the various arrays are in a mesh. Vertices, triangles and normals.
    Then comes the tricky bit in coding the deformation of the mesh to create the look of a dynamic weld leaving ripples behind. Like a small section of ripples in a pond from a rock except the center is moving with the welding rod. I found this formula in the video link below which you will need to understand and modify:
    z=(cos( 0.5sqrt(x^2+y^2)-6n)/(0.5(x^2+y^2)+1+2n), n={0...10}
    It maybe easier to just replace a small section of the mesh with pre determined vertex data as you move the rod along it.
    You have a steep learning curve ahead. Good luck with the project!

     
    Last edited: Nov 2, 2018
  3. Steel_Arm

    Steel_Arm

    Joined:
    Apr 9, 2013
    Posts:
    22
    The welding sounds more like a shader thing than physics. Of course the physics is there, although that's more like gameplay code than anything to do with the physics engine.
     
    SparrowGS likes this.
  4. MorGuux

    MorGuux

    Joined:
    Jun 4, 2016
    Posts:
    3
    Yeah, I was thinking of a shader, I saw an example on YouTube at one point
    which is exactly what I'd need. I need to get to grips with shaders and how they work in order to progress, but it's something I'm interested in doing, as I think VR is perfect for a sim like this.
     
  5. Virtareal

    Virtareal

    Joined:
    Aug 19, 2017
    Posts:
    2
    how to do welding effect in unity like in the video? Morguux do u have found any solution? thanks
     
  6. Jackrohit

    Jackrohit

    Joined:
    Mar 29, 2019
    Posts:
    10
    Did you get this plugin?
     
  7. EnokV

    EnokV

    Joined:
    Apr 14, 2016
    Posts:
    56
    Depending on the level of detail you're aiming for, you'd have to model a system to keep track of temperature and distribute heat and use this information to shape the bead, supposedly through a shader. Too much heat would result in more spatter and heat is distributed based not only on machine settings, but how long your arc is & how fast you're traveling.

    I would look into ray marching since it can produce a lot of interesting effects, like shapes fusing together, but it's quite a complicated topic.
     
  8. Foestar

    Foestar

    Joined:
    Aug 12, 2013
    Posts:
    350
    So I work on a shipyard as a welder for nuclear submarines as my main career and we actually just had them bring through a vr headset about a month ago with a welding simulator which was kinda cool though disorienting. As unique as it was, it still didn't feel like welding normally does, but rather painting.

    So that being said, right now is a time where you'd have to kinda imagine to yourself how you think it should be rather than going off what others do, as apparently a government facility like that only had something that felt 1/4 of what welding is actually like, and that was just MIG.

    There's a decent amount of info needed for a good weld, ie. angle, stickout/arc length, heat, wire feed, gas, travel speed, etc. So to start I would recommend more of a shader style like they did with a more painting feel then add from there.
     
  9. EnokV

    EnokV

    Joined:
    Apr 14, 2016
    Posts:
    56
    I've used a similar thing but way older and built on solid proprietary ground. A type of VR headset, but it was more like a welding helmet and instead of your typical VR controller it was basically an electrode holder dud with some plastic tube that would feed into the holder as you used it. The weight was there but without the spatter getting into your clothes and the heat radiating, crimping your gloves, it's not going to feel like welding.
     
    JessyMon likes this.
  10. MorGuux

    MorGuux

    Joined:
    Jun 4, 2016
    Posts:
    3
    Hi all.

    Sorry I've not replied in a while, but great to see some new comments on the topic ;)

    I haven't made any process because I decided to spend my time doing other projects that were simpler, so that I could grasp some more understanding before attempting something like this. I've seen a game https://twitter.com/_j4nw/status/1223714585372479488 using drills and hammers and it proved to me that a construction vr game would be possible.

    In the video I posted a few posts previously (Triplaner + VertexColor shader), he mentions in the comments "Marching cubes algorithm along with vertex-color shader should give you a good start." This is something I will look into as a starting point for the welding physics.

    I was thinking of including features like drilling, screwing, hammering, sanding and sawing (among others) for woodwork and welding, drilling, screwing, riveting and painting (again, among others) for metalwork. It seems like making screws and nails is not complicated, but I've not seen an approach where whatever is being screwed into is able to move also.

    The physics that the game/sim would need is far outside my technical ability right now, but it's a good idea for someone. I was thinking of making it more sandbox-based, to allow people to experiment with the tools without the cost of materials (and of course, safety :D ), but even for people wanting to practice DIY without the expense.

    I've also used a VR welding sim, but I can agree that it's not got the same feeling as actually MIG welding.
     
  11. karthigarajendran30

    karthigarajendran30

    Joined:
    Oct 4, 2023
    Posts:
    1
    this link i have
     
  12. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    11,456
    Please don't necro threads. All you've done here is repost a video from above.