Structural Analysis of Woven Textile Drafts from WIF Files

Imports weaving drafts stored in the Weaving Information File (WIF) interchange format, reconstructs the binary warp and weft drawdown from either a liftplan or a tie-up with treadling, and computes structural descriptors of the cloth: float length distributions, interlacement frequency, weave repeat size, a directional float ratio, and thread colour sequences. A flat-colour simulation of the fabric face helps to separate patterns carried by the interlacement structure from patterns carried by the thread colours. Intended for computational analysis and documentation of handloom and other multi-shaft textiles.


weaveDraft

Structural analysis of woven textile drafts stored as WIF (Weaving Information File) files, the interchange format used by WeavePoint, Fiberworks, ArahWeave and most other weaving software.

weaveDraft rebuilds the binary warp/weft drawdown from a draft (liftplan or tie-up + treadling), then measures it: float lengths, interlacement frequency, repeat size, a directional float ratio, and thread colour sequences. A flat-colour fabric simulation separates patterns carried by the structure from patterns carried by the colours.

Install (from source folder)

install.packages("devtools")
devtools::install("path/to/weaveDraft")
# or, from a built tarball:
install.packages("weaveDraft_0.1.0.tar.gz", repos = NULL, type = "source")

Use

library(weaveDraft)

d <- weave_draft_from_wif("my_draft.wif")
plot(d)                       # drawdown
plot(d, type = "fabric")      # colour simulation (needs a colour table)
weave_metrics(d)              # one-row summary
color_runs(d, "warp")         # colour sequence along the warp
check_wif_consistency(read_wif("my_draft.wif"))

Functions

Function Purpose
read_wif() Parse a WIF file
weave_draft_from_wif() WIF -> weave_draft object
as_weave_draft() Wrap any 0/1 matrix
compute_drawdown(), compute_drawdown_liftplan() Rebuild a drawdown from loom data
float_lengths(), mean_float_length(), max_float_length() Float statistics
interlacement_frequency() Adjacent-state transition fraction (1 = plain weave)
weave_repeat() Smallest repeating unit
directional_float_ratio() Warp/weft float balance
weave_metrics() All of the above in one row
color_runs() Thread colour sequence
check_wif_consistency() Do liftplan and tie-up/treadling agree?

Notes and limits

  • Floats are counted inside the drawing; no wrap-around at the edges.
  • directional_float_ratio() and friends describe the drawing, not a measured mechanical property of a woven cloth.
  • The fabric view is flat colour: no yarn thickness, spacing or texture.
  • The bundled examples are synthetic. Do not commit WIF files of designs you do not have the right to publish (community, institutional or IP-registered designs) to a public repository.

Citation

Run citation("weaveDraft") once the package is installed.

Interpretation and supported inputs

Rows are picks and columns are warp ends. A value of 1 means warp visible on the face; 0 means weft visible. For sinking-shed drafts, listed shafts are interpreted as lowered. When both encodings exist, auto mode prefers the liftplan; run check_wif_consistency() to detect disagreement.

Float runs stop at the supplied matrix edges, including partial runs. Repeat detection uses structure only, allows a partial final repeat, and returns the full dimension when the requested evidence of repetition is absent. A returned full dimension does not prove a repeat was observed. For interlacement frequency, both is the unweighted mean of the available warp and weft transition fractions. These quantities do not predict fabric strength, stiffness, drape or snag resistance without experimental validation.

The WIF reader supports the structural and colour sections described in ?read_wif; it is not a complete WIF conformance validator. Missing thread entries are inactive, unknown sections are ignored, and unavailable colours use neutral grey. Duplicate sections/keys and malformed integer inputs are errors. Inspect incomplete drafts before interpreting their metrics.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("weaveDraft")

0.1.0 by Mark Joshua R. Secretario, 5 hours ago


Browse source code at https://github.com/cran/weaveDraft


Authors: Mark Joshua R. Secretario [aut, cre]


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports graphics, grDevices, stats, tools

Suggests knitr, rmarkdown, testthat


See at CRAN