Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How To Check How much of a part is in a Region3?

Asked by 4 years ago

So i Need a script that calculates what percent of a Part is in a Region3

I've tryed pretending the part is just facing the in the main direction (left,right,top,bottom,front,back) but it's not very relible so unsure where to look now

i'd also be fine if someone linked a website with the info how to calculate that so i can do it myself

if your wondering here's my code it do it how i was doing it

((part.Position.Y + 9) / (part.Size.Y / 2) / 2  + 0.5) * -1 + 1 
(note the part.size.Y got chaged to X,Z when it was turned)
0
I'd suggest checking the parts in the region3 then calculating the difference between the position of the object and the outer boundary of the region subtracting this magnitude from half of the size of the object on that axis then divide by the total size of the object for that axis SerpentineKing 3885 — 4y
0
that's what i did but it's not good enough also i'm dealing with rotating parts so that isn't help ful welololol 25 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

I got the answer myself since this was taking awhile i just put points all over the part and checked if there were under let's say 1y it worked good enough

Ad

Answer this question