Giter Site home page Giter Site logo

tougo's Introduction

tougo

javascript 2D geometry and topology tools

This is a small set of geometry tools I had written around 2012 for a small project, as well as a basic html5 renderer. Since then I try to maintain it and expand it further. I know there are a lot of other similar APIs out there doing exactly the same thing even in 3D.

The part where I differ and I am especially proud of is the removeDangles function in the topology.js file, that, for those that are not familiar with the term, it trims any line, in a line collection that does not participate in any potential line to polygon conversion.

Unfortunately I havent yet written the function to transform the lines to polygons, but I intend to do so.

26 March 2016

Big changes in my life, switching jobs, countries. Big changes for this small project as well. I am making it a bit more GIS-ish (Geographical Information Systems -ish). I know there are a lot of map viewers out there but sometimes if we don't do things from scratch we won't grow and learn. So I made a WMS viewer for Canvas. Unfortunately on this first commit it doesnt work about the box for every coordinate system out there, but soon I hope it will. Also its not 100% compatible :P with the rest of the project, more like a standalone feature for the time being. Check it out

10 December 2015

I noticed how poorly some things were written (we grow/ we learn) and I am currently re-writing everything, plus I am adding some extra algorithms I have written in the meantime, for some other projects. Also I am expanding the examples. If anyone is even remotely interested he/she can join and do a PR

beware, examples demonstratre a small portion of the code, currently due to redesigning there are a lot of things that aren't working

1 December 2015

I decided to port the library to be used out of the box with OpenLayers 2.x because there was a need in another project of mine. This library is not really maintained but I do my best to add things when I need them.

additionally

drawing.js has basic html5 canvas drawing functions in case you dont want to implement yours

usage example (display polygons) --updated 6/4/2016

  1. I converted the code so that functions would no longer be global. Instead everything is packed in 4 closure functions primitives geometrical rendering topology
  2. Read Polygon Coordinates as a xy Array Geometries[i] ={ type : "polygon", geometry : primitives.CreatePolygon(xyArray)};
  3. Calculate the Bounding Box var BBox = geometrical.getBoundingBox(Geometries);
  4. Transform Polygon Coordinate to the Local Canvas System var tr = geometrical.transform(Geometries, BBox, Canvas_width, Canvas_height);
  5. Draw the Polygons on the Canvas Element rendering.drawing(tr (transformed geometries), fill (true/false), '243011'(hex color without #), canvas (the canvas object)); rendering.drawing(tr, false, '243011', canvas);

visit http://elasticrash.github.io/tougo/ for more info and examples

tougo's People

Contributors

elasticrash avatar

Stargazers

Giorgos Papadakis avatar davidwei_001 avatar  avatar Alexandros Giannakidis avatar  avatar

Watchers

davidwei_001 avatar James Cloos avatar  avatar

tougo's Issues

Geometry Arrays

Geometry Array Classes needs to by manually build, maybe I should integrate the method into the primitive.js file

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.