WIP Dot JBeam Editor

Discussion in 'Utilities and programming' started by angelo234, Nov 28, 2021.

  1. eggward

    eggward
    Expand Collapse

    Joined:
    Apr 28, 2020
    Messages:
    367
    i wonder if you'll be able to create jbeams from scratch with this
     
  2. Alex_Farmer557

    Alex_Farmer557
    Expand Collapse

    Joined:
    Dec 28, 2016
    Messages:
    3,485
    oh wow, this is the sort of editor i've been dreaming of for years
    great work, man!
     
    • Like Like x 1
    • Agree Agree x 1
  3. Iamthelaw105

    Iamthelaw105
    Expand Collapse

    Joined:
    Feb 16, 2021
    Messages:
    70
    this will change everything in the process of editing from jbeams,
    i really love to see a free movable cam and that it is possible to watch thru the car body to see the jbeams inside
    really amazing work, i can't wait to use this. you got my full respect that u're the one which makes that.
    i actually transformed an etk800 jbeam into a bmw m5 and it is such horrible thing to use the old editor
    keep the good work going mate
     
    • Like Like x 1
  4. SKB

    SKB
    Expand Collapse

    Joined:
    Apr 22, 2017
    Messages:
    1,710
    This editor. Gives me motivation to finish my pending 3d models and get it in game.. absolutely amazing job my guy
     
    • Like Like x 2
  5. angelo234

    angelo234
    Expand Collapse

    Joined:
    Aug 11, 2017
    Messages:
    340
    Yup I'm gonna add a functionality to add and delete nodes soon.
     
    • Like Like x 1
  6. eggward

    eggward
    Expand Collapse

    Joined:
    Apr 28, 2020
    Messages:
    367
    this is a giant leap for modding, i can tell
     
    • Agree Agree x 1
  7. Reece Coates

    Reece Coates
    Expand Collapse

    Joined:
    Apr 3, 2020
    Messages:
    153
    I’m loving the progress so far. It might be a good idea to just add a file editor along the side so we can format which nodes are where etc. and add a way for it to recognize individual parts in a jbeam file with multiple parts and hide said parts/nodes.
     
    • Like Like x 1
  8. angelo234

    angelo234
    Expand Collapse

    Joined:
    Aug 11, 2017
    Messages:
    340
    I'm currently adding in a JBeam hierarchy viewer/editor, allowing you to select nodes from the list and soon allowing you to move the nodes around. So I don't think adding a text editor will be necessary. :)

    preview.png
     
    • Like Like x 1
  9. mhegai

    mhegai
    Expand Collapse

    Joined:
    Feb 10, 2020
    Messages:
    336
    very usefull seeing as i sUck and all cars im capable of making are automation cars so this do be very usefull
    British: Ereigh usefull seein as oi sock an oll cars oim capable of moiking ore automoition cars so this do be ereigh usefull
     
    • Like Like x 1
  10. Agent_Y

    Agent_Y
    Expand Collapse

    Joined:
    Jul 10, 2020
    Messages:
    5,472
    I had some ideas for the future, namely stuff that automatizes making parts of Jbeam:
    • Create Triangles option - if you have all the nodes and main shape beams of your Jbeam set up (the editor should be able to tell which beams are main shape via comments in the code), it will create collision triangles within this area with the default drag coef 10, they will be facing in the opposite side of where the rigidifier node is (again the editor will be able to tell this node from comments), and will be added to a group of the same name as the node group they use
    • Flip Triangles button - self-explanatory, select a bunch of triangles and flip them
    • Add Rigidifier - this will add a rigidifier node, which has the same weight as the heaviest node currently in the structure, set up in a way that the average angle between the beams connecting to the node from opposite ends is 90 degrees and oriented towards the center of the car, the node will have disabled collision and self-collision by default, won't be part of any group (unless the main structure has less than 5 nodes, then it's in its group), and will also be connected to the structure with beams, of course it will also add a comment saying that it's a rigidifier
    • Add Cross Beams - when you already have your structure with nodes and main shape beams, this will create cross beams between your nodes that have lower beamDeform by default and have deformLimitExpansion set to "", and obviously will add a comment too
    • Add Rigids - same case scenario, it will add rigid and corner rigid beams with even less beamDeform and also less beamSpring + a comment
    • Connect Parts - this will be tricky, it should take the nodes from one part that are the closest to the other and connect them in a way that each node is connected to nodes as close to each rotation axis as possible (a node above, in front and to the left for example), beam properties of these beams should be probably the same as on the part with less weight, except beamStrength should be like 2 times BeamDeform and there are breakGroups spread evenly between the nodes of connected part that have at least 2 nodes each. It should be possible to tick a checkbox that it should act as a hinge, if it's ticked then "hinge" is added to the breakGroup name, if not then the same procedure is applied in the other direction except it avoids duplicates, so it won't move around
    • Add Support Beams - you select 2 parts and it adds support beams between them that connect nodes in a direction paralell to the distance between the parts, they have the beam properties of the "weaker" part + some precompression
    • Add Glass - select a bunch of nodes, and it will copy them to new part with slightly bigger weight, and will add brittle beams between them with low beam properties and a deformGroup that you can set the name of, also if it's a large area like a windshield it will add up to 2 extra nodes in the middle complete with beams and triangles
    • Change Material button - tricky one but would be cool, there would be a list of materials such as Metal, Plastic, Fiberglass and Carbon Fiber, and when selecting it, it will automatically change the Jbeam properties to be closer to simulating that material. For example changing metal to plastic will change node material to NM_PLASTIC and change beamStrength of the beams from infinite to slightly larger than the BeamDeform of the parts, to fiberglass it also reduces nodeWeight to 0.5 of previous value except for rigidifier and exceptionally heavy nodes and reduces beamSpring and beamDamp to 0.75 of previous value and beamStrength is slightly lower than on the nodes that connect it to another part, carbon fiber similar but stronger, etc.
    • Dynamically scale weight of a part that also scales all the beam properties with it so the behavior stays the same but just with different weight, and of course it displays the current full weight of the part somewhere
    • Add beams by click+holding a node and dragging to the other node, then if it's the first beam of the group setting the properties in a pop up menu, if not then it will use the properties of the main shape beams in the group. It should create a comment about main shape beams, as well as opening and closing lines of beams section if it's the first beam
    • Similarly add triangles by selecting 3 nodes in a row without having to look up their names, and a handy little button to flip the recent triangle
    • Wheeldata editor where you select by hand which node is for what without having to even know the names of them (and automatically cancels brake properties if they aren't already cancelled), and you can position wheels manually and it will calculate the nodeOffset for you
    • Exhaust editor where you can add new nodes and they automatically connect to previous ones and continue to form a working exhaust, with an option to split the flow in 2
    • Instability detector that detects which nodes or beams in particular caused an instability, and proposes a solution for it. Similarly oscillation and excessive stress detector because these often lead to instsbility, this kind of stuff should warn the user. Also clipping detector, should warn when nodes are too close to triangles if they have selfCollision
    Of course all of this is for far future, but it would reduce the amount of time spent by modders on Jbeam by like 90% so it would be amazing to have
     
    • Like Like x 5
    • Agree Agree x 1
  11. angelo234

    angelo234
    Expand Collapse

    Joined:
    Aug 11, 2017
    Messages:
    340
    I like the list you got but here's my critique:

    I'm not so sure where to start with generating triangles from an unordered list of nodes and beams (other than brute-forcing I guess), but from a little googling it seems using the "Constrained Delaunay Triangulation" algorithm might be the solution?

    Is this the scenario you're talking about: https://www.geogebra.org/geometry/efgvvxch
    Is it necessary that the average angle between opposite beams has to be 90 degrees? I'm thinking that the user should be able to define how rigid they want the surface to be (offset node 'x' amount perpendicular to surface from its center) since it depends on the surface material right? (I guess metal/aluminum is really the only surface we consider)

    Like this? But how would this work for parts that have different numbers of nodes?
    a.png b.png


    The instability, oscillation, and stress detectors would have to be their own Lua script in the game since they can only be solved by running the game.
     
  12. P_enta

    P_enta
    Expand Collapse

    Joined:
    Jan 11, 2020
    Messages:
    2,897
    Exactly how I feel. Jbeam is the one thing holding me back.

    don't different nodes have different materials? How will you handle that in this editor
     
    • Agree Agree x 1
  13. angelo234

    angelo234
    Expand Collapse

    Joined:
    Aug 11, 2017
    Messages:
    340
    Not sure what you mean by this. The editor will import all the node data if that's what you're wondering.
     
  14. P_enta

    P_enta
    Expand Collapse

    Joined:
    Jan 11, 2020
    Messages:
    2,897
    Different parts of the jbeam have different materials strengths and stiffnesses iirc. There should be a way to assign this.
     
  15. angelo234

    angelo234
    Expand Collapse

    Joined:
    Aug 11, 2017
    Messages:
    340
    I'll make it so you can assign the material for the nodes and strengths, spring, damping for the beams, and all other stuff too for other jbeam things.
     
    • Like Like x 2
  16. P_enta

    P_enta
    Expand Collapse

    Joined:
    Jan 11, 2020
    Messages:
    2,897
     
    • Like Like x 1
  17. Matthewgaming211278

    Matthewgaming211278
    Expand Collapse

    Joined:
    Apr 14, 2020
    Messages:
    1
    This seems good! Can't wait for a public release.
     
    • Like Like x 1
  18. Agent_Y

    Agent_Y
    Expand Collapse

    Joined:
    Jul 10, 2020
    Messages:
    5,472
    Well, I didn't really think of the technical side of things here, if it's impossible then don't do it lol, I just gave ideas
     
  19. atv_123

    atv_123
    Expand Collapse

    Joined:
    Aug 5, 2012
    Messages:
    1,615
    While this is a great list of things, I just want to add my 2 cents in on some of the ideas here...

    While this is "technically" possible and would be rather neat, contactor tris are usually more complicated than just "add them to the outside" of a JBeam. I understand that this is basically the way that tris are added to automation mods, but I think that doing them manually (with a feature not unlike the current NBEditor) should be sufficient.

    100%. A button that I can click and then just go through and click on tris and have them flip would be awesome.

    Hmmm... Alright, while I like this idea in concept, I don't think just automagically slapping a 90° connection in there is quite the right way to go about it.

    For anyone wondering what he is talking about here is a snippit from the Wiki along with some pics...

    "To explain what that means look at the drawn example.

    At (A) there's only a simple beam (green). At (B), to simulate a flat plate, cross jbeams (yellow) are added to cope with the shear forces. At (C), rigid beams (blue) are added to make a stiffer structure, without it the nodes will rotate around each other. The rigid beams can cope with only a little moment, just like a flat plate can easily be bend. at (D), a rigifier node with beam (red) are added to stiffen up the structure. In real life, the shape of a part influences the stiffnes of the part like with small flanges. To still be able to cope with forces perpendicular to the structure and keep a simple jbeam structure rigifier beams are used. A limiter beam (orange) is often added to the edges of a structure to prevent stretching.


    Different beams to connect nodes


    Beam tweaking with different node density
    A example of the fullsize hood including the beams is shown"



    So basically, rigifiers are used to... well... make structures ridged.

    I could have sworn on my life that this actually used to be its own section that would make an imaginary, unbreakable beam back in RoR, and the term just came over into beam despite the section not actually existing anymore... but I, for the life of me, can not find any info on that section that states it ever existed... so I am kinda thinking I somehow made that up in my head.

    Anyways, while the whole 90° thing may not be the most useful, and may just be a bit of waisted mathematics, what would be useful is something like this (hear me out).

    In the beam placement list, perhaps it allows you to place multiple types of beams. One of these types would be "Rigifiers". Even though its not a real section, here is the action that it would do (in my head anyways)

    Step 1. It would prompt you to select the nodes in which you would want to "rigify". In the hood example above, this would have you selecting nodes "h1rr" all the way to "h4ll"... perhaps even with a drag multiselect command. Then, once all your nodes are selected, click "Confirm" or "Accept"

    Step 2. Add in your rigifer node. This would be a simple act of just clicking on the screen to drop your node into the JBeam. The node would then pop up with a "Move Triad" so you could move the node into its proper position. Need more than one of these? Just click again, or perhaps a little "Add node" button to add another node to be used as a rigifier for the same original set of nodes. Once done, again, click "Confirm" or "Accept"

    Step 3. Watch the magic happen. Basically what the Editor would do at this point is add the nodes you wished to be used as rigifiers to the bottom of your node list with a comment identifying them as such. Then it would move on down to your beam section, and add in all the beams that would be used to connect to these rigifier nodes with a beam properties line added at the beginning of the section along with a comment about these beams being used as rigifiers.

    This tool would honestly save a ton of time and really allow for some quality work to be done very quickly.

    While just being able to click a magic button and have it do this would ideally be awesome, again, like with the tris, I think there would be far to much effort into the mathematics to really make this work the way you want it to in your head. Not that its a bad idea... not at all... just perhaps a bit to difficult to implement plus there are so many situations that would throw it off that it probably wouldn't be all that useful.

    Instead, again, I suggest having a dropdown menu for beam types, and one of those can be "Cross Beams". These may honestly be as simple as you select that type of beam and the editor just looks for its own comment for "Shape Beams" or "Structure Beams" and then just takes the Beam spring and damp properties and just multiplies them by the square root of 2 (the hypotenuse of a 45, 45, 90 triangle) as just some base properties to get you in the ball park. If it doesn't find any comments like that (perhaps your editing an old file or one not created with this editor, then it can just prompt you for the values. Again, this would create its own section in the beams section to be used for cross beams, and it would have a comment labeling it as such.

    Again, same thing as above. Could just be a beam type in the dropdown list with identical functionality to the Cross Beams section except it would just be labeled as "Corner Rigids".

    Ok... great idea... but again... a bit complex.

    There have been auto connectors on tools in the past, and, while I am not gonna say they don't work... usually there are just too many variables to get them to work well.

    However, if we go back to the list idea, adding "Connection Beams" that would automatically add themselves into a "breakGroups" section would be rather awesome.

    The checkbox for the hinge identifier could stay as well, perhaps with a button for "New BreakGroup" for if you were connecting several different parts at the same time and didn't want them to all be in the same break group.

    Again, I think adding them manually would be much simpler as automatically detecting the best locations to mount the beams to will probably be a mathematical nightmare. However, another great beam type to add to the list. When using this beam type it would automatically add in a beam properties section with the "SUPPORT" beam type filled in automatically. It would also close out this section with a "NORMAL" beam type line as turning the rest of the vehicle into spaghetti by forgetting this line is always fun (can you guess how I know that?)

    So this... this might actually be doable. Compared to some of your other feature ideas, the biggest thing here is just interpolating the new node locations off of the selected node locations. The rest is just connecting those nodes to the new nodes (pretty simple), using some standard (ish) glass properties, and then sticking in some tris. If there backwards we can just use the tri flip button from earlier and flip them around.

    So this wouldn't be that difficult other than dealing with all these new sections that we are adding. Since we have been adding all sorts of sections that potentially will have auto generated properties, all those auto generated properties would all need swapped as well... which could be the potential pain in this feature.

    While neat, I am not sure how useful it would really be as there are so many different instances that require values that just wouldn't normally pop out at you as being a value that would come from the properties of just slapping some real world numbers in and calling it a day (kinda like that square root of 2 thing I was talking about earlier... those would all just be ballpark guesses and more than likely need changed after the fact anyways)

    Well... you could probably do this. There are equations out there to adjust properties with scale... may work here to get you rough numbers. The node weights could easily be scaled, but I am not 100% sure how easy the beam properties would scale... again it would probably just give you a rough ballpark guess if this were a thing.

    Again, rolls into that beam type list I was talking about earlier.

    Refer to triangle comment at top.

    Yeah... I think this is a good idea. Would have to identify both left and right nodes separately, but it could be done in a way to connect them automatically since the node and beam count would stay low enough for this to work.

    Step 1. Click "Add Global Wheels" button.
    Step 2. Identify front wheels, rear wheels (as almost all the files in the game use either front or rear wheels), or custom wheels (for everything else)
    Step 3. Select which set of hubs to use (3 lug, 4 lug, 5 lug, 6 lug, 8 lug... whatever else there is). This can be a list with checkboxes you select so you can choose which ones to include of not.
    Step 4. Select "Right Nodes"
    Step 5. Select "Left Nodes"
    Step 6. The program would check to make sure you have the same number of nodes selected on both the right and left selections. If not it would prompt you to either fix your mistake while identifying which node or nodes are the outliers, and also include a button for ignoring the warning (who knows... perhaps it was on purpose)
    Step 7. It throws you into the YZ plane in the view and has you click to place the position of the nodes. It would then give you X and Z arrows to help drag it to the exact location.
    Step 8. It would now throw you into the XZ plane and allow you to set the width. This would give a representation of the nodes from the hub file. It then gives you an X scaler set of arrows so you can set the width.
    Step 9. Finally it connects the right hub nodes to the right node selection and the left hub nodes to the left selection. Normally this is a really low node connection count, so it could automatically just connect all the nodes to all the hub nodes. It would then also make sure to make separate breakGroups for each hub connection.

    That's a lot... but I do think it is doable.

    Again, I think this could also be added to the list of beam types.

    Other than running the game... I have no idea how you would do this. There could perhaps be a debug tool menu that could identify nodes with too many connections? These nodes usually will end up being unstable as the added up beam spring and damping from far to many connections can end up making a node unstable... but other than that I have no idea how you would go about doing something like this.

    Again, I am just adding my perspective to your ideas, as there are a lot of good ideas there.

    So a big one from me would be to have some way of filtering which JBeam or JBeams from a file you want to be working on. There are many instances where a particular JBeam file may have 10+ different JBeams inside of it.... sometimes with all differing structures. Naturally, being able to open a file, and then selecting from the list of detected JBeams in that file to filter into and work on would be HUGE.
     
    • Like Like x 5
  20. angelo234

    angelo234
    Expand Collapse

    Joined:
    Aug 11, 2017
    Messages:
    340
    Update #4 (it looks a little laggy because I'm using my crap laptop with Intel HD Graphics lol)



    Functionalities Added:
    • JBeam Hierarchy
      • Allows you to visually see the structure of JBeam file(s) (e.g. nodes, triangles, parts, etc.)
      • Allows for multiple JBeam files
      • Can select JBeam objects
      • Can show/hide general to specific JBeam objects (e.g. whole JBeam file or a specific JBeam node)
    • Now imports and renders triangles
    • Now can inspect/edit beams and triangles properties in JBeam Inspector
    • Spawn nodes
      • User selects which JBeam part to add the node to
      • If a 3D mesh is imported into the editor, it can be used to guide the placement of the node (hovering your mouse over the mesh will place the node on the surface of the mesh).
     
    #40 angelo234, Dec 14, 2021
    Last edited: Dec 14, 2021
    • Like Like x 14
  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