mirror of
https://github.com/JustinSDK/dotSCAD.git
synced 2025-08-14 10:44:48 +02:00
add m_mirror
This commit is contained in:
16
src/m_mirror.scad
Normal file
16
src/m_mirror.scad
Normal file
@@ -0,0 +1,16 @@
|
||||
function m_mirror(v) =
|
||||
let(
|
||||
nv = v / norm(v),
|
||||
txx = -2* nv[0] * nv[0],
|
||||
txy = -2* nv[0] * nv[1],
|
||||
txz = -2* nv[0] * nv[2],
|
||||
tyy = -2* nv[1] * nv[1],
|
||||
tyz = -2* nv[1] * nv[2],
|
||||
tzz = -2* nv[2] * nv[2]
|
||||
)
|
||||
[
|
||||
[1 + txx, txy, txz, 0],
|
||||
[txy, 1 + tyy, tyz, 0],
|
||||
[txz, tyz, 1 + tzz, 0],
|
||||
[0, 0, 0, 1]
|
||||
];
|
Reference in New Issue
Block a user