math.js

18.0 kB · javascript · 543 lines

1import * as wasm from "./pkg/math/mrlyjs_math.js";23export { default, initSync } from "./pkg/math/mrlyjs_math.js";4export const Rng = wasm.Rng;5export const atoms = {6    carpet_2d: wasm.atoms_carpet_2d,7    carpet_3d: wasm.atoms_carpet_3d,8    carpet_nd: wasm.atoms_carpet_nd,9    dust_2d: wasm.atoms_dust_2d,10    dust_3d: wasm.atoms_dust_3d,11    dust_nd: wasm.atoms_dust_nd,12    hline_2d: wasm.atoms_hline_2d,13    htree_2d: wasm.atoms_htree_2d,14    line_nd: wasm.atoms_line_nd,15    net_2d: wasm.atoms_net_2d,16    net_3d: wasm.atoms_net_3d,17    net_nd: wasm.atoms_net_nd,18    noise_2d: wasm.atoms_noise_2d,19    noise_3d: wasm.atoms_noise_3d,20    ones_2d: wasm.atoms_ones_2d,21    ones_3d: wasm.atoms_ones_3d,22    point_2d: wasm.atoms_point_2d,23    point_3d: wasm.atoms_point_3d,24    point_nd: wasm.atoms_point_nd,25    star_2d: wasm.atoms_star_2d,26    star_3d: wasm.atoms_star_3d,27    star_nd: wasm.atoms_star_nd,28    tree_nd: wasm.atoms_tree_nd,29    vline_2d: wasm.atoms_vline_2d,30    void_2d: wasm.atoms_void_2d,31    void_3d: wasm.atoms_void_3d,32    void_nd: wasm.atoms_void_nd,33    vtree_2d: wasm.atoms_vtree_2d,34    xline_3d: wasm.atoms_xline_3d,35    xtree_3d: wasm.atoms_xtree_3d,36    yline_3d: wasm.atoms_yline_3d,37    ytree_3d: wasm.atoms_ytree_3d,38    zeros_2d: wasm.atoms_zeros_2d,39    zeros_3d: wasm.atoms_zeros_3d,40    zline_3d: wasm.atoms_zline_3d,41    ztree_3d: wasm.atoms_ztree_3d,42};43export const bang = {44    Design: wasm.bang_Design,45    MagicLayer: wasm.bang_MagicLayer,46    Universe: wasm.bang_Universe,47    bang: wasm.bang_bang,48    code_to_corners: wasm.bang_code_to_corners,49    corners: wasm.bang_corners,50    corners_to_code: wasm.bang_corners_to_code,51    levels_code: wasm.bang_levels_code,52    magic: wasm.bang_magic,53    magic_named: wasm.bang_magic_named,54    sources: wasm.bang_sources,55    symmetries: wasm.bang_symmetries,56    total_exposure: wasm.bang_total_exposure,57    touches_every_corner: wasm.bang_touches_every_corner,58    universe_codes: wasm.bang_universe_codes,59    baseq: {60        WALK_LIMIT: wasm.bang_baseq_WALK_LIMIT,61        axis_maps: wasm.bang_baseq_axis_maps,62        bracelets: wasm.bang_baseq_bracelets,63        canonical: wasm.bang_baseq_canonical,64        carry: wasm.bang_baseq_carry,65        class_sequence: wasm.bang_baseq_class_sequence,66        classes: wasm.bang_baseq_classes,67        distinct_designs: wasm.bang_baseq_distinct_designs,68        even_fill_is_balanced: wasm.bang_baseq_even_fill_is_balanced,69        fill_from_corners: wasm.bang_baseq_fill_from_corners,70        group: wasm.bang_baseq_group,71        group_order: wasm.bang_baseq_group_order,72        orbit: wasm.bang_baseq_orbit,73        predicted_group_order: wasm.bang_baseq_predicted_group_order,74        representatives: wasm.bang_baseq_representatives,75        sequence: wasm.bang_baseq_sequence,76        total_designs: wasm.bang_baseq_total_designs,77    },78    catalog: {79        ANTIS_2D: wasm.bang_catalog_ANTIS_2D,80        ANTIS_3D: wasm.bang_catalog_ANTIS_3D,81        antis: wasm.bang_catalog_antis,82    },83    code: {84        get: wasm.bang_code_get,85    },86    factory: {87        create: wasm.bang_factory_create,88        create_from_corners: wasm.bang_factory_create_from_corners,89        create_named: wasm.bang_factory_create_named,90        residue_corners: wasm.bang_factory_residue_corners,91        total_codes: wasm.bang_factory_total_codes,92    },93    universe: {94        anf: wasm.bang_universe_anf,95        anf_string: wasm.bang_universe_anf_string,96        apply: wasm.bang_universe_apply,97        corner_index: wasm.bang_universe_corner_index,98        degree: wasm.bang_universe_degree,99        orbit: wasm.bang_universe_orbit,100        permutations: wasm.bang_universe_permutations,101    },102    word: {103        Schedule: wasm.bang_word_Schedule,104        components: wasm.bang_word_components,105        constant_functional: wasm.bang_word_constant_functional,106        dimension: wasm.bang_word_dimension,107        fill: wasm.bang_word_fill,108        fills: wasm.bang_word_fills,109        letter: wasm.bang_word_letter,110        native: wasm.bang_word_native,111        period: wasm.bang_word_period,112        prefixes: wasm.bang_word_prefixes,113        rates: wasm.bang_word_rates,114        side: wasm.bang_word_side,115        spell: wasm.bang_word_spell,116        staircase: wasm.bang_word_staircase,117        thue_morse: wasm.bang_word_thue_morse,118    },119};120export const cell = {121    grow: wasm.cell_grow,122    paint: wasm.cell_paint,123    census: {124        edges: wasm.cell_census_edges,125        exposure: wasm.cell_census_exposure,126        fills: wasm.cell_census_fills,127        vertices: wasm.cell_census_vertices,128        voids: wasm.cell_census_voids,129    },130    geometry: {131        merge_reps: wasm.cell_geometry_merge_reps,132        perforate: wasm.cell_geometry_perforate,133    },134    models: {135        anti: wasm.cell_models_anti,136        binarize: wasm.cell_models_binarize,137        binarize_otsu: wasm.cell_models_binarize_otsu,138        blur: wasm.cell_models_blur,139        combine: wasm.cell_models_combine,140        counting_dtype: wasm.cell_models_counting_dtype,141        depth: wasm.cell_models_depth,142        dtype_for: wasm.cell_models_dtype_for,143        fractal: wasm.cell_models_fractal,144        height: wasm.cell_models_height,145        invert: wasm.cell_models_invert,146        layers: wasm.cell_models_layers,147        neighbors: wasm.cell_models_neighbors,148        new: wasm.cell_models_new,149        new_: wasm.cell_models_new,150        orient: wasm.cell_models_orient,151        pad: wasm.cell_models_pad,152        paint: wasm.cell_models_paint,153        perforate: wasm.cell_models_perforate,154        rotate: wasm.cell_models_rotate,155        tile: wasm.cell_models_tile,156        types: wasm.cell_models_types,157        width: wasm.cell_models_width,158    },159    serializer: {160        byte_cube: wasm.cell_serializer_byte_cube,161        byte_grid: wasm.cell_serializer_byte_grid,162        color_grid: wasm.cell_serializer_color_grid,163        count_cube: wasm.cell_serializer_count_cube,164        count_grid: wasm.cell_serializer_count_grid,165        parse: wasm.cell_serializer_parse,166        tag_layer: wasm.cell_serializer_tag_layer,167        types_field: wasm.cell_serializer_types_field,168    },169};170export const counts = {171    Exposure: wasm.counts_Exposure,172    centered_hexagonal: wasm.counts_centered_hexagonal,173    cut_fills: wasm.counts_cut_fills,174    cut_voids: wasm.counts_cut_voids,175    dimension: wasm.counts_dimension,176    edges_of_tile: wasm.counts_edges_of_tile,177    exposure: wasm.counts_exposure,178    exposure_of_tile: wasm.counts_exposure_of_tile_,179    exposure_recurrence: wasm.counts_exposure_recurrence_,180    fill: wasm.counts_fill,181    fill_from_corners: wasm.counts_fill_from_corners,182    grid: wasm.counts_grid,183    limit: wasm.counts_limit,184    pairs: wasm.counts_pairs,185    positions: wasm.counts_positions,186    pro_fills: wasm.counts_pro_fills,187    pro_voids: wasm.counts_pro_voids,188    profile_of_tile: wasm.counts_profile_of_tile,189    ratio: wasm.counts_ratio,190    rational: wasm.counts_rational,191    surface: wasm.counts_surface,192    void: wasm.counts_void,193    void_: wasm.counts_void,194    diagonal: {195        WIDEST: wasm.counts_diagonal_WIDEST,196    },197    ladder: {198        cap: wasm.counts_ladder_cap,199        carry_matrix: wasm.counts_ladder_carry_matrix,200        characteristic: wasm.counts_ladder_characteristic,201        determinant: wasm.counts_ladder_determinant,202        digit_polynomial: wasm.counts_ladder_digit_polynomial,203        even_block: wasm.counts_ladder_even_block,204        fill: wasm.counts_ladder_fill,205        ladder: wasm.counts_ladder_ladder,206        perron: wasm.counts_ladder_perron,207        sign: wasm.counts_ladder_sign,208        spectral_ratio: wasm.counts_ladder_spectral_ratio,209        trace: wasm.counts_ladder_trace,210    },211    six: {212        grid_triangles: wasm.counts_six_grid_triangles,213        solid_slice_boundary: wasm.counts_six_solid_slice_boundary,214        solid_slice_core_edges: wasm.counts_six_solid_slice_core_edges,215        solid_slice_core_nodes: wasm.counts_six_solid_slice_core_nodes,216        solid_slice_edges: wasm.counts_six_solid_slice_edges,217        solid_slice_interior: wasm.counts_six_solid_slice_interior,218        solid_slice_triangles: wasm.counts_six_solid_slice_triangles,219        solid_slice_vertices: wasm.counts_six_solid_slice_vertices,220    },221};222export const graph = {223    Layout: wasm.graph_Layout,224    Network: wasm.graph_Network,225    census: wasm.graph_census,226    components: wasm.graph_components,227    core_graph: wasm.graph_core_graph,228    edge_graph: wasm.graph_edge_graph,229    fractal_dimension: wasm.graph_fractal_dimension,230    junctions: wasm.graph_junctions,231    largest_component: wasm.graph_largest_component,232    roles: wasm.graph_roles,233    tips: wasm.graph_tips,234    total_length: wasm.graph_total_length,235    tunnel_graph: wasm.graph_tunnel_graph,236};237export const moire = {238    Field: wasm.moire_Field,239    Layer: wasm.moire_Layer,240    Preset: wasm.moire_Preset,241    Spec: wasm.moire_Spec,242    Volume: wasm.moire_Volume,243    all: wasm.moire_all,244    frame: wasm.moire_frame,245    layer: wasm.moire_layer,246    named: wasm.moire_named,247    render: wasm.moire_render,248    stack: wasm.moire_stack,249    stack_codes: wasm.moire_stack_codes,250    volume: wasm.moire_volume,251    pairs: {252        correlation: wasm.moire_pairs_correlation,253        sampled: wasm.moire_pairs_sampled,254        witness: wasm.moire_pairs_witness,255    },256    sample: {257        axes: wasm.moire_sample_axes,258        membership: wasm.moire_sample_membership,259        pack: wasm.moire_sample_pack,260    },261};262export const name = {263    Bang: wasm.name_Bang,264    Lattice: wasm.name_Lattice,265    Sequence: wasm.name_Sequence,266    Word: wasm.name_Word,267};268export const press = {269    CORNERS: wasm.press_CORNERS,270    Press: wasm.press_Press,271    containing: wasm.press_containing,272    coordinates: wasm.press_coordinates,273    count_below: wasm.press_count_below,274    distinct: wasm.press_distinct,275    interleave: wasm.press_interleave,276    layer_table: wasm.press_layer_table,277    member: wasm.press_member,278    members: wasm.press_members,279    profile: wasm.press_profile,280    usage: wasm.press_usage,281    word_count: wasm.press_word_count,282    word_member: wasm.press_word_member,283    word_members: wasm.press_word_members,284    word_profile: wasm.press_word_profile,285};286export const roulette = {287    Nodes: wasm.roulette_Nodes,288    nodes: wasm.roulette_nodes,289    side: wasm.roulette_side,290    spread: wasm.roulette_spread,291};292export const rules = {293    BASE: wasm.rules_BASE,294    render: wasm.rules_render,295    tree_axes: wasm.rules_tree_axes,296};297export const shape = {298    Frac: wasm.shape_Frac,299    REFINE_LIMIT: wasm.shape_REFINE_LIMIT,300    Region: wasm.shape_Region,301    census: wasm.shape_census,302    classify: wasm.shape_classify,303    crop: wasm.shape_crop,304    crossing_shell: wasm.shape_crossing_shell,305    crossing_tree: wasm.shape_crossing_tree,306    named: wasm.shape_named,307    radial_census: wasm.shape_radial_census,308    refine: wasm.shape_refine,309    regions: wasm.shape_regions,310    shapes: wasm.shape_shapes,311};312export const six = {313    FILL: wasm.six_FILL,314    GRID: wasm.six_GRID,315    LEFT: wasm.six_LEFT,316    RIGHT: wasm.six_RIGHT,317    UP: wasm.six_UP,318    VOID: wasm.six_VOID,319    anti: wasm.six_anti,320    binarize: wasm.six_binarize,321    binarize_otsu: wasm.six_binarize_otsu,322    blank: wasm.six_blank,323    blur: wasm.six_blur,324    census: wasm.six_census,325    components: wasm.six_components,326    cut: wasm.six_cut,327    cut_design: wasm.six_cut_design,328    east: wasm.six_east,329    euler: wasm.six_euler,330    fills: wasm.six_fills,331    fills_only: wasm.six_fills_only,332    framed: wasm.six_framed,333    from_json: wasm.six_from_json,334    giant: wasm.six_giant,335    giant_network: wasm.six_giant_network,336    height: wasm.six_height,337    holes: wasm.six_holes,338    is_cube: wasm.six_is_cube,339    is_hex: wasm.six_is_hex,340    iso: wasm.six_iso,341    iso_design: wasm.six_iso_design,342    new: wasm.six_new,343    new_: wasm.six_new,344    north: wasm.six_north,345    orientation: wasm.six_orientation,346    pad: wasm.six_pad,347    paint: wasm.six_paint,348    perforate: wasm.six_perforate,349    png: wasm.six_png,350    pro: wasm.six_pro,351    pro_design: wasm.six_pro_design,352    radial: wasm.six_radial,353    radial_crop: wasm.six_radial_crop,354    radial_mask: wasm.six_radial_mask,355    raster: wasm.six_raster,356    rect_png: wasm.six_rect_png,357    rect_svg: wasm.six_rect_svg,358    rim_holes: wasm.six_rim_holes,359    skin: wasm.six_skin,360    slice_core_graph: wasm.six_slice_core_graph,361    slice_dual_graph: wasm.six_slice_dual_graph,362    slice_edge_graph: wasm.six_slice_edge_graph,363    slice_tunnel_graph: wasm.six_slice_tunnel_graph,364    south: wasm.six_south,365    spectral_exponent: wasm.six_spectral_exponent,366    svg: wasm.six_svg,367    tessellate: wasm.six_tessellate,368    tile: wasm.six_tile,369    tile_cell: wasm.six_tile_cell,370    tile_crop: wasm.six_tile_crop,371    tile_step: wasm.six_tile_step,372    to_json: wasm.six_to_json,373    triangles: wasm.six_triangles,374    west: wasm.six_west,375    width: wasm.six_width,376    star: {377        Branch: wasm.six_star_Branch,378        Share: wasm.six_star_Share,379        Star: wasm.six_star_Star,380        arm_law: wasm.six_star_arm_law,381        chi8: wasm.six_star_chi8,382        constant: wasm.six_star_constant,383        decay: wasm.six_star_decay,384        width_law: wasm.six_star_width_law,385    },386};387export const spectrum = {388    clusters: wasm.spectrum_clusters,389    laplacian: wasm.spectrum_laplacian,390    laplacian_spectrum: wasm.spectrum_laplacian_spectrum,391    multiplicity: wasm.spectrum_multiplicity,392    spectral_exponent: wasm.spectrum_spectral_exponent,393    spectral_fit: wasm.spectrum_spectral_fit,394    spectral_points: wasm.spectrum_spectral_points,395    symmetric_eigenvalues: wasm.spectrum_symmetric_eigenvalues,396};397export const spin = {398    Blend: wasm.spin_Blend,399    arcs: wasm.spin_arcs,400    harmonics: wasm.spin_harmonics,401    mass: wasm.spin_mass,402    mass_within: wasm.spin_mass_within,403    petals: wasm.spin_petals,404    profile: wasm.spin_profile,405    radial: wasm.spin_radial,406    reach: wasm.spin_reach,407    ring: wasm.spin_ring,408    turns: wasm.spin_turns,409    wheel: wasm.spin_wheel,410};411export const spirograph = {412    LAPS_CAP: wasm.spirograph_LAPS_CAP,413    PENCIL_CAP: wasm.spirograph_PENCIL_CAP,414    POINT_CAP: wasm.spirograph_POINT_CAP,415    RADIUS_CAP: wasm.spirograph_RADIUS_CAP,416    RASTER_CAP: wasm.spirograph_RASTER_CAP,417    SIDES: wasm.spirograph_SIDES,418    Seats: wasm.spirograph_Seats,419    cell: wasm.spirograph_cell,420    cover: wasm.spirograph_cover,421    disc: wasm.spirograph_disc,422    distinct: wasm.spirograph_distinct,423    frame: wasm.spirograph_frame,424    nodes: wasm.spirograph_nodes,425    pencils: wasm.spirograph_pencils,426    point: wasm.spirograph_point,427    pose: wasm.spirograph_pose,428    representatives: wasm.spirograph_representatives,429    seats: wasm.spirograph_seats,430    signed_area: wasm.spirograph_signed_area,431    trace: wasm.spirograph_trace,432    track: wasm.spirograph_track,433    turn: wasm.spirograph_turn,434};435export const three = {436    Vec3: wasm.three_Vec3,437    carpet: wasm.three_carpet,438    census: wasm.three_census,439    core_graph: wasm.three_core_graph,440    create: wasm.three_create,441    diagonal_slice: wasm.three_diagonal_slice,442    diagonal_svg: wasm.three_diagonal_svg,443    dust: wasm.three_dust,444    edge_graph: wasm.three_edge_graph,445    euler: wasm.three_euler,446    extrude: wasm.three_extrude,447    extrude_cube: wasm.three_extrude_cube,448    faces: wasm.three_faces,449    fills: wasm.three_fills,450    from_corners: wasm.three_from_corners,451    from_json: wasm.three_from_json,452    from_strings: wasm.three_from_strings,453    hidden: wasm.three_hidden,454    level_set: wasm.three_level_set,455    magic: wasm.three_magic,456    manhattan_layers: wasm.three_manhattan_layers,457    merge: wasm.three_merge,458    mosaic: wasm.three_mosaic,459    named: wasm.three_named,460    net: wasm.three_net,461    noise: wasm.three_noise,462    ones: wasm.three_ones,463    orientations: wasm.three_orientations,464    point: wasm.three_point,465    profile: wasm.three_profile,466    project: wasm.three_project,467    quads: wasm.three_quads,468    shadow: wasm.three_shadow,469    slice: wasm.three_slice,470    special: wasm.three_special,471    star: wasm.three_star,472    support: wasm.three_support,473    surface: wasm.three_surface,474    text: wasm.three_text,475    to_json: wasm.three_to_json,476    to_obj: wasm.three_to_obj,477    to_strings: wasm.three_to_strings,478    tunnel_graph: wasm.three_tunnel_graph,479    void: wasm.three_void,480    void_: wasm.three_void,481    voids: wasm.three_voids,482    volume: wasm.three_volume,483    wires: wasm.three_wires,484    xline: wasm.three_xline,485    xtree: wasm.three_xtree,486    yline: wasm.three_yline,487    ytree: wasm.three_ytree,488    zeros: wasm.three_zeros,489    zline: wasm.three_zline,490    ztree: wasm.three_ztree,491};492export const tourbillon = {493    eyes: wasm.tourbillon_eyes,494    field: wasm.tourbillon_field,495    layers: wasm.tourbillon_layers,496    period: wasm.tourbillon_period,497    sharing: wasm.tourbillon_sharing,498    stack: wasm.tourbillon_stack,499    stats: wasm.tourbillon_stats,500};501export const two = {502    capacity: wasm.two_capacity,503    carpet: wasm.two_carpet,504    census: wasm.two_census,505    create: wasm.two_create,506    dust: wasm.two_dust,507    embed: wasm.two_embed,508    euler: wasm.two_euler,509    extract: wasm.two_extract,510    fills: wasm.two_fills,511    from_corners: wasm.two_from_corners,512    from_json: wasm.two_from_json,513    from_strings: wasm.two_from_strings,514    hline: wasm.two_hline,515    htree: wasm.two_htree,516    level_set: wasm.two_level_set,517    mask: wasm.two_mask,518    merge: wasm.two_merge,519    named: wasm.two_named,520    net: wasm.two_net,521    noise: wasm.two_noise,522    ones: wasm.two_ones,523    perimeter: wasm.two_perimeter,524    png: wasm.two_png,525    point: wasm.two_point,526    read: wasm.two_read,527    sheet: wasm.two_sheet,528    special: wasm.two_special,529    star: wasm.two_star,530    svg: wasm.two_svg,531    text: wasm.two_text,532    to_3d: wasm.two_to_3d,533    to_json: wasm.two_to_json,534    vline: wasm.two_vline,535    void: wasm.two_void,536    void_: wasm.two_void,537    voids: wasm.two_voids,538    vtree: wasm.two_vtree,539    zeros: wasm.two_zeros,540    payload: {541        frame: wasm.two_payload_frame,542    },543};