mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-10-01 08:46:46 +02:00
supported slicing again
This commit is contained in:
@@ -36,19 +36,49 @@ module function_grapher(points, thickness, style = "FACES", slicing = "SLASH") {
|
|||||||
|
|
||||||
leng_pts = len(top_pts);
|
leng_pts = len(top_pts);
|
||||||
|
|
||||||
top_faces = [
|
top_tri_faces1 = slicing == "SLASH" ? [
|
||||||
for(yi = [0:rows - 2])
|
for(yi = [0:rows - 2])
|
||||||
for(xi = [0:columns - 2])
|
for(xi = [0:columns - 2])
|
||||||
[
|
[
|
||||||
xy_to_index(xi, yi, columns),
|
xy_to_index(xi, yi, columns),
|
||||||
|
xy_to_index(xi + 1, yi, columns),
|
||||||
|
xy_to_index(xi + 1, yi + 1, columns)
|
||||||
|
]
|
||||||
|
] : [
|
||||||
|
for(yi = [0:rows - 2])
|
||||||
|
for(xi = [0:columns - 2])
|
||||||
|
[
|
||||||
|
xy_to_index(xi, yi, columns),
|
||||||
|
xy_to_index(xi + 1, yi, columns),
|
||||||
|
xy_to_index(xi, yi + 1, columns)
|
||||||
|
]
|
||||||
|
];
|
||||||
|
|
||||||
|
top_tri_faces2 = slicing == "SLASH" ? [
|
||||||
|
for(yi = [0:rows - 2])
|
||||||
|
for(xi = [0:columns - 2])
|
||||||
|
[
|
||||||
|
xy_to_index(xi, yi, columns),
|
||||||
|
xy_to_index(xi + 1, yi + 1, columns),
|
||||||
|
xy_to_index(xi, yi + 1, columns)
|
||||||
|
]
|
||||||
|
] : [
|
||||||
|
for(yi = [0:rows - 2])
|
||||||
|
for(xi = [0:columns - 2])
|
||||||
|
[
|
||||||
xy_to_index(xi + 1, yi, columns),
|
xy_to_index(xi + 1, yi, columns),
|
||||||
xy_to_index(xi + 1, yi + 1, columns),
|
xy_to_index(xi + 1, yi + 1, columns),
|
||||||
xy_to_index(xi, yi + 1, columns)
|
xy_to_index(xi, yi + 1, columns)
|
||||||
]
|
]
|
||||||
];
|
];
|
||||||
|
|
||||||
base_faces = [
|
base_tri_faces1 = [
|
||||||
for(face = top_faces)
|
for(face = top_tri_faces1)
|
||||||
|
face + [leng_pts, leng_pts, leng_pts, leng_pts]
|
||||||
|
];
|
||||||
|
|
||||||
|
base_tri_faces2 = [
|
||||||
|
for(face = top_tri_faces2)
|
||||||
face + [leng_pts, leng_pts, leng_pts, leng_pts]
|
face + [leng_pts, leng_pts, leng_pts, leng_pts]
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -102,8 +132,8 @@ module function_grapher(points, thickness, style = "FACES", slicing = "SLASH") {
|
|||||||
polyhedron(
|
polyhedron(
|
||||||
points = concat(top_pts, base_pts),
|
points = concat(top_pts, base_pts),
|
||||||
faces = concat(
|
faces = concat(
|
||||||
top_faces,
|
top_tri_faces1, top_tri_faces2,
|
||||||
base_faces,
|
base_tri_faces1, base_tri_faces2,
|
||||||
side_faces1,
|
side_faces1,
|
||||||
side_faces2,
|
side_faces2,
|
||||||
side_faces3,
|
side_faces3,
|
||||||
|
Reference in New Issue
Block a user