Trying to use CSG subtract from extruded shape

Hello,

I’m new to Babylon.js and js for that matter :slight_smile:

I’m trying to build up sheet metal part with cutouts and notches removed.

When I try to subtract a mesh from an extrusion, I get the opposite of what I expect.

The green shape is what I expected to have removed from a larger box (which is now gone).

To see the notch and the sheet at the same time, just uncomment the first of these two lines and comment out the other:

//addFemaleNotches(coilWidth, femaleLength, c1Depth, c2Depth, scene);
joint = getFemaleNotchesSubtracted(joint, coilWidth, femaleLength, c1Depth, c2Depth, scene);

Thank you in advance.

Looks like the negative y values caused the problem. Changing them to positives then works as I would expect.

2 Likes

Hi ajw1970,

Sounds like you got it all sorted out on your own, so all I really wanted to say is, “Welcome to Babylon!”

1 Like