|
|
> After trying some other stuff, I also have;
> sqrt(
> pow(y-Edge,2)
> +pow(z-Edge,2)
>
> +pow(x-select(min(x-Inside_length,0),max(x,Inside_corner),min(x,Inside_length)),2)
>
> )-Block_Round_corner
>
> Witch seems to give a cylinder with rounded ends.
> I can't seem to rotate this ether.
>
> Suggestions, hints?
To rotate the shape by (eg) 30 degrees about the z axis, you need to
replace x,y & z in your function with x,y,z rotated by -30 degrees about
the z axis.
For rotation about z, you need:
( from https://en.wikipedia.org/wiki/Rotation_matrix#Basic_rotations )
x' = x*cos(a) - y*sin(a)
y' = x*sin(a) + y*cos(a)
z' = z
Putting those into your function above you get something like:
#local a = radians(30);
sqrt(
pow((x*sin(a)+y*cos(a))-Edge,2)
+pow(z-Edge,2)
+pow((x*cos(a)-y*sin(a))-select(min((x*cos(a)-y*sin(a))-Inside_length,0),max((x*cos(a)-y*sin(a)),Inside_corner),min((x*cos(a)-y*sin(a)),Inside_length)),2)
)-Block_Round_corner
Post a reply to this message
|
|