Update: Added CornerWedge support for .fromParts(), will be adding .fromMeshVertices() soon for those who want to use custom meshes
Update: Increased random point dimension to 3 for less edge-biased random point distribution
You can change it here inside the PartsZone module by changing RANDOM_POINT_DIMENSION:
Heres what a random point dimension of 1 looks like, pretty cool:
Update: Made :IsPointWithinZone() work reliably for any array of vertices (used to be kinda buggy )
Thanks to the folks at StackOverflow for this function:
Note that this update has slightly slightly decreased the performance of :IsPointWithinZone(), but only by like idk 40% of the original performance so itβs not that much
Update: Changed :IsPointWithinZone() to now use predefined shape check functions instead of using the vertices of the shape (those are reserved for :GetRandomPoint() now)
This SIGNIFICANTLY increased the performance, around 0.000001s (min) to around 0.00004 (max) for each :IsPointWithinZone() call
Update: Added .fromBasePartsVertices constructor, which allows you to define your own vertices AND use MeshParts!
Let me know if you have any issues with tetrahedron creation
I also seperated all the geometry-related functions and tables (such as VertexGroup constructors for parts, .getRandomPointInSimplex, .isPointInBox, etc) into its own module called Geometry, which can be used independently