Soft body rope from extruded mesh playground example could be updated

This is not really a bug. More of a suggestion to may be update the playground example for:
playground.babylonjs.com/#8WC6ZN#5

I was quickly looking back at the rope soft body when I saw this small glitch in the doc example(s). Because the shape is not closed, the rope appears glitchy (depending on camera angle and rope stretch). You can best see it when looking from the side.


Closing the shape (adding one point at start) solves the problem, as shown here with this quick twist of mine:
playground.babylonjs.com/#8WC6ZN#119

I didn’t want to change the code so I simply added 0.1 to the value of ’ i < 2 * Math.PI ’ to force adding one more point on extrusion. Feel free to do a cleaner code;) and then may be update this part for newcomers.

Edit: oops, just found another one same problem over here:
https://playground.babylonjs.com/#8WC6ZN#2

Thinking of it, there might be others with the same issue (for all or some of .MeshBuilder)…

Edit: this could also be the case with ‘.ExtrudeShape’ used for some of the rope examples. There is something with these constructors and closing path VS not… just something…

I can’t open your playgrounds

What do you mean? These aren’t my playgrounds. They are the ones from the doc.
Simply goto
Soft Bodies | Babylon.js Documentation
and check on the examples with a mesh (in section rope)

Adding @PirateJC for the updates :wink:

Hey @mawa - Happy to update these.

The original links you posted look like they are to the default playground.

If you can give me before/after playgrounds, I’d be more than happy to swap them out.

Just need a list of which ones you think should be changed, and links of what they should be changed to.

Thanks a million for being vigilant and keeping an eye out for places the docs can be better! You rock!

I have just updated my posts so now you should have the links.
Incidentally, this simply raises another comment/suggestion of mine. It seems that if I was to simply copy/paste the playground link in the forum (without quotes), the link doesn’t take the # (or something… I didn’t investigate).
Same thing for the code of your playground examples @PirateJC, I’m not really willing to give you the code you will want to showcase for the doc examples (I’m not even sure I have the skills for that yet :thinking: I just wanted to let you know about the result (glitches). Yours to fix whatever you think needs to be fixed/improved.
Have a great day :smile:

1 Like

Thanks @mawa - We’ll have a look at them

I’m taking a look

1 Like

I can confirm it’s a simple rendering issue that is fixed by the solution provided by @mawa
I’m updating the PG and the documentation

PR fix non-closed extruded shapes for rope PG examples by CedricGuillemet · Pull Request #110 · BabylonJS/Documentation · GitHub

Did I just see you implement my ‘hack’/twist ?
Seriously, " for(var i = 0; i < 2 * Math.PI + 0.01; i += Math.PI / 8) " is that the best you engineers can come up with to fix what seems to be an issue (or misunderstanding) with a constructor? Ya know, yours ENGs are sometimes such a bunch of lazy people :wink: when you think the topic is ‘too simple’ and can be ‘disregarded’ (hear the love in my voice). Mind your steps ENGs, I can see you :face_with_monocle:

Edit: Sorry, I will have to edit this. :zipper_mouth_face:After teasing you on your work (this is something we love to do between designers and eng’s don’t we?:wink: :grinning: I thought I would have to do my share and went back this morning looking at these extrusions and I finally saw what you did in the other PGs (or what has been done previously, I don’t know). In fine, it is when you push the points, right?. This is where, you instruct to close the path using
“myShape.push(myShape[0]); //close profile”
as in your PG example
https://playground.babylonjs.com/#ZMKN5T#1

If I was to simply do this “myShape.push”, the profile/path would not close (or else I would need to add the last point and then it would).
Still I don’t find my dirty twist to make a closed circle very sexy (and we should may be add a comment to explain what this value of 0.1 or 0.01 depending on PG example, is actually here for.
Have a great sunday and thanks again for this awesome framework.
You guys rock