bounds

package
v0.9.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 16, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ManifestVersion1 = 1
	ManifestVersion2 = 2
)

Variables

This section is empty.

Functions

func Save

func Save(path string, manifest Manifest) error

Types

type AABB

type AABB struct {
	Center Vec3 `json:"center"`
	Size   Vec3 `json:"size"`
}

type ContactFrame added in v0.9.1

type ContactFrame struct {
	ID      string     `json:"id"`
	Point   Vec3       `json:"point"`
	Normal  Vec3       `json:"normal"`
	Tangent Vec3       `json:"tangent"`
	Size    [2]float64 `json:"size"`
}

type ContactRequirement added in v0.9.1

type ContactRequirement struct {
	ID                 string  `json:"id"`
	Kind               string  `json:"kind"`
	FrameID            string  `json:"frame_id"`
	Target             string  `json:"target"`
	MinimumGap         float64 `json:"minimum_gap"`
	MaximumGap         float64 `json:"maximum_gap"`
	MaximumPenetration float64 `json:"maximum_penetration"`
	MinimumSupport     float64 `json:"minimum_support"`
	DirectionAlignment float64 `json:"direction_alignment"`
}

ContactRequirement carries the reviewed physical policy associated with a named contact frame. Detailed scans do not invent these values; they are populated only when an approved spatial contract is overlaid.

type Manifest

type Manifest struct {
	Scene        string         `json:"scene"`
	Source       string         `json:"source"`
	Version      int            `json:"version"`
	Objects      []ObjectBounds `json:"objects"`
	Prefabs      []PrefabBounds `json:"prefabs"`
	Capabilities []string       `json:"capabilities,omitempty"`
	Surfaces     []SurfacePatch `json:"surfaces,omitempty"`
}

func Decode added in v0.9.1

func Decode(data []byte) (Manifest, error)

func Load

func Load(path string) (Manifest, error)

type OBB added in v0.9.1

type OBB struct {
	ID       string `json:"id"`
	Center   Vec3   `json:"center"`
	Size     Vec3   `json:"size"`
	Rotation Quat   `json:"rotation"`
}

type ObjectBounds

type ObjectBounds struct {
	FileID  int64           `json:"fileID"`
	Name    string          `json:"name"`
	Bounds  AABB            `json:"bounds"`
	Spatial *SpatialProfile `json:"spatial,omitempty"`
}

type PrefabBounds

type PrefabBounds struct {
	Path    string          `json:"path"`
	Bounds  AABB            `json:"bounds"`
	GUID    string          `json:"guid,omitempty"`
	Spatial *SpatialProfile `json:"spatial,omitempty"`
}

type Quat added in v0.9.1

type Quat [4]float64

type SpatialProfile added in v0.9.1

type SpatialProfile struct {
	OBBs        []OBB `json:"obbs"`
	Forward     Vec3  `json:"forward"`
	Up          Vec3  `json:"up"`
	PivotOffset Vec3  `json:"pivot_offset"`
	// Frames is the canonical collection for reviewed, arbitrarily named
	// contact frames. The three legacy fields remain readable/writable so v2
	// manifests produced before this collection was introduced keep working.
	Frames         []ContactFrame       `json:"frames,omitempty"`
	BottomContact  *ContactFrame        `json:"bottom_contact,omitempty"`
	BackContact    *ContactFrame        `json:"back_contact,omitempty"`
	TopContact     *ContactFrame        `json:"top_contact,omitempty"`
	Contacts       []ContactRequirement `json:"contacts,omitempty"`
	Source         string               `json:"source"`
	Confidence     float64              `json:"confidence"`
	Reviewed       bool                 `json:"reviewed"`
	DependencyHash string               `json:"dependency_hash,omitempty"`
}

type SurfacePatch added in v0.9.1

type SurfacePatch struct {
	ID        string     `json:"id"`
	Type      string     `json:"type"`
	Origin    Vec3       `json:"origin"`
	Normal    Vec3       `json:"normal"`
	Tangent   Vec3       `json:"tangent"`
	Size      [2]float64 `json:"size"`
	Reviewed  bool       `json:"reviewed"`
	Supported bool       `json:"supported"`
	Reason    string     `json:"reason,omitempty"`
}

type Vec3

type Vec3 [3]float64

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL