multmatrix

13 views
Skip to first unread message

Giampiero Gabbiani

unread,
Oct 3, 2021, 4:46:07 PM10/3/21
to Curv
Hi, 

I'm trying to move a project I made for OpenSCAD to curv: is there anything similar to the multmatrix? 

Regards
Giampiero

Doug Moen

unread,
Oct 3, 2021, 5:12:11 PM10/3/21
to Curv
`multmatrix` has never been implemented. But you should feel free to implement it and contribute it to Curv.

If you are interested, you will need to look at the implementations of the Affine Transformation functions `move`, `rotate`, `scale`, `stretch`, etc in `lib/curv/std.curv`. My linear algebra is rusty, but I believe that an implementation of `multmatrix` would involve calculating the inverse of the transformation matrix that is passed as an argument. There is no function in Curv to invert a matrix, and implementing that is probably the bulk of the work, after you wrap your head around how Curv works. Also note that `dot[m1,m2]` is matrix multiplication in Curv.

More generally, you should be aware that Curv is not a drop-in replacement for OpenSCAD. Some functions just don't exist: `hull`, `minkowski`, 'text` and `polyhedron`. (Although there are specialized primitives which replace most uses of `minkowski`). And the programming style is different. OpenSCAD projects that work by unioning together a large number of simple objects generally need to be rewritten using entirely different CSG primitives which avoid large unions.

Doug Moen
--
You received this message because you are subscribed to the Google Groups "Curv" group.
To unsubscribe from this group and stop receiving emails from it, send an email to curv+uns...@googlegroups.com.

Reply all
Reply to author
Forward
0 new messages