I try to create dynamic boxes individual bevels. I was already able to create vertical bevels but I am stuck with the horizontal part. I created vertical bevels like this: https://www.babylonjs-playground.com/#GW2F0U#15
The box should look like this for example with horizontal beveling set to 1 segment:
My idea wasto create the horizontal bevels with scaling each level of my shape. So the ground (level 0) has specific vertices. Level 1 should extrude vom the same vertices along y-axis and increase scaling. But I realized that the shape of level 1 doesnât equal the shape of level 0 due to the vertical bevels, so I have no clue how to solve this.
Thanks for your reply. I read all these posts already but I am still not sure how to adapt them. My goal is to have control over all edges and each corner.
So I can say the edges should be hard or smooth with 10mm size for instance.
In addition to that I want to state the type of each corner (hard/smooth). I accomplished that in my pg above.
This example is nice because I am able to adjust vertical as well as horizontal bevels. But in comparison to my pg you are not able to adjust the radius of the bevels. And the bevels are not symmetrical if the box isnât symmetrical. Setting the height to a lower value that the width and length leads to a tiny bevel on the sides of the box and a huge bevel on top face.
I think my initial approach should be fine. So I only have to scale down the shape to build my box. So I can generate all the vertices for my box but I am not sure how to fill the spaces.
Do you have an idea how to do that? Maybe with extrudeShape? I donât get how to scale along the path. It just scales the complete mesh but thatâs not successively like with rotation: https://playground.babylonjs.com/#MR8LEL#75
Iâm not sure you can do this with a single extrude shape⌠You may need to make an extrudeShape for each corner (or for a single corner then clone and adjust the transformation matrix for each) and for each side (or clone).
Isnât it possible extrude and scale simultaneously. If I set the rotation the shape gets rotated along the path. Scaling should behave the same way but it just scales the extruded shape in general.
rotation (float, default 0 radians) is the angle value to rotate the shape each step (each path point), from the former step (so rotation added each step) along the curve
scale (float, default 1) is the value to scale the shape
scale is a single global value, it is not added at each step as rotation is. In your case it wouldnât work, anyway, because you need to make it grow at step 2 then decrease at step 4.
Given your simple shape, I think I would simply create the mesh âby handâ, by providing the vertices and the indices (but Iâm not really experienced with extrudeShape, maybe thereâs a simple way to make it work in your case).