mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-01-17 14:18:13 +01:00
refactor
This commit is contained in:
parent
705aa35e3e
commit
b2e9775e7f
@ -19,24 +19,13 @@ function _cells_lt_before_intersection(shape, size, points, pt, half_region_size
|
|||||||
let(
|
let(
|
||||||
v = p - pt,
|
v = p - pt,
|
||||||
nv = v / norm(v),
|
nv = v / norm(v),
|
||||||
offset = (pt + p) / 2 - nv * half_region_size,
|
off = (pt + p) / 2 - nv * half_region_size,
|
||||||
cosa = nv.x,
|
cosa = nv.x,
|
||||||
sina = nv.y,
|
sina = nv.y,
|
||||||
m = [
|
m = [[cosa, -sina], [sina, cosa]]
|
||||||
[1, 0, offset.x],
|
|
||||||
[0, 1, offset.y],
|
|
||||||
[0, 0, 1]
|
|
||||||
]
|
|
||||||
*
|
|
||||||
[
|
|
||||||
[cosa, -sina, 0],
|
|
||||||
[sina, cosa, 0],
|
|
||||||
[0, 0, 1]
|
|
||||||
]
|
|
||||||
)
|
)
|
||||||
[
|
[
|
||||||
for(sp = shape)
|
for(sp = shape)
|
||||||
let(transformed = m * [each sp, 1])
|
m * sp + off
|
||||||
[transformed.x, transformed.y]
|
|
||||||
]
|
]
|
||||||
];
|
];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user