Logo Hywe

Coxel Module

Coxel (Collection of Hexels) Defines the primary building blocks of the Hygrid Woven Ensemble. Orchestrates spatial configurations as the second stage in the hierarchy: Hexel-Coxel-Xyxel-Zaxel.

Types

Type Description

Cxl

Coxel type consists of hexels and properties.

Prp

Coxels are primarily a collections of unique hexels Coxel type properties

Functions and values

Function or value Description

coxel sqn elv ini occ

Full Usage: coxel sqn elv ini occ

Parameters:
Returns: Cxl array

The primary deterministic spatial clustering engine. Concurrently grows multiple room clusters from their respective seed bases up to their target capacities while avoiding collisions and obstacles.

sqn : Sqn
elv : int
ini : (Hxl * Prp * Prp * Prp)[]
occ : Hxl[]
Returns: Cxl array
Example

 let livingBase = Hexel.Hxl.AV(0, 0, 0) |> Hexel.hxlVld Hexel.Sqn.VRCWEE
 let program = [| (livingBase, Coxel.Refid "1.0", Coxel.Count 15, Coxel.Label "Living") |]
 let rooms = Coxel.coxel Hexel.Sqn.VRCWEE 0 program [||]
val livingBase: obj
val program: (obj * obj * obj * obj) array
val rooms: obj

coxelChildren sqn elv bsCx tre occ

Full Usage: coxelChildren sqn elv bsCx tre occ

Parameters:
    sqn : Sqn - Traversal sequence.
    elv : int - Elevation layer.
    bsCx : Cxl - Parent host Coxel.
    tre : (Prp * Prp * Prp)[] - Array of (RefId, Count, Label) specifications for the branch.
    occ : Hxl[] - Already occupied hexels.

Returns: Cxl * Cxl array * Hxl array Updated parent Coxel, generated child Coxels, and updated occupied hexels.

Generates child Coxels hierarchically grown around a parent Coxel host according to a branch specification.

sqn : Sqn

Traversal sequence.

elv : int

Elevation layer.

bsCx : Cxl

Parent host Coxel.

tre : (Prp * Prp * Prp)[]

Array of (RefId, Count, Label) specifications for the branch.

occ : Hxl[]

Already occupied hexels.

Returns: Cxl * Cxl array * Hxl array

Updated parent Coxel, generated child Coxels, and updated occupied hexels.

Example

 let branch = [| (Refid "1", Count 4, Label "Living"); (Refid "1.1", Count 2, Label "Balcony") |]
 let updatedParent, children, newOcc = Coxel.coxelChildren Hexel.Sqn.VRCWEE 0 parentCxl branch occ
val branch: (obj * obj * obj) array
val updatedParent: obj
val children: obj
val newOcc: obj

createBaseCoxel sqn elv bsAtr entryFallback id ct lb occ bsHxSetOverride

Full Usage: createBaseCoxel sqn elv bsAtr entryFallback id ct lb occ bsHxSetOverride

Parameters:
    sqn : Sqn - Traversal sequence.
    elv : int - Elevation layer.
    bsAtr : string - Base coordinate string (e.g. "0" or "10,20").
    entryFallback : Hxl - Fallback coordinate hexel if bsAtr is "0".
    id : Prp - Property identifier for the root.
    ct : Prp - Property count / cell capacity.
    lb : Prp - Property label.
    occ : Hxl[] - Already occupied hexels.
    bsHxSetOverride : Cxl option - Optional parent Coxel to inherit footprint from.

Returns: Cxl * Hxl array Tuple of the constructed root Coxel and the updated occupied hexel array.

Creates the base/root Coxel for a layout, either initialized from entry point coordinates or inherited from a parent Coxel.

sqn : Sqn

Traversal sequence.

elv : int

Elevation layer.

bsAtr : string

Base coordinate string (e.g. "0" or "10,20").

entryFallback : Hxl

Fallback coordinate hexel if bsAtr is "0".

id : Prp

Property identifier for the root.

ct : Prp

Property count / cell capacity.

lb : Prp

Property label.

occ : Hxl[]

Already occupied hexels.

bsHxSetOverride : Cxl option

Optional parent Coxel to inherit footprint from.

Returns: Cxl * Hxl array

Tuple of the constructed root Coxel and the updated occupied hexel array.

Example

 let rootCxl, occ =
     Coxel.createBaseCoxel
         Hexel.Sqn.VRCWEE
         0
         "0"
         (Hexel.identity 0)
         (Refid "1")
         (Count 6)
         (Label "Hall")
         [||]
         None
val rootCxl: obj
val occ: obj
union case Option.None: Option<'T>

cxlAdj cxls

Full Usage: cxlAdj cxls

Parameters:
Returns: string[] * bool array[]

Computes the topological spatial adjacency matrix across all room clusters, determining which spaces share common boundary walls.

cxls : Cxl[]
Returns: string[] * bool array[]
Example

 let names, adjacencyMatrix = Coxel.cxlAdj rooms
val names: obj
val adjacencyMatrix: obj

cxlCnt cxl

Full Usage: cxlCnt cxl

Parameters:
Returns: int * int

Computes the geometric centroid cell coordinate (x, y) of a room cluster, finding the nearest member hexel to the true mathematical center.

cxl : Cxl
Returns: int * int
Example

 let (cx, cy) = Coxel.cxlCnt room
val cx: obj
val cy: obj

cxlExp cxl sqn elv

Full Usage: cxlExp cxl sqn elv

Parameters:
    cxl : Cxl[]
    sqn : Sqn
    elv : int

Returns: int array

Calculates the number of exposed, unblocked perimeter hexels for each room in an array of Coxels.

cxl : Cxl[]
sqn : Sqn
elv : int
Returns: int array
Example

 let exposures = Coxel.cxlExp rooms Hexel.Sqn.VRCWEE 0
val exposures: obj

cxlHxl cxl elv

Full Usage: cxlHxl cxl elv

Parameters:
    cxl : Cxl
    elv : int

Returns: (type)

Categorizes and extracts all constituent cells of a Coxel into structural zones (Core, Periphery, Border, Available).

cxl : Cxl
elv : int
Returns: (type)
Example

 let breakdown = Coxel.cxlHxl room 0
val breakdown: obj

cxlPrm cxl elv

Full Usage: cxlPrm cxl elv

Parameters:
    cxl : Cxl
    elv : int

Returns: (int * int) array

Computes the continuous 2D perimeter boundary coordinates along the outer edge of a room cluster.

cxl : Cxl
elv : int
Returns: (int * int) array
Example

 let perimeterCoords = Coxel.cxlPrm room 0
val perimeterCoords: obj

getBaseCoordString cxl

Full Usage: getBaseCoordString cxl

Parameters:
Returns: string

Serializes only the anchor base coordinate of a Coxel into a single Base34 coordinate pair (e.g. "0.0").

cxl : Cxl
Returns: string
Example

 let baseStr = Coxel.getBaseCoordString room
val baseStr: obj

getCxlCoordsString cxl

Full Usage: getCxlCoordsString cxl

Parameters:
Returns: string

Serializes all cell coordinates of a Coxel into space-separated Base34 coordinate pairs (e.g. "0.0 2.0 1.-2").

cxl : Cxl
Returns: string
Example

 let coordsStr = Coxel.getCxlCoordsString room
val coordsStr: obj

prpVlu _arg1

Full Usage: prpVlu _arg1

Parameters:
Returns: string

Extracts the string value from any Coxel property (Prp) tag (Label, Refid, or Count).

_arg1 : Prp
Returns: string
Example

 let label = Coxel.prpVlu (Coxel.Label "Lobby") // "Lobby"
 let count = Coxel.prpVlu (Coxel.Count 15)      // "15"
val label: obj
val count: obj

Active patterns

Active pattern Description

(|Collinear|Turning|) (p1, p2, p3)

Full Usage: (|Collinear|Turning|) (p1, p2, p3)

Parameters:
    p1 : int * int
    p2 : int * int
    p3 : int * int

Returns: Choice<unit, unit>

Coxel Offseted Boundary Wrap

p1 : int * int
p2 : int * int
p3 : int * int
Returns: Choice<unit, unit>

Type something to start searching.