planar-dual

WebJar for planar-dual

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

planar-dual
Last Version

Last Version

1.0.2
Release Date

Release Date

Type

Type

jar
Description

Description

planar-dual
WebJar for planar-dual
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/mikolalysenko/planar-dual

Download planar-dual

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/planar-dual/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>planar-dual</artifactId>
    <version>1.0.2</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/planar-dual/
implementation 'org.webjars.npm:planar-dual:1.0.2'
// https://jarcasting.com/artifacts/org.webjars.npm/planar-dual/
implementation ("org.webjars.npm:planar-dual:1.0.2")
'org.webjars.npm:planar-dual:jar:1.0.2'
<dependency org="org.webjars.npm" name="planar-dual" rev="1.0.2">
  <artifact name="planar-dual" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='planar-dual', version='1.0.2')
)
libraryDependencies += "org.webjars.npm" % "planar-dual" % "1.0.2"
[org.webjars.npm/planar-dual "1.0.2"]

Dependencies

compile (2)

Group / Artifact Type Version
org.webjars.npm : compare-angle jar [1.0.0,2)
org.webjars.npm : dup jar [1.0.0,2)

Project Modules

There are no modules declared in this project.

planar-dual

Given a planar embedding of a graph, find all faces.

Example

var getFaces = require("planar-dual")

//Create a triforce
var positions = [
  [0, 0],
  [-1, -1],
  [0, 1],
  [1, -1]
]
var edges = [
  [1, 2],
  [2, 3],
  [3, 1],
  [0, 1],
  [0, 2],
  [0, 3]
]

//Compute dual graph
console.log(getFaces(edges, positions))

Output:

[ [ 0, 1, 2 ], [ 0, 2, 3 ], [ 0, 3, 1 ], [ 1, 3, 2 ] ]

Install

npm install planar-dual

API

require("planar-dual")(edges, positions)

Splits an embedded planar graph into a collection of faces

  • edges are the edges of the graph
  • positions are the locations of the vertices of the graph

Returns A list of faces of the graph represented as ordered lists of vertices

Credits

(c) 2014 Mikola Lysenko. MIT License

Versions

Version
1.0.2