-
Hello, I'd like to translate this OpenSCAD project into JSCAD: https://github.com/wbu/drawer_organizer I've tried using the openscad-translator, but since the OpenSCAD code contains assignments I've resorted to doing it by hand instead. The original makes use of Is there any way to shear in JSCAD or am I out of luck? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Quickly thinking about it, it should be possible. transforms allows you to supply your own transform matrix and shear should work fine. notable difference is that in openscad it is two dimensional 4x4 array, and in jscad a simple 16 length array const jscad = require('@jscad/modeling')
const {transform, translate} = jscad.transforms
const {cube} = jscad.primitives
const main = ()=>{
const skew = 0.1
const matrix = [
1,skew,0,-skew,
0,1,0,0,
0,0,1,0,
0,0,0,1
]
return [
transform(matrix,cube({size:10})),
translate([-20,0,0],cube({size:10})),
]
}
module.exports = {main} |
Beta Was this translation helpful? Give feedback.
Quickly thinking about it, it should be possible.
https://openjscad.xyz/docs/module-modeling_transforms.html#.transform
transforms allows you to supply your own transform matrix and shear should work fine.
notable difference is that in openscad it is two dimensional 4x4 array, and in jscad a simple 16 length array