Create custom mesh


i have a little project, where i stack cylinders over each other, and produce the final product.
It can be seen here:

Right now i am working with three different cylinder sizes, which i load through .OBJ files.
I want to be able to dynamically change the heights of these cylinders and rewrite this program in a dynamic way. So i was having a look at the Meshbuilder and got this done so far:

So my custom cylinder looks almost like the .OBJ one, except for the bottom site. I’m not sure how i can accomplish this notch without specifying all faces manually. Later i want to be able to change the height of the cylinder dynamically.

Is there a way to somehow “substract” this top pin from the bottom side, so these cylinders could be stacked on top of each other?

Niklas :slight_smile:

You can use CSG to build this mesh (Babylon.js - Constructive Solid Geometries demo), but an easier way would be to use a lathe to build the circular shape:


Sorry for my late reply and thanks alot for your answer.

Actually i will work on this project again tomorrow and see if i can get it working. But on first glance this seems really promising. Thanks alot!

you can use geometryBuilder!rim

short document

// that make a rim mannager
var rim = new GB.Rims();

// you make rim and then you can attach them by connect

    name:'start',                                    // rim name
    count:setting.seg+1,                     // rim segment

// point is a fun that called per point in rim p is {x:0,y:0,z:0} and i is a point index
// you can manage the and at least you return p;

        p.x = sin(i*360.*deg/setting.seg)*setting.rad4;
        p.z = cos(i*360.*deg/setting.seg)*setting.rad4;
         p.y = setting.h0; 
         return p;

// that repeat your rim ** that help you make solid edge in mesh

// connect help you for make face

[rimName1] ,
[rimname2] ,
[flip] ,
[rimrepeat number for rimname 1],
[rimrepeat number for rimname 2 ] )


Thanks alot, i had no idea i could use external tools like this.
This might be super useful for future meshes too :slight_smile: