Skip to content

Instantly share code, notes, and snippets.

@thehans
Last active June 3, 2023 12:19
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thehans/c30c259e83da4e89ccbd975a511dab68 to your computer and use it in GitHub Desktop.
Save thehans/c30c259e83da4e89ccbd975a511dab68 to your computer and use it in GitHub Desktop.
OpenSCAD shear example
// shear such that point will translate by [p.x,p.y] as z-axis is traversed by p.z units
module shearAlongZ(p) {
multmatrix([
[1,0,p.x/p.z,0],
[0,1,p.y/p.z,0],
[0,0,1,0]
]) children();
}
rotate([0,0,0])
shearAlongZ([0,2,5])
linear_extrude(5, scale=1/2)
square(2);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment