Giter Site home page Giter Site logo

graphical's Introduction

Graphical

Build status

Graphical is a personal research project where I explore different topics I am interested about like algorithm theory, geometry, data structures or computer graphics.

History

Graphical was originally conceived as a purely Dynamo package, where I tried to understand and implement visibility graphs in order to find the shortest path on a given layout.

I soon realized that Dynamo's geometry library was too heavy for this purpose, so I started to create custom geometry primitives (vertices, vectors, lines...) in order to improve the performance.

The result is the detachment of the logic used for the construction and computation of graph and visibilities from the purely Dynamo implementation. This might give more flexibility in the future to be aplied in other platforms.

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgments

graphical's People

Contributors

alvpickmans avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

graphical's Issues

Intersection between edges error when perpendicular and intersecting

When doing edge1.Intersection(edge2) and edge1 is perpendicular to edge2 and intersecting on one of edge1's vertex, returned intersection is that vertex. On this case the dot product is also 0 but they are not parallel.

// if dot == 0 it means that they are parallels
if(Threshold(dot, 0))
{
//Fully contains the test edge
if(edge.StartVertex.OnEdge(this) && edge.EndVertex.OnEdge(this))
{
return edge;
}
else if(this.StartVertex.OnEdge(edge) || this.EndVertex.OnEdge(edge))
{
gVertex[] vertices = new gVertex[4]
{
this.StartVertex,
this.EndVertex,
edge.StartVertex,
edge.EndVertex
};
var sorted = vertices.OrderBy(v => v.Y).ThenBy(v => v.X).ThenBy(v => v.Z).ToList();
return gEdge.ByStartVertexEndVertex(sorted[1], sorted[2]);
}
else
{
return null;
}
}

Dynamo recreation
image

Increasing Performance with Convex Hull Approach

Repository works great with basic polygons, but when vertices reach large numbers it takes forever to build the graph. Using convex hull approach will reduce the number of vertices dramatically and improve the performance. In some of my tests, performance improved by 5000%.

Polygon external/internal property to be relational to other polygons

On certain scenarios, a polygon cannot be only categorize as external/internal. One polygon can be external in relation to others inside itself, but internal to other containing it.

A hierarchical representation of polygon's function within a context could be implemented to avoid the black or white representation.

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.