Need help on creating chamfer(would like to know if there are other methods)

Hi all,
i need a help on the object i am creating here, i am thinking of controlling the object parameters through the backend values and thus will create this object at the runtime, this object has a chamfer at the front face and i have used ‘lathe’ for creating it, this goes well when the object is square, but it limits me for the chamfer when i want a rectangular frame with the lathe method, it would be of a great help from anyone suggests me if there is any other method i am missing

https://playground.babylonjs.com/#0ssidx

Welcome aboard!

Maybe you can use extrudeShape instead:

https://playground.babylonjs.com/#MR8LEL#177

1 Like

thankyou very much for the quick reply :+1: , we need the chamfer for all four sides here is where i am struggling to do it for the rectangular part :slightly_smiling_face:, the end product will be fully paramatric so, i have split the objects too

You just have to update the myShape array:

https://playground.babylonjs.com/#MR8LEL#178

1 Like

sorry for not explaining properly, i will hide the other planes from the object to give an idea for what i am looking for, in other words i need to chamfer the four sides as in hte example or bevel the front face

https://playground.babylonjs.com/#0ssidx#8

Couldn’t you use a truncated cylinder to create the beveled part:

https://playground.babylonjs.com/#QANVC6#1214

1 Like

oh thats a good option definitely helps, i will use it for square objects, but if the user want to update the square to rectangle here we have just the radius to control and the shape remains square, we are close :slightly_smiling_face:,

You can try to use a non uniform scaling of the final mesh:

https://playground.babylonjs.com/#QANVC6#1215

1 Like

Note it’s probably easier to use ExtrudeShapeCustom:

https://playground.babylonjs.com/#MR8LEL#179

1 Like

yes this definitely solves the problem for now :slightly_smiling_face: :+1:, thankyou very much, i really appreciate for your help, the only thing i will have to work on all the chamfered faces have same angles throughout, here the top/bottom and the leftright chamfer are of not same angles(as we have done a nonuniform scaling), but it solve my issue for now, thankyou again, and will also check later that the materials applied on it doesnt get affected, fingers crossed

both solutions solve what i was looking for i have just removed the cap extrude and added the 2sided for the second solution, thankyou again for your help :slightly_smiling_face: :+1:

Yes, that’s why I think the other solution with ExtrudeShapeCustom is better because the angle is the same.