Slicer Discord
Quaternions for OpenScad – 3D-printbaar model van Thingiverse Thingiverse

Quaternions for OpenScad

57 Downloads
60 Likes
0 Makes
Model downloaden
Having some basic Matrix math operations available in OpenScad has been a wonderful thing. I found my life to be somewhat lacking though because rotations are a royal pain in the...

This thing adds Quaternion support to OpenScad

Besides sounding like a cool name for an 80s rock band, or a futuristic diabolical planetary leader, quaternions are a math construct that make doing rotations a fairly painless task.

basically: myquat = quat(axis, angle);

So, to do a 30 degree rotation around the z-axis for example, would look like this:

rotz = quat([0,0,1], 30);

Now, that's not going to do you much good in OpenScad by itself, so you need to turn it into a matrix that OpenScad can easily consume and apply as a transform, so you do this:

rotzmatrix = quat_to_mat4(rotz);

Once you have this, you can use it with multmatrix()

multmatrix(rotzmatrix);

or

multmatrix(quat_to_mat4(quat([0,0,1],30)));

Ok, so wow, big deal!!

OK. So, combinations can be done like t
Bron
Thingiverse
Wat je nodig hebt om te printen: Beginner Lage betrouwbaarheid
Eendelig
Supports 1/3
Montage 0/3
Instellingen 1/3
Bedgrootte 0/3
Nabewerking 0/3
Printer
FDM / FFF
Bestandsformaat
STL
Materiaal
PLA
Software
Cura, PrusaSlicer of vergelijkbaar
Nog geen beoordelingen
Nog geen reacties – wees de eerste!

Vergelijkbare modellen

6 Suggesties
Feed Blog Slicer Kostenrekenmachine Zoeken op afbeelding Indienen Kontakt Discord ☕ Buy me a coffee
DE EN FR ES IT NL

Toevoegen aan collectie