xquery version "3.1"; (:~ : This module contains some variables that define global master switches : in how certain things behave. Want them to behave a different way? : Edit the variables here. Documentation inline. : : Copyright© Mary Holstege 2020-2024 : CC-BY (https://creativecommons.org/licenses/by/4.0/) : @since April 2021 : @custom:Status Subject to additions :) module namespace this="http://mathling.com/core/config"; declare namespace map="http://www.w3.org/2005/xpath-functions/map"; declare namespace array="http://www.w3.org/2005/xpath-functions/array"; declare namespace math="http://www.w3.org/2005/xpath-functions/math"; (:~ : By default geometry is oriented for drawing on an SVG canvas, : where y increases down from the top. For conventional geometry : set this to false. The main impact here is in what a rotation : means. :) declare variable $this:CANVAS-GEOMETRY as xs:boolean := true(); (:~ : Closeness for various operations :) declare variable $this:ε as xs:double := 1E-6; (:~ : (Default) closeness for point intersections :) declare variable $this:tolerance as xs:double := 1E-3; (:~ : Annotate functions for metadata : Annotation gives more information but costs an extra function call : Also requires Saxon-PE/EE (relies on saxon:compile-query and saxon:query) : Disabled because it doesn't work. See commentary in noise/modifiers.xqy : for the sad story. :) declare variable $this:ANNOTATE as xs:boolean := true() and ( ( exists(function-lookup(QName("http://saxon.sf.net/", "query"), 3)) and exists(function-lookup(QName("http://saxon.sf.net/", "compile-query"), 1)) ) or ( exists(function-lookup(QName("http://saxon.sf.net/", "xquery"), 1)) ) or ( exists(function-lookup(QName("http://basex.org/modules/xquery", "eval"), 3)) ) ) ; (:~ : Drawing method: either "svg" to use direct SVG rendering, or "art" to use : domain-specific vocabulary. Note that various components with rendering : parameters may not render correctly in the "svg" mode without adjustment : because they depend on the relevant stylesheets. :) declare variable $this:DRAWING-METHOD as xs:string := "svg"; (:~ : Snap as we go :) declare variable $this:DRAW-SNAPPED as xs:boolean := false(); (:~ : Draw points as pixel (square) or dot (circle) :) declare variable $this:POINT-IS-PIXEL as xs:boolean := true(); (:~ : Draw full edges on paths or dense mode (art drawing mode only) :) declare variable $this:DENSE-EDGES as xs:boolean := true(); (:~ : Map of type to URI for looking up type-based functions :) declare variable $this:TYPE-MAP as map(xs:string,xs:string) := map { "point": "http://mathling.com/geometric/point", "box": "http://mathling.com/geometric/rectangle", "block": "http://mathling.com/geometric/box", "edge": "http://mathling.com/geometric/edge", "arc": "http://mathling.com/geometric/edge", "ellipse-arc": "http://mathling.com/geometric/edge", "quad": "http://mathling.com/geometric/edge", "cubic": "http://mathling.com/geometric/edge", "ellipse": "http://mathling.com/geometric/ellipse", "graph": "http://mathling.com/geometric/graph", "path": "http://mathling.com/geometric/path", "polygon": "http://mathling.com/geometric/path", "face": "http://mathling.com/geometric/solid", "sphere": "http://mathling.com/geometric/solid", "ellipsoid": "http://mathling.com/geometric/solid", "polyhedron": "http://mathling.com/geometric/solid", "tetrahedron": "http://mathling.com/geometric/solid", "cube": "http://mathling.com/geometric/solid", "octahedron": "http://mathling.com/geometric/solid", "icosahedron": "http://mathling.com/geometric/solid", "dodecahedron": "http://mathling.com/geometric/solid", "transform": "http://mathling.com/geometric/transform", "graph2": "http://mathling.com/geometric/graph/arf", "point-matrix": "http://mathling.com/geometric/matrix", "splittree": "http://mathling.com/geometric/tree/split", "splitnode": "http://mathling.com/geometric/tree/split", "treemap": "http://mathling.com/geometric/treemap", "wspair": "http://mathling.com/geometric/wspd", "def": "http://mathling.com/type/defref", "ref": "http://mathling.com/type/defref", "mask": "http://mathling.com/type/mask", "reach": "http://mathling.com/type/reach", "slot": "http://mathling.com/type/slot", "space": "http://mathling.com/geometric/rectangle", "text": "http://mathling.com/type/text", "wrapper": "http://mathling.com/type/wrapper", "curl": "http://mathling.com/type/curl", "fern": "http://mathling.com/type/fern", "modulated-knot": "http://mathling.com/type/modulated-knot", "lissajous": "http://mathling.com/type/modulated-lissajous", "pendulum": "http://mathling.com/type/pendulum", "multi-pendulum": "http://mathling.com/type/pendulum", "harmonograph": "http://mathling.com/type/pendulum", "polynomial": "http://mathling.com/type/polynomial", "wave": "http://mathling.com/type/wave", "wiggle": "http://mathling.com/type/wiggle", "array": "http://mathling.com/core/array", "matrix": "http://mathling.com/core/matrix", "sparse": "http://mathling.com/core/sparse", "stack": "http://mathling.com/core/stack", "image": "http://mathling.com/image", "imagearray": "http://mathling.com/image/matrix", "egg": "http://mathling.com/art/egg", "field-definition": "http://mathling.com/art/flowfield", "flow-definition": "http://mathling.com/art/flowfield", "hex-grid": "http://mathling.com/art/hex-grid", "octopus": "http://mathling.com/art/octopus", "eye": "http://mathling.com/art/octopus", "oldkey": "http://mathling.com/art/oldkey", "bend": "http://mathling.com/art/refraction", "layer": "http://mathling.com/art/refraction", "tiles": "http://mathling.com/art/tiling", "note": "http://mathling.com/music", "rest": "http://mathling.com/music", "score": "http://mathling.com/music", "camera": "http://mathling.com/sdf", "tileshape": "http://mathling.com/tiling/isohedral", "tilepart": "http://mathling.com/tiling/isohedral", "neighbour": "http://mathling.com/wfc/modeldef", "tileinfo" :"http://mathling.com/wfc/modeldef", "model-definition": "http://mathling.com/wfc/modeldef", "sampled-model-definition": "http://mathling.com/wfc/modeldef", "wfc-model-base": "http://mathling.com/wfc/model", "wfc-node": "http://mathling.com/wfc/model", "wfc-run-data": "http://mathling.com/wfc/model", "overlapping-model": "http://mathling.com/wfc/overlapping-model", "tiledata": "http://mathling.com/wfc/simple-tiled-model", "simple-tiled-model": "http://mathling.com/wfc/simple-tiled-model" }; (: config :)