@val-rbxts/procedural-mesh
v0.1.3
Published
Composable runtime mesh, geometry, animation, and physics utilities for roblox-ts.
Downloads
78
Readme
@val-rbxts/procedural-mesh
@val-rbxts/procedural-mesh is a collection of focused runtime utilities for roblox-ts. It provides reusable building blocks for editable meshes, procedural geometry, deformation, animation, raycast-based movement, avatars, and networking without tying them to a particular game or effect.
The package is intentionally modular: import the services you need, keep feature state in your own code, and compose the lower-level tools into project-specific systems.
Installation
npm install @val-rbxts/procedural-meshThis package targets roblox-ts 3.x. Features built on EditableMesh also require the relevant Roblox asset permissions and must run in an environment where the EditableMesh APIs are available.
Quick start
import { Workspace } from "@rbxts/services";
import { EditableMeshService, EditableMeshTopologyService } from "@val-rbxts/procedural-mesh";
const meshes = new EditableMeshService();
const topology = new EditableMeshTopologyService(meshes);
const sphere = topology.CreateUvSphere({
latitudeSegments: 12,
longitudeSegments: 18,
});
sphere.part.Name = "RuntimeSphere";
sphere.part.Parent = Workspace;The returned EditableMesh remains available through sphere.mesh, allowing the same geometry to be updated after its MeshPart has been created.
Modules
| Area | Exports | Purpose |
| --- | --- | --- |
| Animation | OscillationService | Produces reusable position, rotation, and scale motion from configurable profiles. |
| Avatar | AvatarCloneService | Clones characters and copies pose information for temporary runtime visuals. |
| Deformation | DirectionalDeformationService | Calculates and applies direction-based vertex deformation. |
| Editable mesh | EditableMeshService | Bridges reusable mesh code to Roblox allocation, content loading, and MeshPart creation. |
| Mesh topology | EditableMeshTopologyService | Builds indexed meshes, UV spheres, and seam-safe UV hemispheres. |
| Geometry | GeometryUtils, HemisphereProjectionService | Provides bounds, surface frames, and hemisphere projection helpers. |
| Math | MathUtils, RandomUtils | Contains interpolation, easing, vector, ballistic, and random-direction helpers. |
| Physics | KinematicBodyService, KinematicSphereService | Simulates simple raycast-based movement without owning the caller's game loop. |
| Networking | RemoteService | Creates and retrieves typed Roblox remotes from a shared container. |
All public modules are exported from the package root:
import { KinematicBodyService, randomUnitDirection } from "@val-rbxts/procedural-mesh";Design notes
- The package contains no project-specific feature behavior.
- Services do not create project-specific remotes, configuration, input bindings, or sound effects.
- Callers keep access of the lifecycle of returned Roblox instances, including generated
EditableMeshandMeshPartinstances. - Roblox may reject direct mesh-content reads when the experience does not have permission to access the source asset. The safe
TryCreate...methods returnundefinedwhen allocation or permissions fail.
Local development
Install the repository dependencies from the repository root, then run these commands from packages/procedural-mesh:
npm run build
npm run pack:checknpm run build compiles only src/shared/framework and writes Luau and TypeScript declarations to this package's out directory. npm run pack:check shows the exact contents npm would publish without uploading anything.
License
Licensed under the MIT License.
