mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-12 09:44:16 +02:00
counter-clockwise
This commit is contained in:
@@ -4,5 +4,5 @@ use <util/map/hashmap_keys.scad>;
|
||||
function tri_delaunay_indices(d) = [
|
||||
for(tri = hashmap_keys(delaunay_triangles(d)))
|
||||
if(tri[0] > 3 && tri[1] > 3 && tri[2] > 3)
|
||||
[tri[0] - 4, tri[1] - 4, tri[2] - 4]
|
||||
[tri[2] - 4, tri[1] - 4, tri[0] - 4] // counter-clockwise
|
||||
];
|
@@ -6,5 +6,5 @@ function tri_delaunay_shapes(d) =
|
||||
[
|
||||
for(tri = hashmap_keys(delaunay_triangles(d)))
|
||||
if(tri[0] > 3 && tri[1] > 3 && tri[2] > 3)
|
||||
[coords[tri[0]], coords[tri[1]], coords[tri[2]]]
|
||||
[coords[tri[2]], coords[tri[1]], coords[tri[0]]] // counter-clockwise
|
||||
];
|
@@ -3,6 +3,7 @@ use <_impl/_tri_delaunay_voronoi_impl.scad>;
|
||||
use <util/map/hashmap.scad>;
|
||||
use <util/map/hashmap_keys.scad>;
|
||||
use <util/map/hashmap_get.scad>;
|
||||
use <util/reverse.scad>;
|
||||
|
||||
function tri_delaunay_voronoi(d) =
|
||||
let(
|
||||
@@ -42,7 +43,7 @@ function tri_delaunay_voronoi(d) =
|
||||
]),
|
||||
cells = [
|
||||
for(i = [4:coords_leng - 1])
|
||||
indicesOfCell(connectedTris[i], triIndices)
|
||||
reverse(indicesOfCell(connectedTris[i], triIndices)) // counter-clockwise
|
||||
]
|
||||
)
|
||||
[for(cell = cells) [for(i = cell) vertices[i]]];
|
||||
|
Reference in New Issue
Block a user