ZLab.Discrete ZLab.Discrete
ZLab.Discrete ZLab.Discrete
Developed by Zeke Zhang

Search Results for

    Edit this page

    Method GenerateMeshes

    | Edit this page View Source

    GenerateMeshes(ReadOnlySpan<Vector3>, ReadOnlySpan<Vector3>, Span<MeshF>, CordSystem)

    Generates an individual quad-mesh per voxel (no face merging across voxels).

    Declaration
    public static void GenerateMeshes(ReadOnlySpan<Vector3> origins, ReadOnlySpan<Vector3> voxelSizes, Span<MeshF> outMeshes, CordSystem cordSystem = CordSystem.RightHanded)
    Parameters
    Type Name Description
    ReadOnlySpan<Vector3> origins

    Voxel origins

    ReadOnlySpan<Vector3> voxelSizes

    Per-voxel sizes; must match origins length.

    Span<MeshF> outMeshes

    Pre-allocated output span to write meshes into; must match origins length.

    CordSystem cordSystem

    Coordinate system for winding (right- or left-handed).

    Remarks

    This variant avoids allocations by writing into a pre-allocated output Span<T>.

    Exceptions
    Type Condition
    ArgumentException

    Lengths of origins and voxelSizes differ.

    | Edit this page View Source

    GenerateMeshes(ReadOnlySpan<Vector3>, ReadOnlySpan<Vector3>, CordSystem)

    Generates an individual quad-mesh per voxel (no face merging across voxels).

    Declaration
    public static MeshF[] GenerateMeshes(ReadOnlySpan<Vector3> origins, ReadOnlySpan<Vector3> voxelSizes, CordSystem cordSystem = CordSystem.RightHanded)
    Parameters
    Type Name Description
    ReadOnlySpan<Vector3> origins

    Voxel origins

    ReadOnlySpan<Vector3> voxelSizes

    Per-voxel sizes; must match origins length.

    CordSystem cordSystem

    Coordinate system for winding (right- or left-handed).

    Returns
    Type Description
    MeshF[]

    Array of meshes, one per input voxel.

    Remarks

    Memory-heavy: each voxel becomes a standalone box mesh (24 verts, 12 tris).

    This variant allocates a new array for the output meshes.

    Exceptions
    Type Condition
    ArgumentException

    Lengths of origins and voxelSizes differ.

    | Edit this page View Source

    GenerateMeshes(ReadOnlySpan<Vector3>, Vector3, Span<MeshF>, CordSystem)

    Generates an individual quad-mesh per voxel (all voxels share the same voxelSize).

    Declaration
    public static void GenerateMeshes(ReadOnlySpan<Vector3> origins, Vector3 voxelSize, Span<MeshF> outMeshes, CordSystem cord = CordSystem.RightHanded)
    Parameters
    Type Name Description
    ReadOnlySpan<Vector3> origins

    Voxel origins

    Vector3 voxelSize

    Uniform voxel size for all voxels.

    Span<MeshF> outMeshes

    Pre-allocated output span to write meshes into; must match origins length.

    CordSystem cord

    Coordinate system for winding (right- or left-handed).

    Remarks

    This variant avoids allocations by writing into a pre-allocated output Span<T>.

    Exceptions
    Type Condition
    ArgumentException

    Output span is too small to hold all meshes.

    | Edit this page View Source

    GenerateMeshes(ReadOnlySpan<Vector3>, Vector3, CordSystem)

    Generates an individual quad-mesh per voxel (all voxels share the same voxelSize).

    Declaration
    public static MeshF[] GenerateMeshes(ReadOnlySpan<Vector3> origins, Vector3 voxelSize, CordSystem cordSystem = CordSystem.RightHanded)
    Parameters
    Type Name Description
    ReadOnlySpan<Vector3> origins

    Voxel origins

    Vector3 voxelSize

    Uniform voxel size for all voxels.

    CordSystem cordSystem

    Coordinate system for winding (right- or left-handed).

    Returns
    Type Description
    MeshF[]

    Array of meshes, one per input voxel.

    Remarks

    Memory-heavy: each voxel becomes a standalone box mesh (24 verts, 12 tris). This variant allocates a new array for the output meshes.