Logo Hywe

Hexel Module

Hexel (Hygrid Engine) Implements the base coordinate system and logic for the Hygrid Woven Ensemble. Acts as the fundamental unit (Hexel) in the architectural hierarchy: Hexel-Coxel-Xyxel-Zaxel.

Types

Type Description

Hxl

Hexel types: Categorization based on location availabity.

Point

Sqn

Sequence specifies the orientation of hexels, the direction of flow of adjacent hexels and the position of the first of the six adjaent hexels.

Functions and values

Function or value Description

adjacent sqn hxo

Full Usage: adjacent sqn hxo

Parameters:
Returns: Hxl array

Computes the 7 neighboring hexel cells centered on the host hexel, ordered by sequence heading and chirality.

sqn : Sqn
hxo : Hxl
Returns: Hxl array
Example

 let neighbors = Hexel.adjacent Hexel.Sqn.VRCWEE (Hexel.Hxl.AV(0, 0, 0))
val neighbors: obj

available sqn elv hxo occ

Full Usage: available sqn elv hxo occ

Parameters:
    sqn : Sqn
    elv : int
    hxo : obj
    occ : Hxl[]

Returns: int

Counts free neighbor cells around a candidate hexel given an array of occupied obstacle cells.

sqn : Sqn
elv : int
hxo : obj
occ : Hxl[]
Returns: int
Example

 let freeCount = Hexel.available Hexel.Sqn.VRCWEE 0 (Hexel.Hxl.AV(0, 0, 0)) [||]
val freeCount: obj

availableSet sqn elv hxo occ

Full Usage: availableSet sqn elv hxo occ

Parameters:
Returns: int

High-performance O(1) variant of available using a HashSet of occupied cells.

sqn : Sqn
elv : int
hxo : Hxl
occ : HashSet<Hxl>
Returns: int
Example

 let occSet = Hexel.hxlSet [| Hexel.Hxl.AV(2, 0, 0) |]
 let freeCount = Hexel.availableSet Hexel.Sqn.VRCWEE 0 (Hexel.Hxl.AV(0, 0, 0)) occSet
val occSet: obj
val freeCount: obj

bndSqn sqn elv hxo

Full Usage: bndSqn sqn elv hxo

Parameters:
    sqn : Sqn
    elv : int
    hxo : Hxl[]

Returns: Hxl array

Traces and returns the ordered continuous outer boundary perimeter hexels of a cluster.

sqn : Sqn
elv : int
hxo : Hxl[]
Returns: Hxl array
Example

 let boundary = Hexel.bndSqn Hexel.Sqn.VRCWEE 0 [| Hexel.Hxl.AV(0, 0, 0); Hexel.Hxl.AV(2, 0, 0) |]
val boundary: obj

cntSqn sqn elv hxo

Full Usage: cntSqn sqn elv hxo

Parameters:
    sqn : Sqn
    elv : int
    hxo : Hxl[]

Returns: Hxl[]

Sorts a collection of hexels into a continuous sequence path.

sqn : Sqn
elv : int
hxo : Hxl[]
Returns: Hxl[]
Example

 let path = Hexel.cntSqn Hexel.Sqn.VRCWEE 0 [| Hexel.Hxl.AV(0, 0, 0); Hexel.Hxl.AV(2, 0, 0) |]
val path: obj

getHxls hxo

Full Usage: getHxls hxo

Parameters:
    hxo : (Hxl * int)[]

Returns: Hxl array

Extracts the underlying Hxl array from an array of weighted (Hxl * int) tuples.

hxo : (Hxl * int)[]
Returns: Hxl array
Example

 let hexels = Hexel.getHxls [| (Hexel.Hxl.AV(0, 0, 0), 10); (Hexel.Hxl.AV(2, 0, 0), 5) |]
val hexels: obj

hxlChk sqn elv occ hxl

Full Usage: hxlChk sqn elv occ hxl

Parameters:
    sqn : Sqn - Traversal sequence.
    elv : int - Elevation layer.
    occ : Hxl[] - Occupied obstacle hexels.
    hxl : Hxl[] - Hexels to classify.

Returns: Hxl array Classified array of hexels.

Classifies candidate hexels against an occupied obstacle array into available (AV) or reserved (RV) state.

sqn : Sqn

Traversal sequence.

elv : int

Elevation layer.

occ : Hxl[]

Occupied obstacle hexels.

hxl : Hxl[]

Hexels to classify.

Returns: Hxl array

Classified array of hexels.

Example

 let classified = Hexel.hxlChk Hexel.Sqn.VRCWEE 0 [| Hexel.Hxl.AV(0, 0, 0) |] [| Hexel.Hxl.AV(2, 0, 0) |]
val classified: obj

hxlChkSet sqn elv occSet hxl

Full Usage: hxlChkSet sqn elv occSet hxl

Parameters:
    sqn : Sqn - Traversal sequence.
    elv : int - Elevation layer.
    occSet : HashSet<Hxl> - HashSet of occupied hexels.
    hxl : Hxl[] - Candidate hexels to classify.

Returns: Hxl array Classified array of hexels.

Classifies an array of hexels into available (AV) or boundary/reserved (RV) status using a HashSet for high performance.

sqn : Sqn

Traversal sequence.

elv : int

Elevation layer.

occSet : HashSet<Hxl>

HashSet of occupied hexels.

hxl : Hxl[]

Candidate hexels to classify.

Returns: Hxl array

Classified array of hexels.

Example

 let occSet = Hexel.hxlSet [| Hexel.Hxl.AV(0, 0, 0) |]
 let checkedCells = Hexel.hxlChkSet Hexel.Sqn.VRCWEE 0 occSet [| Hexel.Hxl.AV(0, 0, 0); Hexel.Hxl.AV(2, 0, 0) |]
val occSet: obj
val checkedCells: obj

hxlCrd h

Full Usage: hxlCrd h

Parameters:
Returns: int * int * int
Modifiers: inline

Deconstructs any Hxl instance and returns its raw (x, y, z) integer coordinate triple.

h : Hxl
Returns: int * int * int
Example

 let (x, y, z) = Hexel.hxlCrd (Hexel.Hxl.AV(2, 4, 0))
val x: obj
val y: obj
val z: obj

hxlFil sqn elv hxl

Full Usage: hxlFil sqn elv hxl

Parameters:
    sqn : Sqn - Traversal sequence.
    elv : int - Elevation layer.
    hxl : Hxl[] - Cluster of hexels.

Returns: Hxl array Hexel array with internal bridge gaps filled.

Detects and fills internal cavities or voids trapped within an enclosed cluster of hexels.

sqn : Sqn

Traversal sequence.

elv : int

Elevation layer.

hxl : Hxl[]

Cluster of hexels.

Returns: Hxl array

Hexel array with internal bridge gaps filled.

Example

 let filled = Hexel.hxlFil Hexel.Sqn.VRCWEE 0 [| Hexel.Hxl.AV(0, 0, 0); Hexel.Hxl.AV(4, 0, 0) |]
val filled: obj

hxlOfs sqn elv hxl

Full Usage: hxlOfs sqn elv hxl

Parameters:
    sqn : Sqn
    elv : int
    hxl : Hxl[]

Returns: Hxl[]

Calculates a single-ring exterior offset/buffer surrounding a collection of hexels.

sqn : Sqn
elv : int
hxl : Hxl[]
Returns: Hxl[]
Example

 let buffer = Hexel.hxlOfs Hexel.Sqn.VRCWEE 0 [| Hexel.Hxl.AV(0, 0, 0) |]
val buffer: obj

hxlRst org hxl

Full Usage: hxlRst org hxl

Parameters:
Returns: Hxl array

Filters original hexels, retaining only those whose coordinates match any in the target array.

org : Hxl[]
hxl : Hxl[]
Returns: Hxl array
Example

 let filtered = Hexel.hxlRst originalHexels candidateHexels
val filtered: obj

hxlSet hxls

Full Usage: hxlSet hxls

Parameters:
    hxls : Hxl seq

Returns: HashSet<Hxl>

Creates a System.Collections.Generic.HashSet of AV hexels for high-performance O(1) membership lookups.

hxls : Hxl seq
Returns: HashSet<Hxl>
Example

 let occSet = Hexel.hxlSet [| Hexel.Hxl.AV(0, 0, 0); Hexel.Hxl.AV(2, 0, 0) |]
 let isOccupied = occSet.Contains(Hexel.Hxl.AV(0, 0, 0)) // true
val occSet: obj
val isOccupied: obj

hxlUni opt hxl

Full Usage: hxlUni opt hxl

Parameters:
    opt : int
    hxl : Hxl[]

Returns: Hxl array

Change all hexel types in an array to a uniform occupancy state (1 = AV, 2 = RV, 3 = EX).

opt : int
hxl : Hxl[]
Returns: Hxl array
Example

 let occupiedCells = Hexel.hxlUni 2 [| Hexel.Hxl.AV(0, 0, 0); Hexel.Hxl.AV(2, 0, 0) |]
val occupiedCells: obj

hxlVld sqn hxl

Full Usage: hxlVld sqn hxl

Parameters:
Returns: Hxl

Validates and snaps an arbitrary coordinate to the nearest legal discrete lattice cell based on modulo parity rules.

sqn : Sqn
hxl : Hxl
Returns: Hxl
Example

 let snapped = Hexel.hxlVld Hexel.Sqn.VRCWEE (Hexel.Hxl.AV(1, 1, 0))
val snapped: obj

identity elv

Full Usage: identity elv

Parameters:
    elv : int

Returns: Hxl

Returns the lattice origin anchor cell at the specified elevation: RV(0, 0, elv).

elv : int
Returns: Hxl
Example

 let origin = Hexel.identity 0 // RV(0, 0, 0)
val origin: obj

increment sqn elv (arg3, arg3) occ

Full Usage: increment sqn elv (arg3, arg3) occ

Parameters:
    sqn : Sqn
    elv : int
    arg2 : Hxl
    arg3 : int
    occ : Hxl[]

Returns: Hxl * int

Computes the next optimal expansion hexel for a growing spatial cluster while avoiding obstacles.

sqn : Sqn
elv : int
arg2 : Hxl
arg3 : int
occ : Hxl[]
Returns: Hxl * int
Example

 let next = Hexel.increment Hexel.Sqn.VRCWEE 0 (Hexel.Hxl.AV(0, 0, 0), 1) [||]
val next: obj

incrementSet sqn elv (arg3, arg3) occ

Full Usage: incrementSet sqn elv (arg3, arg3) occ

Parameters:
    sqn : Sqn - Traversal sequence.
    elv : int - Elevation layer.
    arg2 : Hxl
    arg3 : int
    occ : HashSet<Hxl> - HashSet of currently occupied obstacle hexels.

Returns: Hxl * int Option containing next candidate hexel and weight, or invalid hexel tuple if blocked.

Computes the next optimal expansion hexel for a spatial cluster using a HashSet for high-performance O(1) occupancy checks.

sqn : Sqn

Traversal sequence.

elv : int

Elevation layer.

arg2 : Hxl
arg3 : int
occ : HashSet<Hxl>

HashSet of currently occupied obstacle hexels.

Returns: Hxl * int

Option containing next candidate hexel and weight, or invalid hexel tuple if blocked.

Example

 let occSet = Hexel.hxlSet [| Hexel.Hxl.AV(0, 0, 0) |]
 let next = Hexel.incrementSet Hexel.Sqn.VRCWEE 0 (Hexel.Hxl.AV(0, 0, 0), 1) occSet
val occSet: obj
val next: obj

increments sqn elv hxo occ

Full Usage: increments sqn elv hxo occ

Parameters:
    sqn : Sqn
    elv : int
    hxo : (Hxl * int)[]
    occ : Hxl[]

Returns: (Hxl * int) array

Advances multiple active cluster seeds simultaneously while preventing mutual collision.

sqn : Sqn
elv : int
hxo : (Hxl * int)[]
occ : Hxl[]
Returns: (Hxl * int) array
Example

 let activeSeeds = [| (Hexel.Hxl.AV(0, 0, 0), 10); (Hexel.Hxl.AV(8, 0, 0), 5) |]
 let nextSeeds = Hexel.increments Hexel.Sqn.VRCWEE 0 activeSeeds [||]
val activeSeeds: (obj * int) array
val nextSeeds: obj

incrementsSet sqn elv hxo occSet

Full Usage: incrementsSet sqn elv hxo occSet

Parameters:
    sqn : Sqn - Traversal sequence.
    elv : int - Elevation layer.
    hxo : (Hxl * int)[] - Array of active (seed hexel, weight) tuples.
    occSet : HashSet<Hxl> - HashSet of occupied cells.

Returns: (Hxl * int) array Array of next (hexel, weight) steps for each seed.

Advances multiple active cluster seeds simultaneously using a HashSet for high performance.

sqn : Sqn

Traversal sequence.

elv : int

Elevation layer.

hxo : (Hxl * int)[]

Array of active (seed hexel, weight) tuples.

occSet : HashSet<Hxl>

HashSet of occupied cells.

Returns: (Hxl * int) array

Array of next (hexel, weight) steps for each seed.

Example

 let occSet = Hexel.hxlSet [| Hexel.Hxl.AV(0, 0, 0) |]
 let active = [| (Hexel.Hxl.AV(0, 0, 0), 4); (Hexel.Hxl.AV(8, 0, 0), 2) |]
 let advanced = Hexel.incrementsSet Hexel.Sqn.VRCWEE 0 active occSet
val occSet: obj
val active: (obj * int) array
val advanced: obj

sequence sqn

Full Usage: sequence sqn

Parameters:
    sqn : Sqn - Traversal sequence.

Returns: (int * int)[] Array of 7 (dx, dy) integer coordinate offset pairs.

Sequence Locations: Relative (dx, dy) coordinate offsets of adjacent/neighbouring hexels relative to the host hexel. Index 0 is always the host origin (0, 0), followed by 6 neighboring offsets ordered by sequence heading and chirality.

sqn : Sqn

Traversal sequence.

Returns: (int * int)[]

Array of 7 (dx, dy) integer coordinate offset pairs.

Example

 let offsets = Hexel.sequence Hexel.Sqn.VRCWEE
val offsets: obj

sqnArray

Full Usage: sqnArray

Returns: Sqn[]
Returns: Sqn[]

sqnToString sqn

Full Usage: sqnToString sqn

Parameters:
    sqn : Sqn - Sequence union case.

Returns: string String name of the sequence.

Converts a Sqn sequence union case to its canonical string representation (e.g. "VRCWEE").

sqn : Sqn

Sequence union case.

Returns: string

String name of the sequence.

Example

 let name = Hexel.sqnToString Hexel.Sqn.VRCWEE // "VRCWEE"
val name: obj

toBase34 value

Full Usage: toBase34 value

Parameters:
    value : int64

Returns: string

Converts an integer coordinate or index to HYWE's compact Base34 string representation (excludes 'I' and 'O').

value : int64
Returns: string
Example

 let b34 = Hexel.toBase34 35L // "11"
val b34: obj

Active patterns

Active pattern Description

(|Vertical|Horizontal|) sqn

Full Usage: (|Vertical|Horizontal|) sqn

Parameters:
Returns: Choice<unit, unit>
sqn : Sqn
Returns: Choice<unit, unit>

Type something to start searching.