Service · inherits Instance
GeometryService
Service containing geometric operations.
About GeometryService
Service containing geometric operations not directly related to specific objects.
Methods 7
CalculateConstraintsToPreserve
(source: Instance, destination: Array, options: Dictionary = nil) → ArrayReturns a table ofConstraintsandAttachmentswhich you may choose to preserve, along with their respective parents.Returns a table of
ConstraintsandAttachmentswhich you may choose to preserve, along with their respective parents. Iterating over this table lets you decide whether to reparent recommended constraints and attachments to their respective parents.For more information and detailed examples, see https://create.roblox.com/docs/parts/solid-modeling#in-experience-solid-modeling.
FragmentAsync
(part: BasePart, sites: Array, options: Dictionary = nil) → ArrayYieldsBreaks aBasePartinto multipleMeshPartinstances, according to the pattern of points passed in, by using voronoi decomposition.Breaks a
BasePartinto multipleMeshPartinstances, according to the pattern of points passed in, by using voronoi decomposition.Terrainis not supported. Similar toClone(), the returned parts have no setParent.For more information and detailed examples, see https://create.roblox.com/docs/parts/solid-modeling#in-experience-solid-modeling.
GenerateFragmentSites
(part: BasePart, options: Dictionary = nil) → ArrayProvides an array of positions which can easily be passed intoFragmentAsyncto perform simple types of destruction.Provides an array of positions which can easily be passed into
FragmentAsync()to perform common types of destruction: Fragmenting an entireBasePartinto pieces, or a localized area of aBasePartinto pieces.The positions outputted are partially random, so the output should not be relied on to look exactly the same as the first time it is run with the same parameters.
For more information and detailed examples, see https://create.roblox.com/docs/parts/solid-modeling#in-experience-solid-modeling. Luau code to mimic this API has also been provided on that page, which can be freely modified if a slightly different effect is desired.
IntersectAsync
(part: Instance, parts: Array, options: Dictionary = nil) → ArrayYieldsCreates one or morePartOperationsorMeshPartsfrom the intersecting geometry of multiple parts.Creates one or more
PartOperationsorMeshPartsfrom the intersecting geometry of multiple parts. PrimitiveParts,PartOperations, andMeshPartsare supported as inputs, but notTerrain.Similarly to
Clone(), the returned parts have no setParent. In most cases, you should parent the results to the same place as the main part, thenDestroy()the original parts.This function replaces
BasePart.IntersectAsync. Go to that page for a description of the differences.For more information and detailed examples, see https://create.roblox.com/docs/parts/solid-modeling#in-experience-solid-modeling.
SubtractAsync
(part: Instance, parts: Array, options: Dictionary = nil) → ArrayYieldsCreates one or morePartOperationsorMeshPartsfrom one part minus the space occupied by other parts.Creates one or more
PartOperationsorMeshPartsconsisting of the space occupied by one part minus the space occupied by the other parts. PrimitiveParts,PartOperations, andMeshPartsare supported as inputs, but notTerrain.Similarly to
Clone(), the returned parts have no setParent. In most cases, you should parent the results to the same place as the main part, thenDestroy()the original parts.This function replaces
BasePart.SubtractAsync. Go to that page for a description of the differences.For more information and detailed examples, see https://create.roblox.com/docs/parts/solid-modeling#in-experience-solid-modeling.
SweepPartAsync
(part: BasePart, cframes: Array, options: Dictionary = nil) → MeshPartYieldsCreates aMeshPartwhich has the shape of the input part stretched/dragged through the given set ofCFramepositions.Creates a
MeshPartwhich has the shape of the input part stretched/dragged through the given set ofCFramepositions. The exact shape of the result is defined as the union of the convex hulls of each adjacent pair ofCFrames.If a single
CFrameis provided, the result will be a convex hull of the input part.For more information and detailed examples, see https://create.roblox.com/docs/parts/solid-modeling#in-experience-solid-modeling.
UnionAsync
(part: Instance, parts: Array, options: Dictionary = nil) → ArrayYieldsCreates one or morePartOperationsorMeshPartsfrom one part plus the space occupied by other parts.Creates one or more
PartOperationsorMeshPartsconsisting of the space occupied by one part plus the space occupied by the other parts. PrimitiveParts,PartOperations, andMeshPartsare supported as inputs, but notTerrain.Similarly to
Clone(), the returned parts have no setParent. In most cases, you should parent the results to the same place as the main part, thenDestroy()the original parts.This function replaces
BasePart.UnionAsync. Go to that page for a description of the differences.For more information and detailed examples, see https://create.roblox.com/docs/parts/solid-modeling#in-experience-solid-modeling.
GeometryService also has every member of Instance. Deprecated and Roblox-only members are hidden.
Reference text from the Roblox Creator Documentation, licensed CC BY 4.0, reorganized by rbxtoolshub.com · Studio 0.743.0.7431133.