How to create a wall with an arc or a cylinder arc

I’m looking for a way to create a geometry that matches the image bellow.
I have the two points, the center of the circle and it’s radius. But I haven’t found a way to create a cylinder arc

Screenshot 2021-08-13 at 17.20.56

Does anyone have any idea how to accomplish this or what I should be looking for?

Thank you

Without a doubt there are many ways to go about this. I put together a Sandcastle example that provides some ideas to get you started…

5 Likes

@Robert31

Welcome to the community! :grinning:

@Rob your demo looks amazing! Thank you very much for sharing.

-Sam

1 Like

Rob did a great job using primitives, but I was wondering if it’s possible to do something like this using a custom Material for a polyline? I’ve never tried to write one for myself but I was impressed with the built-in “arrow” options. I have to assume it would be more performant as well, having one polyline entity instead of dozens of them.

ETA: this is a start, maybe?

  const material = Cesium.Material.fromType("Grid");
  const uf = material.uniforms;
  uf.color = Cesium.Color.MEDIUMBLUE;
  uf.cellAlpha = 0;
  uf.lineCount = {x: 100, y: 1};
  uf.lineThickness = {x: 3, y: 2};
  uf.lineOffset = {x: 0, y: 0.8};
  primitive.material = material;  

The trouble is that polyline materials seem to be applied in 2D screen space, rather than 3D world coordinates – that lineThickness parameter is in screen pixels, so as you zoom in, the lines stay the same width, resulting in less space between them. Maybe somebody with some shader knowledge could write a custom material that makes “stripe width” in meters rather than pixels?

1 Like

@James_B

That’s a great question! I believe it would be possible to get similar functionality using a custom material for a polyline. It would certainly take a bit of engineering. You may need to use more narrow lines, which would make the polyline less visible from afar. @Rob what are your thoughts?

-Sam

This has actually come up for me a couple of times in the past – certain primitives specify a size property in (screen-space, zoom-independent) pixels, and some specify size in world coordinates (meters, I’m pretty sure?) and there have been times when a primitive would look like what I wanted, if only the size worked in the other type of unit. As an oversimplified example, it might be nice to have a PointGraphics whose width is in meters, rather than having to make an EllipseGraphics.

1 Like

@James_B

I agree completely :rocket:

-Sam

It looks amazing, thank you very much.

I’m glad to help. I’m sure there’s many ways to skin that cat. And the method I shared would likely pose a performance issue if you were going to display hundreds or thousands. But depending on the need it may be a reasonable approach.

Sorry to take so long to respond. For some reason I didn’t get notified of these posts. I think it’s a cool idea and would love to see someone give it a try. I have zero experience with custom materials or shaders, so I’m afraid I’d be out of my depth. But I’d be very interested to see what can be done as I’m sure this approach could be used for many things.

@Rob

No worries! And yes, I agree completely :100:

-Sam