Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,28 @@
namespace WorldLabs
{
/// <summary>
/// Semantic metadata for world generation output.
/// Semantic metadata describing how to interpret the generated splat<br/>
/// asset in real-world units. The exported asset is in arbitrary model<br/>
/// units; apply the transform below to convert to a metric, ground-aligned<br/>
/// frame:<br/>
/// metric_xyz = raw_xyz * metric_scale_factor<br/>
/// aligned_xyz = metric_xyz - (0, ground_plane_offset, 0)
/// </summary>
public sealed partial class WorldSemanticsMetadata
{
/// <summary>
///
/// Vertical (Y-axis) offset, in meters, of the detected ground plane<br/>
/// in the metric-scaled frame. Subtract from Y after applying<br/>
/// `metric_scale_factor` to place the ground at y=0.
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("ground_plane_offset")]
public double? GroundPlaneOffset { get; set; }

/// <summary>
///
/// Multiplicative factor that converts raw asset coordinates to<br/>
/// meters. Multiply all XYZ positions (and isotropic scales) by this<br/>
/// value. A value of 1.0 means scale could not be inferred and the<br/>
/// asset was left in model units.
/// </summary>
[global::System.Text.Json.Serialization.JsonPropertyName("metric_scale_factor")]
public double? MetricScaleFactor { get; set; }
Expand All @@ -29,8 +39,17 @@ public sealed partial class WorldSemanticsMetadata
/// <summary>
/// Initializes a new instance of the <see cref="WorldSemanticsMetadata" /> class.
/// </summary>
/// <param name="groundPlaneOffset"></param>
/// <param name="metricScaleFactor"></param>
/// <param name="groundPlaneOffset">
/// Vertical (Y-axis) offset, in meters, of the detected ground plane<br/>
/// in the metric-scaled frame. Subtract from Y after applying<br/>
/// `metric_scale_factor` to place the ground at y=0.
/// </param>
/// <param name="metricScaleFactor">
/// Multiplicative factor that converts raw asset coordinates to<br/>
/// meters. Multiply all XYZ positions (and isotropic scales) by this<br/>
/// value. A value of 1.0 means scale could not be inferred and the<br/>
/// asset was left in model units.
/// </param>
#if NET7_0_OR_GREATER
[global::System.Diagnostics.CodeAnalysis.SetsRequiredMembers]
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
namespace WorldLabs
{
/// <summary>
///
/// Vertical (Y-axis) offset, in meters, of the detected ground plane<br/>
/// in the metric-scaled frame. Subtract from Y after applying<br/>
/// `metric_scale_factor` to place the ground at y=0.
/// </summary>
public sealed partial class WorldSemanticsMetadataGroundPlaneOffset
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
namespace WorldLabs
{
/// <summary>
///
/// Multiplicative factor that converts raw asset coordinates to<br/>
/// meters. Multiply all XYZ positions (and isotropic scales) by this<br/>
/// value. A value of 1.0 means scale could not be inferred and the<br/>
/// asset was left in model units.
/// </summary>
public sealed partial class WorldSemanticsMetadataMetricScaleFactor
{
Expand Down
18 changes: 17 additions & 1 deletion src/libs/WorldLabs/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1176,18 +1176,34 @@ components:
title: WorldAssets
type: object
WorldSemanticsMetadata:
description: Semantic metadata for world generation output.
description: |
Semantic metadata describing how to interpret the generated splat
asset in real-world units. The exported asset is in arbitrary model
units; apply the transform below to convert to a metric, ground-aligned
frame:

metric_xyz = raw_xyz * metric_scale_factor
aligned_xyz = metric_xyz - (0, ground_plane_offset, 0)
properties:
ground_plane_offset:
anyOf:
- type: number
- type: 'null'
title: Ground Plane Offset
description: |
Vertical (Y-axis) offset, in meters, of the detected ground plane
in the metric-scaled frame. Subtract from Y after applying
`metric_scale_factor` to place the ground at y=0.
metric_scale_factor:
anyOf:
- type: number
- type: 'null'
title: Metric Scale Factor
description: |
Multiplicative factor that converts raw asset coordinates to
meters. Multiply all XYZ positions (and isotropic scales) by this
value. A value of 1.0 means scale could not be inferred and the
asset was left in model units.
title: WorldSemanticsMetadata
type: object
WorldTextPrompt-Input:
Expand Down