Log inGet started
World

Builtin Library

Branchmain
Branchesmainpublish
Commitdd348ac6c3

README.md

topology.edges (procNode)

A geometry's unique edge set with its face adjacency, written as the edge attribute class, plus the edge table read back as a Data record. An edge is the unordered point pair it joins; its index is its position in the list sorted by (low point, high point), stable for a mesh.

Inputs

  • geometry (Geometry): the geometry whose edges are listed.
  • group (String, default ""): names a 0/1 attribute on class restricting which faces take part; empty, the whole mesh takes part. A name the class does not carry is refused.
  • class (String, default "primitive"): the class group lives on: "edge", "point", "primitive" or "vertex".
  • promote (String, default "all"): how a group on a class other than "primitive" becomes a face set: "all" takes the faces every one of whose elements of that class is in the group, "any" the faces at least one is.
  • output (String, default "edges"): the name of the 0/1 edge group written for the edges the participating faces border. Written only when group names a selection.

A group changes what the group's edges measure: an edge between a participating face and a left-out one is bordered by one participating face.

Outputs

A call answers a record by output name.

  • geometry (Geometry): the input with the edge class: points (the two point ids, a Vec2), faces (the first two faces bordering it, a Vec2, -1 where there is none), faceCount and length, the detail edgeCount, and the output group when group is named.
  • edges (Data): count, points and faces (two numbers per edge, end to end), faceCounts, lengths, faceOffsets and faceIndices (every edge's faces as offsets into indices), openCount, nonManifoldCount, manifold, closed (no open and no non-manifold edge), selectedCount (-1 with no group) and group.

Example

local sphere = g.sdf.mesh({ sdf = g.sdf.sphere({ radius = 0.5 }), resolution = 8 }).geometry
local result = g.topology.edges({ geometry = sphere })
local closed = g.value.get({ data = result.edges, path = "closed" })