How to cut shape from ExtrudeGeometry

Hi,

I am trying to cut shapes in extrude geometry using THREE.Shape. I managed to cut them using shape.holes.push and it is working fine when the hole coordinate lies in the extrude geometry points.
But when the points goes outside the extrude geometry it create shape with boundry which is not required.
@prisoner849

The code look like
stairHoles.forEach(holeShape => { newshape.holes.push(holeShape); });
var extrudeSettings = { steps: 2, depth: depth , bevelEnabled: true, bevelThickness: 1, bevelSize: 1, bevelOffset: 0, bevelSegments: 1 };
var geometry = new THREE.ExtrudeGeometry( newshape, extrudeSettings ); // Deck Geometry


@prisoner849

Is there any thing i am missing ?

is it possible ?

Why does it count as a hole, if it’s outside the shape?

Thanks for your reply.

It is taking dynamic points of stairs. In the previous condition stair was completely outside which displayed the issue properly also in some other cases half stair is inside the deck and the rest outside.

In this case, you need to change the shape itself, not using a hole.

Which shape, Stair or Deck ?
Can you suggest or share any reference :disappointed:?

Correct me, if I’m wrong.
You’ve got a main shape that you extrude (Deck), then you want to put Stairs, whose projection on the ground plane partly is off of the projection of the Deck on the same plane.

So in this case you need to change the shape of the Deck, subtracting the shape of the stairs from it.
To perform that operation, you can use this approach with polybooljs: [Closed] How to split/separate a single ShapeGeometry into individual Geometries base on faces?