# solved Cylinder edit vertices on top

## Recommended Posts

Basically I try to edit the top of the cylinder in vertices, giving impression that there is grain in a storage unit.

I have this:

I look for the result only of the grain as shown in the attached image:

##### Share on other sites

Hello and welcome to the forum,

I do not quite get the issue you are facing, in your playground, you are not calling the edit function.

##### Share on other sites

Hi! thanks!

I have used the function EditMesh for tests...

I don't know how I can do to create rings with vertices at the top, to create an elevation impression of grain in my units...

what can I do?

##### Share on other sites

Calling on @Pryme8 and @jerome who are amazing at creating procedural geometry 🙂

##### Share on other sites

no time for me now (later), but the answer is to create a tube with variable radius along its path

##### Share on other sites

I’m confused as to what the goal is. A ring that shows the height of the grain in be silo?

##### Share on other sites

Ohhh I got you, I miss read the post!  I am out of town at the moment, give me to this evening if I remember when I get to the hotel then I got you.  This is actually really easy!

You would use an updatable disc and a cylinder to accomplish this I would imagine.

##### Share on other sites

Well, I decided to try to start with 'tube' and 'path' but I was not successful, because the basics for you guys is a lot for me. 😀🤪 (I'm a beginner, sorry).

OBS: I try to solve only the level of the grain with different reliefs

See:

##### Share on other sites

just use a radiusFunction to set the radius according to the current tube step

##### Share on other sites

Great @jerome! but how update one side of level? as shown in the attached my image.

##### Share on other sites

quik and dirty : http://www.babylonjs-playground.com/#MYAL6U#8

just change the tube internal path coordinates on the wanted steps. Said differently, don't make a straight path but a curved one in the upper part

##### Share on other sites

Hi @jerome there is another way to update one side without tilting the top?

##### Share on other sites

As I said, you could do a curved path in the upper part http://www.babylonjs-playground.com/#MYAL6U#10

and you could also add as many steps as you need on the lower part, not necessarily all aligned together, just make some tests to get the wanted shape

this one reminds me something but I can't tell what : http://www.babylonjs-playground.com/#MYAL6U#11

##### Share on other sites

@jerome I thank you all the time for your dedication to helping me. creative answer #11, 😂😆

well, we're almost reaching for what I really need.

It may be difficult for me to express myself here, but in fact I need to use different levels that go up and down at different points in an arc/radius

see the image below:

red dot = N cables
circle Blue = N arcs
line gray = Surface that can go up/down depending on the product level

I do not know if there is a slightly different shape instead of curves?

tanx dude!

##### Share on other sites

@Dieterich a belated welcome to the forum from me. I think I am right in saying that you will only ever get a pointed top to the grain using a tube because the cap uses a barycenter. Using a bezier surface you can get a more curved top, however the issue is that you cannot get a true circle with a bezier surface. In the following PG the boundary control points are fixed to form an approximate circle lying on a sloping plane. The central control points, indexes 1, 1, 1, 2, 2, 1, 2, 2 are changed in an animation to show the different types of top you could get. The equation to vary the inner control points is not the only one to use on these points. Hope this is of use

##### Share on other sites

Did this get solved yet? If not I got you tommrow.

##### Share on other sites

Well, I'm impressed with all answer's. Each made me learn something about the Babylon.js, and getting closer and closer to what I need.

@JohnK how up and down the center point? and how create more points?

I have only this points

controls[1][1].y = 6;
controls[1][2].y = 6;
controls[2][1].y = 7;
controls[2][2].y = 7;

@Pryme8 I have not clarified my doubts yet.

thank you so much

##### Share on other sites
30 minutes ago, Dieterich said:

how up and down the center point? and how create﻿﻿ more points?

A bezier surface only has 16 control points https://en.m.wikipedia.org/wiki/Bézier_surface

This was an idea for the grain a tube is still best for the silo.

##### Share on other sites

I understand. One last question, I'm now trying to adjust the bezier angle, is there any parameter to this?

##### Share on other sites

Does it need to be Dynamic or Static?

Are you going to be doing hit tests on it or can I displace it in the shader?

##### Share on other sites
2 hours ago, Dieterich said:

I understand. One last question, I'm now trying to adjust the bezier angle, is there any parameter to this?

Sorry which angle do you mean?

##### Share on other sites

@Pryme8 can be static.

@JohnK I would like to reduce the smoothness of the curve, more precisely it should be closer to 27 ° (you do not have to be right at this angle), I subtract the 'divisions' but this reduce surfaces.

##### Share on other sites

The point of a bezier surface is to produce smooth surfaces, so this is probably as pointy as it gets https://www.babylonjs-playground.com/#KT9EE7#15

##### Share on other sites

If it can be static, then honestly I would raymarch that.... but the hacky way will be to do it with geometry displacement from a texture like I started working on here:
https://playground.babylonjs.com/#GZ91H2
or use @JohnK's method

##### Share on other sites

Another method you could use is make a heightmap Ground, and then use CSG to make it a circle then tube.