Learning Objectives

By the end of this lesson, students should be able to:

  1. Understand the concept of mirroring in OpenSCAD.
  2. Use the mirror function to create symmetrical models.
  3. Apply the mirror function to manipulate objects’ positions in the 3D space.



Mirroring Objects in OpenSCAD

Mirroring is a common technique used in 3D modeling to create symmetrical shapes or to change the orientation of an object. In OpenSCAD, the mirror function allows us to transform an object into a mirror image of itself across a plane that intersects the origin.

The argument to the mirror function specifies the normal vector of the mirror plane (the vector perpendicular to the mirror plane). This argument is a list of three numbers representing the X, Y, and Z coordinates of the normal vector.

Remember, the mirror function does not create a copy of the original object but rather modifies it directly.




Examples of Using the mirror Function

Here are some examples of using the mirror function:

  1. Mirroring along the x-axis:
    hand(); // original 
    mirror([1,0,0]) hand();
    
  2. Mirroring along a plane defined by the vector [1,1,0]:
    hand(); // original 
    mirror([1,1,0]) hand();
    
  3. Mirroring along a plane defined by the vector [1,1,1]:
    hand(); // original 
    mirror([1,1,1]) hand();
    
  4. Mirroring a rotated cube:
    rotate([0,0,10]) cube([3,2,1]);
    mirror([1,0,0]) translate([1,0,0]) rotate([0,0,10]) cube([3,2,1]);
    

In these examples, the hand(); and cube([3,2,1]); functions create the original 3D objects, and the mirror function is used to create their mirror images.




Review

In this lesson, you learned:

  • What mirroring is in 3D modeling and how it is implemented in OpenSCAD.
  • How to use the mirror function to create symmetrical objects or change the orientation of an object.
  • The argument to the mirror function specifies the normal vector to the mirror plane.




Resources