Complex Part Cutting [HARD]

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve?

I want to make a module which will allow me to create holes inside parts. By that I mean that, as an example, if I were to place a block with same orientation but different size inside a cube, it’d separate the cube into smaller sections so it’d fit the format of the hole.


  1. What is the issue?

I am aware that there is a mathematical solution to this, but I haven’t been able to find it online.

I cannot use Unions because of performace reasons.

  1. What solutions have you tried so far?

I tried copying the part and doing a bit of messing around, but overall wasn’t able to cut the section. my method would also only work if there was one hole, and not multiple!

World of Magic did this correcly.

Well according to your post it would seem you don’t know about the special little functions roblox has to do exactly this.

BasePart:SubtractAsync (

BasePart:UnionAsync (

Now you could use math to do it, but you can alternatively use this which is extremely easier. It can be costly on performance, so just be aware of that before you go super heavy into scripting with this.

The whole issue is performace. I am aware of Unions and Solid Modeling.

You need to change your post then and specify that its a performance issue rather than just saying you want to do it.

World of Magic by @vetexgames managed to do this amazingly

Do you mean splitting it up into 4 different parts? like as show in the image?

Well In that case it is 5 parts. There is one behind it. I’d like to be able to make holes by transforming one huge part into smaller ones.

Ok so, negating one of them and then unioning the both. But with math, correct? If so I think I can help you out.

Reviving this topic because its needed for a new project. Yes! Exactly what you mean, I want to make holes on parts by separating the part in question into smaller sections

Narrowing your field may allow for finding a simpler solution to a simpler problem. For instance, in your example, all of your parts are axis-aligned rectangular prisms. Will that be the case for all of your intersections, or is the geometry more complex in your use case?

Yes they are axis aligned. The geometry is simple-typed.

Did you ever find a solution to this?

Yes, actually.

1 Like