How to draw a polyhedron from parameters

Hi, everyone!
Can provide some idea to me about following polyhedron? The sizes and clipping surface are variable parameters.

Hello and welcome!

You may try to tune your polyhedron as described here - Creating Custom Polyhedra | Babylon.js Documentation

My idea, using triangular prism or box to clipping the big box, but can’t hide the clipping space

Thanks, i have tried, but it hard to build polyhedron form variable parameters if size or clipping surface change.

well, it is solve by CSG .subtract() method

1 Like

Hi @YantLiu and welcome to the community.

Two ways spring to mind.

  1. Build using a custom mesh Create Custom Meshes | Babylon.js Documentation

  2. Use CSG to remove sections

Babylon.js CSG API

1 Like