

Now there is something annoying: positioning the "positive" peg shapes and the "negative" peg shapes rely on fully duplicated code. And finally carve the pegs (all through the plate itself)įor(r=) // repeat the positioning Plate_th+tol]) // higher to avoid gaps with the pegs! Now call and build the four pegs positive shapes (not carved) Translate() // screw holeĬylinder(r=screw_d/2,h=height+2*tol + plate_th ) // hole The changes are highlighted.Įlse // "negative" shape (carve the inner peg cylinder) Or the module itself could be written with a "positive" and "negative" version like this.
OPENSCAD BEVEL CODE
It also makes the source code not very readable and less parametric. But it breaks the very idea of a module by sharing "internal" information with the outside (it crosses the module encapsulation). only the cylinders and before the plate is added).Ī way out could be to take the negative (hollow) cylinder out of the module, and remove them to the union of the pegs and the plate. Making holes longer will not help, because they apply only to the shapes defined in the one_peg module (i.e. Plate_th+tol]) // slightly higher to avoid gapsīut when we add the blue bottom plate, flush with the pegs, the holes are no more open! Helper module: centered cube on (X,Y) but not on Z, like cylinder Tol=0.05 // used for CSG subtraction/additionĬylinder(r=screw_d/2,h=height+2*tol) // through hole Screw_dist=40 // PCB hole spacing (square) We conveniently put all these in a "peg" module.īut we want the screws to go all through the support, which itself it added outside of the module.įailed! The peg holes do not go through the blue plate.įorget about the dimensions, we do not care here.Īs we have seen, it is a good practice to factorize the peg shapes into a module, and then to iterate four times on it, like this: Each of the "pegs" is made of a cylinder, a bevel at the base, and a hollow cylinder for the screw. Let us consider a support for an electronic board. This is a common design problem with the constructive solid geometry paradigm. How can "negative" shapes extend outside of their module?
OPENSCAD BEVEL WINDOWS
(If you don’t see the Customizer in OpenSCAD go to the menu bar and click on Windows and then Customizer). This means that users don’t have to tinker with the code but can adjust the values of the variables with a easy to use panel on the right side of the GUI of OpenSCAD called the Customizer. To make it even easier the script makes use of the Customizer of OpenSCAD. With parametric I mean that a user can easily adjust the script by changing some variables to make your own hook. Writing a script for a simple hook in OpenSCAD is easy but I wanted to do something more and make a parametric hook.
