[OpenSCAD] rotating an object around its center....

Ronaldo Persiano rcmpersiano at gmail.com
Fri Jul 19 13:04:44 EDT 2019


1) it is not clear what you want;

2) the prism could be defined vertically by linear_extruding a triangle and
so avoiding the innermost rotation;

3) your final object seems to be (although not exactly) a vertical
translation of the rotation of 5 degrees of a vertical prism.


Em sex, 19 de jul de 2019 às 15:16, Bruno Boettcher <bboett at gmail.com>
escreveu:

> hello!
>
> maybe i am too tired to understand it, i have a prism, i rotate into
> place, thus doing it around the 0,0,0 and then i rotate it around its axe
> (by transferring it to the center, and back...)
> this would work, if later on i hadn't the need to translate the whole
> thing....
>
> i made this :
>
> module prism(l, w, h){
>   polyhedron(
>       points=[[0,0,0], [l,0,0], [l,w,0], [0,w,0], [0,w,h], [l,w,h]],
>       faces=[[0,1,2,3],[5,4,3,2],[0,4,5,1],[0,3,4],[5,2,1]]
>       );
> }
> translate([0,0,8]) //translate back
>   {
>     translate([0,0,-8])//translate to center
>       rotate([5,0,0])//give it the recquired angle
>       {
>             rotate([180,-90,0])
>             translate([1.6,-3.15,0])
>             prism(16,3,40);
>       }
>   }
>
> this reads stupid and cumbersome, i am sure there is a much more elegant
> way to make this?
>
> --
> ciao
> Bruno
>
> ===========================================
> http://nohkumado.eu/, <http://bboett.free.fr>http://aikido.nohkumado.eu/,
> <http://bboett.free.fr>
> http://aikido.zorn.free.fr
> _______________________________________________
> OpenSCAD mailing list
> Discuss at lists.openscad.org
> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscad.org/pipermail/discuss_lists.openscad.org/attachments/20190719/272c3aa3/attachment.html>


More information about the Discuss mailing list