Coder Social home page Coder Social logo

devendork / stringfigures Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 122 KB

A custom gui created to generate string figures based on specific resistance outputs in a yarn-based "knotting" sensor

Home Page: http://unstable.design/string-figuring/

License: Mozilla Public License 2.0

HTML 3.83% JavaScript 91.37% CSS 4.80%
resistance topology

stringfigures's Introduction

This is code for a custom GUI that helps me predict the resistance outcomes of a custom-yarn based sensor. The sensor is a knitted rope made from silver yarn and wool. The rope is created around a core that, internally, has five unique contact points with outer silver rope. This allows resistance readings to be captured along various lengths of the yarn. As you cross the yarns and make various knots, differenet resistance "signatures" are produced. I wrote this GUI to help me understand the topology of the yarn for any range of resistance signatures and to see if there are any assumptions I can make about the sensors topology based on those resistances.

ALGORITHM

While s < Show || i < Iterations

Randomly generate between minPoints and maxPoints points in a 2D plane. 
Create a closed path connecting those points
(the order in which those points are drawn determines the topology, e.g. 0->1->2 etc)

Split the path into N segments. Add nodes that split existing edges to nodelist. 

Check all edges for intersection, create new nodes and edges for intersections.

Calculate the shortest path from each segment to "ground" (e.g. the first point). 

Percentage P = path (shortest path) / max_path (the length when there are no crossings, aka longest possible path);

If all values P are within specified ranges, push to "show"  

CONTROLS

Interface

  • Update - generates a new set of string figures
  • Show Original - shows the topology of the knot upon which values were caulculated. The colored regions along the path mark each unique "segment" that produces a resistance calcuation.
  • Show Nodes - shows the points along the knot that are meaningful. The Black node is power. Grey nodes demarkate the starting points of indvidiual segments.
  • Show Curve - generates a more knot-like aesthetic representation based on the original topology.

Ratio Settings

  • The sliders allow the user to specify the range of resistances that are permissible within each segment. They range from 0% to 100%. A value of 100% means that this section of the yarn has not knots or places where the yarn crosses between its starting point and ground (e.g. each segment overlaps the other longer segments). A value of less than 100% means that there is likely an intersection between this segment and ground. Due to minor computation errors, a value of 98% or higher also carries the same meaning as a value of 100.

Knot Settings

  • Show - specifies the number of knots that meet the resistance criteria to show on screen
  • Segments - specifies the number of segments along the rope (TODO: this does not update the ratiosettings)
  • Iterations - specifies how many iterations of the knot generation algorithm will be run before timeout
  • Points - specifies the min and max number of control points used to generate the ropes topology.

TO DO

  1. Fix intersection bug that occurs with some knots. Presumed to be when itersection is on an endpoint.
  2. Rewrite algorithm to evolve shapes that are close to specified resistance targets instead of random search

stringfigures's People

Contributors

devendork avatar

Stargazers

 avatar

Watchers

 avatar

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.