Files
orx/orx-mesh/src/commonMain/kotlin/Wireframe.kt
2024-09-17 16:55:19 +02:00

18 lines
413 B
Kotlin

package org.openrndr.extra.mesh
import org.openrndr.math.Vector3
/**
* Extract wireframe from mesh data
*/
fun IMeshData.wireframe(): List<List<Vector3>> {
return polygons.map { ip -> ip.toPolygon(this.vertexData).positions.toList() }
}
/**
* Extract wireframe from compound mesh data
*/
fun ICompoundMeshData.wireframe(): List<List<Vector3>> {
return compounds.values.flatMap { it.wireframe() }
}