
Minute_axle_dm = 3.2 // minute axle diameter We will only model this screw terminal as a simple cylinder and will not include the fine thread in our model: Potential clocks must therefore have an appropriate hole that can receive that screw. If the movement is installed in a clock, it is fastened via a central screw terminal. Since our loop variable i becomes 0 and 1 exactly once, we thus create both our original flattening-notch pair and the mirrored pair on the opposite side. If the vector is the null vector ( ), no mirroring takes place. The parameter of the mirror transformation is a three-dimensional vector that specifies along which axis we want to mirror our geometry. Since our model is symmetric with respect to the origin, we can describe the flattening and notch on the other side of the main cylinder by a combination of mirror transformation and for-loop. We position both geometries according to their respective setbacks and ensure sufficient allowances in dimensioning (and positioning) to ensure a clean difference operation. We first model the flattening and notch on one side of the main cylinder by combining a box ( cube) and a cylinder using a Boolean union. We describe the alignment pattern using the basic shape cylinder, from which we subtract the flattening and notches using a Boolean difference operation. It is therefore an important detail that should be present in our movement mockup:Īlignment_dm = 14 // diameter of alignment patternĪlignment_h = 1 // height of alignment patternĪlignment_flat = 1 // recess of flatteningĪlignment_notch_dm = 6 // diameter of alignment notchesĪlignment_notch_fl = 2 // recess of notch flatteningĬylinder( d = alignment_dm, h = alignment_h, $fn = 36) This alignment pattern serves to lock and align the movement when it is installed in a clock. It consists of a flattened, notched cylinder. Surrounding the main axis of the movement, an alignment pattern protrudes from the main body. This alignment will not only simplify the following modeling steps, but will also improve the usability of the clock_movement module as part of an OpenSCAD library. We decided to align the main body of the clock to the origin of the coordinate system in such a way that the surface of the main body is planar with the X-Y plane (displacement along the Z-axis by -height) and that later the axes of the clock movement will coincide with the Z-axis (displacement in X and Y direction by -width / 2 and -depth / 2). Even though our geometry description is not very extensive so far, we have already made an important design decision. Instead, we define them as variables within the module. Since we are modeling a given physical object, we can assume the measured quantities to be fixed and therefore do not need to make them parameters of the module. We start by defining a module and describing the box-shaped main body of the movement:
Openscad for loop how to#
Furthermore we will use the search function and learn how to create simple animations with OpenSCAD. In terms of new transformations we will use mirror and resize. We will learn about the 2D basic shape import as well as the 3D basic shape surface. : A remodeled clock movement as a mockup What’s new? 🔗


As example, we will remodel a standard clock movement and design the geometry description in such a way that it can be comfortably used as part of an OpenSCAD library. In this project we want to take a closer look at important aspects that have to be considered if we want to create a useful OpenSCAD library. If you use certain components frequently, it is worth storing them in an OpenSCAD library and then including them in the respective project using include or use. This way, you can already see in the computer model whether all parts of the system really fit and are in the right place. In such cases, it is helpful to measure and remodel these components and use them as mockups in the geometry description. In the context of 3D printing, these are often motors, ball bearings, screws or nuts, for example. When designing a technical system, it regularly happens that already existing components have to be integrated.
