Git Product home page Git Product logo

dibl's People

Contributors

guy-dentelle-neupre avatar jo-pol avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

dibl's Issues

Provide pair versions of the diagonal templates

Flanders and brick templates have thread and pair versions to allow generating matching diagrams. A lace maker has only complex clues to actually create lace from a diagonal template: the legend on the left of the diagram and the matrix in the form.

recipe like language

Once we can turn pair diagrams into thread diagrams we also have the building blocks to develop a recipe like language that can turn some description into a diagram. For example something like (tctc(1-2),lctc(2-3),ctc(3-5),tctc(5-6),lctc(5-4),ctc(4-2))*3 for 6 cloth stitch rows of a simple band with three passives and foot-sides. The number between braces meaning which pair are involved, for example ctc(3-5) means work pair 3 in cloth stitch through pair 4 and 5. Increasing numbers meaning working left to right, decreasing right to left. The pair diagram in ASCII art:

|/    |
|\___ |
|    \|
| ___/|
|/    |
|\___ |
|    \|
| ___/|
|/    |
|\___ |
|    \|
| ___/|

placeholder

to get consistent numbers with the original repository

bent lines for repeated twists

A thread diagram shows a repeated twist as a single line. When applying colour it becomes clear both lines are on top of one another. Implement bent links to properly show repeated twists as shown in the modified screenshot.
double-twist

hide-show advanced options

The form to generate diagram may be daunting. Add a more-less toggle that shows/hides the shift / image-size options

pattern of dots get scrambled

When pushing the 'draw' button to show another grid, the dot pattern turns from '011,101,211,101,011,121' into '011%2C101%2C211%2C101%2C011%2C121'. When pushing again, the field is reported as invalid.

reduce source code for hard-coded matrices

The source graph.scala is quite large due to the hard coded matrices. The hashmap even runs into limits ob object size when not constructing it from other objects. Though the JavaScript generated from the scala sources is cached and transferred in a zipped form, too many matrices may cause occasional unacceptable load time.

It is not necessary to store both incoming and outgoing pairs for each stitch in a tile. The incoming pairs can be deduced from the outgoing pairs or vice versa to reconstruct the full tuples. Outgoing pairs for interleaved tuples have 10 permutations, diagonal tuples even less. So a matrix can be stored with a string containing just a single decimal digit per stitch. It must be strings as integers range little over 9 digits and we need 16 for 4x4 matrices. For the size of the source code string or integers hardly matter. Eliminating the deduction of incoming from outgoing pairs, we have 70 permutations, meaning digits plus the alphabet in lower case and upper case and 6 more characters (or the ASCII characters [0-Za-y]) would result in the same string length. A simple hashmap can convert these characters to the desired tuples.

Work with circular grids

I make bobbin lace, want to do a circular grids and apply on them any of base elements of lace. Please tell me how to do it.

complete color codes of the dynamic diagrams

When generating a link definition, the titles (rendered as tool-tips) of source and target nodes should be examined to determine the type of markers. We also need some mapping to translate these titles to markers, for example tctc means red, ctc means purple (#660099) and tc means green for the adjacent links. Additional twists at the start mean a mid marker, in ascii-art the link should look like ---+---. Ask the specialists in the bobbin lace community how to render special stitches like ctctc and cttc.

For now only start markers and end markers are implemented. There seem to be two solutions for mid-markers:

  • Provide a third node for each line to place the mid-marker as explained on stack-overflow, this also turns the currently straight links into curves. The curves should be quite faint if visible at all.
  • Place text on a link and use one pipe symbol for each additional twist.

incomplete thread diagrams

The thread diagrams are not only incomplete because the foot sides of the thread diagrams are clumsy. The diagram below shows that the algorithm also fails to 'see' it can do the purple stitches end hence three star shapes. The screenshot is taken from development view which shows faint versions of invisible nodes and lines.

incomplete

"loading script, please wait... " and then nothing

http://jo-pol.github.io/DiBL/grounds/
Clears the message "loading script, please wait... " after a while, but nothing else happens, at least not for a while.

Mobile devices might need a long time (dozens of seconds) to render the complex SVG diagrams. A Flanders or 2x2 pair diagram will be the fastest to try and see if it works at all.

If no diagram appears after a very long time, please report the circumstances, it might be more than a performance issue.

placeholder

to get consistent numbers with the original repository

SVG download of generated ground is buggy

The original problems are fixed, but note that you have to right-click and select "save image", do not save the page.

After applying "show in other tab" while generating a ground and saving the generated page locally, an application like InkScape will not open the saved diagram.

When opening a diagram saved with Safari or IE the diagram does not contain the chosen stitches but the original template. FF and Chrome are fixed for this matter.

Partial workaround: Open the saved file with a plain text editor, strip the few HTML lines at the top and bottom and save the result with an SVG extension. InkScape will open the modified file.

replace attribute inkscape:label

So far the attribute inkscape:label was used as it shows up in the XML tree view of InkScape what made manual editing more comfortable. Using this attribute might lead to conflicts. A technical better solution would be to add attributes in a dibl namespace. The namespace means an additional attribute for the root-element: xmlns:dibl="https://github.com/jo-pol/DiBL/svgNameSpace"
expected attributes:

  • dibl:stitchName value example: tc tcptc
  • dibl:stitchVariant value example: (0,1,1,0,-1,-1)
  • dibl:clone value example: A1, B2
  • dibl:braidWord not yet used

can we learn something from
http://www.iis.sinica.edu.tw/~trc/public/publications/svgopen03/

implement thread versions of the dynamic diagrams

So far only pair diagrams can be generated from predefined matrices. We need also thread diagrams for real added value over the template based diagrams.

The generated D3-data (just before conversion to a raw-js object) can be input for an algorithm that generates pair diagrams. Strip all properties but the source/target of links, and the title of nodes. Some mapping from node-title to predefined snippets per stitch for thread stitches might help to replace the nodes in the pair diagram. The file sample.js contains an example snippet for ptcptc, note that no stitch has two pins, they sit there to demonstrate the behaviour of pins. Do not connect this example (with substituted node numbers) by merging nodes but by merging links. The merged link starts at the source of the bobbin-link and ends at the target of the start-link as illustrated with the double links in the image below.
replacing-nodes

drop downs for stitches

The drop downs to choose stitches should show all stitches supported by the selected template and no other stitches. That reduces the explanations that are now required.

flipping and rotation of matrices

The java version of the ground generator has options to flip or rotate a pattern before applying the stitches. This option is still missing in the scala version.

.bat files throw IllegalArgumentException (.txt files in .zip are in unix style)

the problem

following the procedure on http://jo-pol.github.io/DiBL/grounds/ with a .sh file works fine but a .bat file results in:

Exception in thread "main" java.lang.IllegalArgumentException: 3
expecting two numbers on the first line with the dimensions of the matrix
        at dibl.Main.readMatrix(Main.java:122)
        at dibl.Main.<init>(Main.java:67)
        at dibl.Main.main(Main.java:54)

analysis

https://github.com/jo-pol/DiBL/releases/download/tiles-0.1.3/dibl-tiles-0.1.3-bin.zip
contains .txt files in the input folder that are in unix format. The program does not recognize the lines when launched with a .bat file.

solution

fix either the two occurrences of reader.readLine() in standalone/tiles/dibl-tiles/src/main/java/dibl/math/Matrix.java or package the files in windows style.

simplify permalinks for generated grounds

With the generated ground it is less obvious to create a link to a certain configuration, and vice versa to create variants by filling in the form with the arguments of a link. Combine the pages with the form and generated ground like for the polar grids and fill in the form with the arguments. Note that the generated ground performs badly on mobile devices, so a link without at least a template parameter should not generate something from defaults but a pre-cooked teaser.

add pins to a diagram

Pins in thread diagrams can be added through stitch definitions. This issue is about interactively adding pins to a generated pair diagram.

When a user clicks within some polygon of surrounding links, add a pin connected with invisible links to the nodes of the polygon, see the sample.js. The spreadsheet-like index in the titles of the nodes tell where to repeat the new pin, see also the scala-doc of Matrix.toCheckerboard.

implement shift, flip and rotate for dynamic diagrams

See also #12 for flipping and rotating, the matrices now have a different format so the old code can't be reused though the same principles still apply.

With the D3.js implementation and foot-sides ( #24 ) we need an option to shift the matrix before generating a diagram. Thus we can choose which part of the pattern becomes the left edge.

add footsides to the dynamic diagrams

Adding foot-sides to diagrams can help to plan colored threads in a piece of lace.

The image below is a manipulated screenshot of a diagram in a development environment. It shows faint links and nodes which are completely transparent in the github.io demo. Blue dots are added to indicate the intended positions of pins in the foot-sides.
dev-view
You can get the development view by launching sbt ~fastOptJS from the web/tensioned directory of your local clone. Then you can examine a stripped version of the demo page with http://localhost:12345/target/scala-2.11/classes/index-dev.html NB: do not copy the development JavaScript of the master branch to the gh-pages branch without making the faint links and nodes completely transparent again. Rather experiment in the gh-pages branch with the data in sample.js and copy the gh-pages version of show-graph.js to the master branch and make the fully transparent items a little less transparent in the master branch.

The transparent links serve to keep the loose ends in proper order. Otherwise thread number tool-tips might get twisted and bobbins in foot-sides point upwards. Additional nodes on the corners might improve the aesthetic impression. For a simple proper foot-side, the nodes of bobbins and the next pair-start should merge into single nodes, the remaining transparent links in the foot-sides should become black. The links along the top should remain transparent. See the sample.js for adding pins. Of course the thus introduced stitches should get a color-code, see also #23 as foot-side stitches usually need twist-marks for consistent symmetry in the produced lace.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.