In this case MCAD is in the OpenSCAD directory and can be referred to without having to do anything. Rim_thickness = gears_rim_thickness * 2 - gears_thickness Number_of_teeth=gears_number_of_teeth_small, Number_of_teeth=gears_number_of_teeth_big, in user libraries directory, whose address is visible from File → Show Library folder menu ….We can see that the command use works even if the MCAD directory is not present in our project: when you use includes and use, OpenSCAD looks for files in three possible locations, in order: This allows libraries authors, for example, to have a test object within the file to verify that everything works fine, without this being included in all projects that link the library. The difference with include seen before is that use imports the definition of modules only, but ignores any instruction to draw objects (see Listing 3). To use MCAD in our gear.scad file we will use the instruction use. One of these is MCAD, distributed with OpenSCAD, that includes useful parts to make mechanical models we will use a part of that library to make a couple of toothed wheels. Translate() cylinder(r=gears_bore_diameter/2,īesides the ability to create your own “parts library”, OpenSCAD allows to include all the libraries found on internet to our project. The box_clear value is used to add a tolerance (clearance) to the joints, and obviously depends on the characteristics of the printer used.Ĭylinder(r=axis_cylinder_r, h=axis_cylinder_h) The main box sides, long_side.scad and short side.scad are simply designed as a union of cubes from which other smaller cubes will be removed to form the interlocking. Going further, it will happen that you would create modules reusable in multiple projects: these modules can be collected in a file to be included in other projects, creating a real personal or shared on the Internet “library”. In general, it is a best practice to use “includes” to split big software projects into smaller and easier to be managed parts by creating lib files, you make it easier to reuse code lines everywhere, like sharing global variables in our case. Pay attention to the fact that the include statement should not be used within modules or instruction clusters, since a library inclusion in that point could cause a syntax error. This file will be included in all files using the instruction: include (Listing 2)Įquivalent, logically, to copying and pasting the lib/sizes.scad content where the instruction is put This way we can use the variables defined in lib/sizes. Gears_len = gears_circular_pitch * gears_number_of_teeth_big / 180 + gears_d īox_width = gears_width + axis_cylinder_h - box_wall + 1 Gears_h = gears_circular_pitch * gears_number_of_teeth_big / 180 Gears_d = gears_circular_pitch * (gears_number_of_teeth_big + gears_number_of_teeth_small ) / 360 The final file output is in Listing 1, but we will fill it in step by step during this exercise. This exercise is aiming at seeing different modeling methods first, but also at learning how to organize parts in the printing area for a most efficient and robust 3D printing.įirst, let’s create a lib/sizes.scad file where we will put the dimensions used in the project: in this way you can share them between different project files, so that you can easily change them during the exercise. In this second and final episode we’ll build something more complex: a mechanism with gears and a structure to enclose and support them.ĭifferently from the previous examples, this time we’ll not print the box in a single piece but in separate parts then we’ll assemble and interlock them together. Limiting ourselves to primitive and simple operations, we had created a parametric box suitable for housing electronic circuits. In the previous tutorial episode we have seen that OpenSCAD describes objects from its basic primitives such as boxes, spheres and cylinders, using set operations (unions, intersections …) and geometric transformations. OpenSCAD is a free 3D modeling software whose strength is the capability of creating more “technical” rather than “artistic” objects, those requiring precise measurements, well-defined geometries and obtainable by repeating or replicating similar components. Here we complete the overview of the free 3D modeling and editing software by creating modular models that can be assembled together.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |