{"id":"royal0959/rblx-nonvoxel-greedy-meshing","name":"rblx-nonvoxel-greedy-meshing","scope":"royal0959","platform":"roblox","description":"Non-voxel greedy mesher for runtime parts merging/map optimization","version":"1.0.3","latest":"1.0.3","versions":["1.0.3"],"license":"MIT","licenseRating":"safe","licenseCaveats":[],"licenseVerified":true,"dependencies":{},"integrity":"38c64f4db4a508de2ac1ec1a04bf3b59c10dfb80eb97ab0c3db9b52ab869e3b6","likes":0,"downloads":0,"install":"forest install royal0959/rblx-nonvoxel-greedy-meshing","url":"https://forest.dev/p/roblox/royal0959/rblx-nonvoxel-greedy-meshing","files":"https://api.forest.dev/ai/package/roblox/royal0959/rblx-nonvoxel-greedy-meshing/files","readme":"# rblx-nonvoxel-greedy-meshing\r\nmodule for merging parts that don't need to be adhere to voxel grids\r\n\r\n<h1>Functions</h1>\r\n<code>Mesher:MergeNearby(part: BasePart, OP: OverlapParams, mergeProperties: MergeProperties)</code> <br>\r\nAttempt to merge part with nearby compatible parts. OP and mergeProperties are optional, if an OverlapParams is not provided, part can merge with any parts in workspace\r\n\r\n<br>Example:\r\n<br><pre><code>mesher:MergeNearby(workspace.Part)</code></pre>\r\n\r\n<hr> \r\n\r\n<code>Mesher:MergeParts(parts: { BasePart }, mergeProperties: MergeProperties)</code> <br>\r\nAttempt to merge provided parts with eachother. mergeProperties is optional\r\n\r\n<br>Example:\r\n<br><pre><code>mesher:MergeParts(workspace.Folder:GetChildren())</code></pre>\r\n\r\n<h1>Merge Properties</h1>\r\nmergeProperties can be provided as a parameter in dictionary format to define merge rules and filter <br>\r\nCurrently, there are 2 merge properties:\r\n<hr>\r\n<code>mergeProperties.BoundSize: Vector3</code> <br>\r\nChanges the size of collision bounds used to find parts to merge around a part, default is Vector3.new(0.001, 0.001, 0.001). Not recommendeded to be changed lest you know what you're doing\r\n<hr>\r\n<code>mergeProperties.Filter: function(part, touchPart, axis)</code> <br>\r\nDefines extra criteria(s) for merging. If the function returns false, parts will not be merged and vice versa. Can be used for cases such as restricting specific marked parts from being merged <br><br>\r\n\r\nExample:\r\n<pre><code>\r\nlocal disallowedName = \"NO_MERGE\"\r\nlocal mergeProperties = {\r\n\tFilter = function(part, touchPart, axis)\r\n\t\t-- don't allow merge to go through if this check passes\r\n\t\tif part.Name == disallowedName or touchPart.Name == disallowedName then\r\n\t\t\treturn false\r\n\t\tend\r\n\t\t\r\n\t\treturn true\r\n\tend,\r\n}\r\n\r\nmesher:MergeParts(workspace.Folder:GetChildren(), mergeProperties)\r\n</code></pre>\r\n","readmeTruncated":false}