Builtin Library
- ..
- .metadata344 B
- README.md2.1 KB
- edges.module
- init.luau4.0 KB
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 onclassrestricting which faces take part; empty, the whole mesh takes part. A name the class does not carry is refused.class(String, default"primitive"): the classgrouplives 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 whengroupnames 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 theedgeclass:points(the two point ids, a Vec2),faces(the first two faces bordering it, a Vec2, -1 where there is none),faceCountandlength, the detailedgeCount, and theoutputgroup whengroupis named.edges(Data):count,pointsandfaces(two numbers per edge, end to end),faceCounts,lengths,faceOffsetsandfaceIndices(every edge's faces as offsets into indices),openCount,nonManifoldCount,manifold,closed(no open and no non-manifold edge),selectedCount(-1 with no group) andgroup.
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" })