How to find out if a shape is within another shape?


I am a new coder, and am just slightly better than an amateur at writing scripts. I am trying to create a script that will determine if a shape is contained within another shape and then return a true or false value.

specifically, i would be interested to know which vertices are inside the other geometry, to determine if the shape is partially or fully within the shape.

Is there a simple way to do this, all my ideas include really intensive code that brute forces the problem. Thanks for any help.

That’s an interesting twist. Are your shapes 3D? Are they convex or can they be concave?

Hey did this once on 2D on 3D its harder, but try to read much about 3D Vectors (there are really good collision algorithms already, google for them) - Collision means “check if shapes intersect”.

If you’re a newbie to Vectors start with reading the basics for 2D-Vectors first and things will be easier in 3D: this is a good starting point (for Processing/javabased - but the principles apply to every language)