Creates a box mesh from a length for the box's width, height, and depth,
and a radius for the corners.
- Parameters:
- size: The length of the box's width, height, and depth, in meters.
- cornerRadius: The radius of each corner's circular arc, in meters.
Values for `cornerRadius` can be, at most, equal to `size / 2.0`.
For example, if the box's dimensions are `5.0` x `5.0` x `5.0`,
the corner radius needs to be in the range `[0.0, 2.5]`.
The method centers the box at the entity’s origin and aligns the box's
faces with the coordinate system's axes.
> Note: The method clamps `cornerRadius` so that it doesn't exceed half
the length of the box's smallest dimension.
Creates a box mesh from a vector of three scalar values that represent
width, height, and depth, respectively, and a radius for the corners.
- Parameters:
- size: The length of the box's width, height, and depth, in meters,
along the x-, y-, and z-axis, respectively.
- cornerRadius: The radius of each corner's circular arc, in meters.
Values for `cornerRadius` can be, at most, equal to
`min(size.x, size.y, size.z) / 2.0`.
For example, if the box's dimensions are `3.0` x `4.0` x `5.0`,
the corner radius needs to be in the range `[0.0, 1.5]`.
The method centers the box at the entity’s origin and aligns the box's
faces with the coordinate system's axes.
> Note: The method clamps `cornerRadius` so that it doesn't exceed half
the length of the box's smallest dimension.
Creates a box mesh from a vector of three scalar values that represent
width, height, and depth, respectively, and radii for the corners.
- Parameters:
- size: The length of the box's width, height, and depth, in meters,
along the x-, y-, and z-axis, respectively.
- majorCornerRadius: The radius of each corner's circular arc,
in meters, orthogonal to the z-axis.
- minorCornerRadius: The radius of each corner's circular arc,
in meters, orthogonal to the x-axis.
The method centers the box at the entity’s origin and aligns the box's
faces with the coordinate system's axes.
Creates a box mesh from a width, height, depth,
a radius for the corners, and a Boolean option that splits faces.
- Parameters:
- width: The length of the box's width, in meters, along the x-axis.
- height: The length of the box's height, in meters, along the y-axis.
- depth: The length of the box's depth, in meters, along the z-axis.
- cornerRadius: The radius of each corner's circular arc, in meters.
Values for `cornerRadius` can be, at most, equal to the smallest
value of the `width`, `height`, and `depth` parameters.
For example, if the box's dimensions are `3.0` x `4.0` x `5.0`,
the corner radius needs to be in the range `[0.0, 1.5]`.
- splitFaces: A Boolean value that indicates whether you can assign up
to six separate materials, one for each face. If `false`, you can only
assign one material for all six faces.
The method centers the box at the entity’s origin and aligns the box's
faces with the coordinate system's axes.
> Note: The method clamps `cornerRadius` so that it doesn't exceed half
the length of the box's smallest dimension.
Creates a new cone mesh with the specified dimensions.
- Parameters:
- height: The height of the cone in meters [m].
- radius: The radius of the cone in meters [m].
The cone is centered at the local origin.
Replace the contents of this mesh resource asynchronously.
- Note: The contents of the modified mesh resource will not be synced between network clients.
Creates a new rectangle mesh with the specified dimensions in the
entity’s xz-plane.
The rectangle is centered at the entity’s origin and aligned with its x
and y axes. The surface normal points along the y-axis. The depth along
the y-axis is 0.
- Note: The xz-plane is a plane that aligns with the x and z axes.
- Parameters:
- width: The width, in meters, of the rectangle along the x-axis.
- depth: The depth, in meters, of the rectangle along the z-axis.
- cornerRadius: A corner radius in the form of a circular arc, with
curvature that transitions abruptly from `0` to `1/r` at the boundary
between the edge and the corner.
- Returns: The rectangle mesh.
Creates a new rectangle mesh with the specified dimensions in the
entity’s xy-plane.
The rectangle is centered at the entity’s origin and aligned with its x
and y axes. The surface normal points along the z-axis. The depth along
the z-axis is 0.
- Note: The xy-plane is a plane that aligns with the x and y axes.
- Parameters:
- width: The width, in meters, of the rectangle along the x-axis.
- height: The height, in meters, of the rectangle along the y-axis.
- cornerRadius: A corner radius in the form of a circular arc, with
curvature that transitions abruptly from `0` to `1/r` at the boundary
between the edge and the corner.
- Returns: The rectangle mesh.
Get the mesh part index for a given model and part identifier.
You can use this to resolve string names to part indices for use in ``MeshInstancesComponent``.
Creates a new sphere mesh with the specified radius.
The sphere is centered at the entity’s origin.
- Parameters:
- radius: The radius, in meters, of the sphere.
- Returns: A sphere mesh.
Creates a new cylinder mesh with the specified dimensions.
- Parameters:
- height: The height of the cylinder in meters [m].
- radius: The radius of the cylinder in meters [m].
The cylinder is centered at the local origin.
get · iOS 13.0+
expectedMaterialCount
TypeScript
get expectedMaterialCount(): Promise<number>
Swift declaration
@MainActor @preconcurrency var expectedMaterialCount: Int { get }
The number of material entries required to render the mesh resource.
Replace the contents of this mesh resource asynchronously.
- Note: The contents of the modified mesh resource will not be synced between network clients.
get · iOS 15.0+
contents
TypeScript
get contents(): Promise<MeshResource_Contents>
Swift declaration
@MainActor @preconcurrency var contents: MeshResource.Contents { get }
Synchronously generates a 3D mesh from a string,
with options for text layout and custom extrusions.
You can use the method to make a 3D mesh of a string,
control the text's layout, chamfers, materials,
and how to extrude the shape into 3D.
The generated text is scaled at a ratio of 72 points per meter.

- Parameters:
- string: A string that contains text for the 3D mesh geometry.
- textOptions: A configuration for rendering the text in 2D, before extrusion.
- extrusionOptions: A configuration for extruding the text in 3D.
Asynchronously generates a 3D mesh from a string,
with options for text layout and custom extrusions.
You can use the method to make a 3D mesh of a string,
control the text's layout, chamfers, materials,
and how to extrude the shape into 3D.
The generated text is scaled at a ratio of 72 points per meter.

- Parameters:
- string: A string that contains text for the 3D mesh geometry.
- textOptions: A configuration for rendering the text in 2D, before extrusion.
- extrusionOptions: A configuration for extruding the text in 3D.