Skip to content

SurfaceGrid3DMark

ClassChartGuruChartGuru.3D
public sealed class SurfaceGrid3DMark : ChartMark3D, IChart3DMark, IChart3DDataMark, IChartMark

Serializable sampled surface mark used by scene-authored data sources. Unlike SurfacePlotMark, this stores sampled points instead of a delegate so scene data survives reloads.

SurfaceGrid3DMark(IEnumerable, int, int, SurfaceStyle)

Section titled “SurfaceGrid3DMark(IEnumerable, int, int, SurfaceStyle)”
public SurfaceGrid3DMark(IEnumerable<DataPoint3D> samples, int resolutionX, int resolutionZ, SurfaceStyle style)

Creates a surface through a copy of samples, a regular grid of resolutionX by resolutionZ points (each clamped to 2 to 256) listed row by row with X varying fastest, colored by style. It draws nothing with fewer samples than the grid needs, and a sample with a NaN or infinite coordinate leaves a hole.

Parameters

NameType
samplesSystem.Collections.Generic.IEnumerable{ChartGuru.DataPoint3D}
resolutionXSystem.Int32
resolutionZSystem.Int32
styleChartGuru.SurfaceStyle

public SurfaceGrid3DMark YRange(float min, float max)

Sets the heights the height-based colors span without clipping geometry, like SurfacePlotMark.YRange(float, float) and Swift Charts’ .foregroundStyle(.heightBased(yRange:)). Without it the colors span the chart’s explicit Y domain when one is set, so a grid that streams new heights keeps its colors, and otherwise the heights it draws.

Parameters

NameType
minSystem.Single
maxSystem.Single

Returns

ChartGuru.SurfaceGrid3DMark

public override void BuildMesh(Chart3DMeshContext ctx)

Write triangles / instanced draws for this mark into the context registry.

Parameters

NameType
ctxChartGuru.Chart3DMeshContext
public override IChartMark Clone()

Creates an independent copy of this grid with its own copy of the samples, its resolution, surface style, color range and mark style; later changes to either mark do not affect the other.

Returns

ChartGuru.IChartMark

public IReadOnlyList<DataPoint3D> Samples { get; }

Returns

System.Collections.Generic.IReadOnlyList{ChartGuru.DataPoint3D}

public int ResolutionX { get; }

Returns

System.Int32

public int ResolutionZ { get; }

Returns

System.Int32

public SurfaceStyle Style { get; }

Returns

ChartGuru.SurfaceStyle

public Vector2? YRangeValue { get; }

The heights the height-based colors span, set by SurfaceGrid3DMark.YRange(float, float); null when unset.

Returns

System.Nullable{UnityEngine.Vector2}

public override ChartType MarkType { get; }

Returns

ChartGuru.ChartType