simplicial-complex-contour

WebJar for simplicial-complex-contour

License

License

MIT
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

simplicial-complex-contour
Last Version

Last Version

1.0.2
Release Date

Release Date

Type

Type

jar
Description

Description

simplicial-complex-contour
WebJar for simplicial-complex-contour
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/mikolalysenko/simplicial-complex-contour

Download simplicial-complex-contour

How to add to project

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

Dependencies

compile (4)

Group / Artifact Type Version
org.webjars.npm : marching-simplex-table jar [1.0.0,2)
org.webjars.npm : ndarray jar [1.0.15,2)
org.webjars.npm : ndarray-sort jar [1.0.0,2)
org.webjars.npm : typedarray-pool jar [1.1.0,2)

Project Modules

There are no modules declared in this project.

simplicial-complex-contour

Finds a piecewise-linear isocontour on a simplicial complex using the marching simplex method.

Example

var extractContour = require('simplicial-complex-contour')
var bunny = require('bunny')

//Solve for the curve z=0 on the surface of the bunny
var zvalues = bunny.positions.map(function(p) {
  return p[2]
})
var curve = extractContour(bunny.cells, zvalues, 0.0)

//Unpack edges and positions of curve
var curveEdges = curve.cells
var curvePositions = curve.vertexWeights.map(function(w,i) {
  var a = bunny.positions[curve.vertexIds[i][0]]
  var b = bunny.positions[curve.vertexIds[i][1]]

  return [
    w * a[0] + (1 - w) * b[0],
    w * a[1] + (1 - w) * b[1],
    w * a[2] + (1 - w) * b[2]
  ]
})

//Render the curve
console.log({
  cells: curveEdges,
  positions: curvePositions
})

Install

npm install simplicial-complex-contour

API

require('simplicial-complex-contour')(cells, values[, level])

Computes a piecewise linear solution to the solution values=levels

  • cells is an array of simplices represented by tuples of vertex indices
  • values is an array of values defined at each vertex of the cell complex
  • level is the level at which the surface is extracted (Default 0)

Returns An object with 3 properties

  • cells which are the cells of the extracted isosurface
  • vertexIds which is an array of pairs of vertex ids encoding the crossing edges
  • vertexWeights which are linear weights applied to each vertex

Credits

(c) 2014 Mikola Lysenko. MIT License

Versions

Version
1.0.2