Jump to content

Trouble using rope for powerlines


photo

Recommended Posts

Hello,

I'm trying to use ropes to create powerlines. To be clear, I want to use the dynamic rope just for the creation, and then remove all physic when the ropes are stabilized. This is just to avoid to manually compute the geometry of the cables.

I based my code on the code sample https://developer.unigine.com/en/docs/2.11/code/usage/ropes_creating_pylons_and_wires/index?rlang=cpp

While I can successfully create a rope between any two points, I didn't manage to control the actual curve or even the integrity of the rope (ie it breaks). As an example, I create a rope between pylons with increasing space (10m, 20m, 40m, 80m) and I can't get a consistent output:

image.png.4a4a8db3a503e7b244a130e27d73196b.png

As you can see here, the rope broke at 80m and the curve is not consistent between pylons  (even though they all are created with the same values).

body->setMass(0.01f); //< even a mass of 0 doesn't change the result. Shouldn't a 0 mean no deformation?
body->setRigidity(0.85f);            //< for all values, the visual result
body->setLinearStretch(0.9f);        //< seem to depend on the number of segments and the distance,
body->setLinearRestitution(1.0f);    //< but I can't get a consistent result
body->setLinearThreshold(10000); //< has no effect?
body->setAngularThreshold(360); //< has no effect?

In the end, the rope:

  • must never break
  • the curve should be gentle (not rigid, not floppy, well you know how it should look more or less)
  • the number of segments should be minimized for each rope (ie one rope could have 10 segments, another 100 maybe if its longer)

the real distance between pylons can be 10m to ca. 500m (pylons position will be from GIS source)

So, am I going with the right tool? what am I doing wrong? (remember there will be no physic enabled in the end, this is just to get the correct shape for the cables)

Thank you!

Powerlines.zip

Link to comment

Hi Werner,

Thanks for pointing to this, even if technically I know about this and found a small implementation sample, given here for future reference (this could help others too):

https://codegolf.stackexchange.com/questions/37609/catenary-between-two-points-hanging-chain

My concern here is double edged:

  • why is BodyRope so hard to use correctly? (I even got some situation were the cable appears to explode into a spaghetti plate, even with very correct values !)
  • is BodyRope suitable for a large scene definition? (or is it only suitable for a small number of ropes at once?)

Also, I recall that 1-2 years ago, the support for "long-fine-objects" (aka pylon cables) was in the roadmap, but it's no longer there! What happened?

(Long cables pose a very specific rendering issue in flight simulators - flickering, aliasing, apparent width,... Having the correct catenary shape is just the easy part...)

Link to comment

Yes, I am familiar with these (annoying) lines in the landscape ;).

Most of the time, we dont depict them in our works (but we are making artworks ;)).

Lately I try to use the Line object, which can handle these kind of task in a okay manner. Together with the Wire inflation, it does some good.

Generally I found out, that using simple polygons with an alpha texture, handles this thin line issues better than geometry (maybe together with the line object..)

best.w.

Edited by werner.poetzelberger
Link to comment

Our case is also quite specific, as we both need a realistic look'n feel from a distance (even kms away!) and a realistic look from up close (less than 5m from the cable) (sample use case: simulation of a electric company's helicopter having to work on a power line).

Hope Unigine devs have some good news, here :)

Link to comment

So the Spline object could work, probably.

The distance issue, you can solve via switching LODs. From a high detailled model (or at least with detailed material), to a simple 2d mesh with texture.

There is also an option, to rotate the normals towards the camera in the mesh_base material, and the wire inflation, which helps on distance for small objects.

With the spline object it might be quite easy as you tile the object along the spline. So the base models are simple (Cylinders) maybe.

Even at the Knot points you could insert different models for a higher detail convinience.

Just thinking a bit, doing it is the other thing (as we know) ;)

Edited by werner.poetzelberger
Link to comment

Hello! 
error was in computeRopeMeshTransform method. 

// Computes the rope mesh transform (ie align the rope between its two anchors points)
Mat4 computeRopeMeshTransform(const Vec3& pos1, const Vec3& pos2) {
	Vec3 mid = (pos1 + pos2) * 0.5;
	Mat4 t = setTo(mid, pos2, vec3::UP);
	return t;
}

image.png

due to incorrect transformation, the rope was torn immediately and other parameters behaved incorrectly. 

Link to comment

Hey, setTo is pretty nice a function to have :) I didn't know about it!

So now, the rope is correctly transformed, but I still can't control the sagging as I need.

  • setMass looks to have to effect
  • setLinearStretch(0.0001) should give me an almost straight line, but it stills sag a lot for even 80m (and remember I need 500m...)
  • setLinearRestitution(0.1) gives a rope that almost completely falls to the ground (like a melted cable), but setLinearRestitution(100) doesn't do the opposite (expected a stiff, rigid cable)
  • setRigidity looks like it just control the time the cable takes to settle (and if it "bounces" when searching the equilibrium)

I'm sure I'm missing something here, but randomly playing with parameters is no way to go, especially when I must plant thousands of cables and can't manually check all of them manually :)

Thanks!

 

 

Link to comment

Hello,

As the dynamic Rope was too difficult to configure correctly for our need, I finally build the catenary manually. As it may be of help to others, here it is for all to use (src and image attached).   

As a side node, the real struggle now will be to have a good render from afar. I still hope Unigine will some day (soon?) implement a real-looking catenary shader.

catenary.PNG

Powerlines.zip

  • Like 3
Link to comment
×
×
  • Create New...