Вариант того, как вы можете это сделать:
var scene = new THREE.Scene();
var camera = new THREE.PerspectiveCamera(60, innerWidth / innerHeight, 1, 100);
camera.position.set(0, 0, 20);
var renderer = new THREE.WebGLRenderer();
renderer.setSize(innerWidth, innerHeight);
document.body.appendChild(renderer.domElement);
var controls = new THREE.OrbitControls(camera, renderer.domElement);
var w = 1;
var h = 3;
var d = 10;
var pts = [
new THREE.Vector2(-w, h),
new THREE.Vector2(-w, -h),
new THREE.Vector2(w, -w),
new THREE.Vector2(w, w)
]
var shape = new THREE.Shape(pts);
var shapeGeom = new THREE.ExtrudeBufferGeometry(shape, {
depth: d * 2,
bevelEnabled: false
});
shapeGeom.center();
shapeGeom.rotateY(-Math.PI * 0.5);
// 45 deg cut
var pos = shapeGeom.getAttribute("position");
var temp = new THREE.Vector3();
for (let i = 0; i < pos.count; i++) {
temp.fromBufferAttribute(pos, i);
let signX = Math.sign(temp.x);
let shift = h - temp.y;
pos.setX(i, temp.x - (shift * signX));
}
pos.needsUpdate = true;
var shapeMat = new THREE.MeshBasicMaterial({
color: "aqua",
wireframe: true
});
var mesh = new THREE.Mesh(shapeGeom, shapeMat);
scene.add(mesh);
renderer.setAnimationLoop(() => {
renderer.render(scene, camera)
});
body {
overflow: hidden;
margin: 0;
}
<script src="https://threejs.org/build/three.min.js"></script>
<script src="https://threejs.org/examples/js/controls/OrbitControls.js"></script>