I’ve got the basics down, but now looking to do something more complex, and unsure if it’s possible. I have imported a flat shape (a pcb), and I can extrude this out. What I want to do however is to rotate it on its axis, and then extrude it down the z-axis (not directly out from the surface). Is this possible, and if so, how?

  • Andy@lemmy.worldOP
    link
    fedilink
    arrow-up
    1
    ·
    1 year ago

    Thank you! So, you can get a regular 2D shape and use the linear_extrude() function to extrude out at 90 degrees from the object. They refer to in in the docs as the equivalent of pushing playdoh through a press. And from the docs ‘In OpenSCAD Extrusion is always performed on the projection (shadow) of the 2d object xy plane and along the Z axis; so if you rotate or apply other transformations to the 2d object before extrusion, its shadow shape is what is extruded.’

    So the Z axis is no related to what I see on the screen, but is in direct relation to the original 2D image. If I were to first rotate the 2D image by 90 degrees, and then extrude, the extrusion would be on the Z axis relative to the 2D object, but the X axis relative to the rest of the project (if that makes sense).

    What I want it to extrude on the absolute Z axis of the total project, regardless of the angle of rotation of the 2D object. To put it another way, if I were to have a square on the 2D, and I rotated it 30 degrees before extruding, I would not want a cube to be formed, but rather would want a rhombohedron.

    • luckybipedal@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      1 year ago

      I’ve done something like that with a multmatrix transformation. There is an example of doing a skew transformation like that in the OpenSCAD user manual. This works with any 3D shape, not just extrusions. So you could transform a cube into a parallelepiped.