[Solved] Can I get beam pressure(PSI) values ?

Discussion in 'Programming' started by NOCARGO, Oct 30, 2021.

  1. NOCARGO

    NOCARGO
    Expand Collapse

    Joined:
    Apr 1, 2019
    Messages:
    1,477
    obj:getBeamLength(beam_id) and obj:getBeamStress(beam_id) work, although for gauging purposes the beam length isn't very useful when trying to hook it up to let's say a needle gauge.
    But I can't seem to find a call for beam pressure as I actually would like to gauge beam pressure, pressurePSI in particular.

    obj:getBeamPressure(beam_id) doesn't seems to be a valid call, neither is obj:getBeamPress(beam_id) or obj:getBeamPressurePSI(beam_id).

    Does anyone knows if it is possible to get this value ?
     
  2. angelo234

    angelo234
    Expand Collapse

    Joined:
    Aug 11, 2017
    Messages:
    344
    Isn't obj:getBeamStress(beam_id) what you're looking for since stress is equal to pressure? If you want it in PSI (assuming its in pascals) then just multiply it by 0.000145038
     
  3. NOCARGO

    NOCARGO
    Expand Collapse

    Joined:
    Apr 1, 2019
    Messages:
    1,477
    Theoretically you are right :) However, I think that obj:getBeamStress(beam_id) is giving us these kinds of values ↓

    Wikipedia :
    Stress in thin beams

    The analysis of stress can be considerably simplified also for thin bars, beams or wires of uniform (or smoothly varying) composition and cross-section that are subjected to moderate bending and twisting. For those bodies, one may consider only cross-sections that are perpendicular to the bar's axis, and redefine a "particle" as being a piece of wire with infinitesimal length between two such cross sections. The ordinary stress is then reduced to a scalar (tension or compression of the bar), but one must take into account also a bending stress (that tries to change the bar's curvature, in some direction perpendicular to the axis) and a torsional stress (that tries to twist or un-twist it about its axis).


    While with BeamNG we have a beam type called 'pressured', as you most likely know :)
    This kind of beam expands along the axis to serve as a shock absorber or a spring.
    These pressure values are different and way more constant compared perpendicular or torsional differences in value if I'm correct.(?)

    I want to measure and adjust the pressure of the vehicle's airbags in a customized fashion, such as gauging, stepped height presets and a default height preset, which I can easily by changing its core file (controller/pneumatics.lua) but I haven't found a solution with custom code so far.

    --- Post updated ---
    Oh heheh.. finally figured it out :)
    It's all about jbeamData and a custom pneumatics controller, silly me again !
    I couldn't find my way into pneumatics.lua without using the core file but I took too little jbeam code into account.
     
    • Like Like x 1
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice