![]() The text in its current form is incomplete. OpenSCAD User Manual/The OpenSCAD Language 9.2.1.3 CGAL ERROR: assertion violation!Ĭhapter 1 - General.9 Chapter 9 - External libraries and code files.7 Chapter 7 - User-Defined Functions and Modules.6.24 parent_module(n) and $parent_modules.6.22.3.2 Search on different column return Index values.6.16.3.4 Selecting elements of a vector.6.16.3.1 Generating vertices for a polygon.6.16.1.1 multiple generator expressions.6 Chapter 6 - Other Functions and Operators.5.3.1 difference with multiple children.3.6.3.2 Extrude parameters for linear extrusion only.3.6.3.1 Extrude parameters for all extrusion modes.3.6.3 Description of extrude parameters.3.3.4 Extruding a 3D shape from a polygon.2.1.4.3 Point repetitions in a polyhedron point list.1.2.3 Variables are set at compile-time, not run-time.The code is similar to the code we used with the cylinder but with some essential changes. Lastly, like we did with the cylinder, we have to create the faces. We also changed the parameter of the sine and cosine by adding the twist variable and multiply in with z. Notice that compared with the our earlier formula we multiply x and y values within the brackets with our sine function f(z). The first two values in the inner square brackets define the position of a point in the xy-plane. Hopefully you’ll see similarities the code below that we used in the earlier post to calculate the basic cylinder. It’s a nested loop where in the inner loop the angle is varied according to the values of sh3 and in the outer loop the value of z is varied. Now we can calculate all the points with the code below p =, angle = sh3) ] Then we need three angles to calculate the exact point of each triangle. Step is the step size in the z-direction and twist is the amount of twist that the vase gets. The height is in the z-direction, the radius is the radius of the initial circle when all the three vertices of the regular triangle lie on that circle. Twist = 1.2 //increase to have more twist In this example I’ll use: f(z) = 2 + 2 * sin(z)īefore we’re able to calculate our points we need the following variables. f(z) = a + b * sin(c(z)+d) īy substituting values for a, b, c and d we get very different sine functions. A sinusoid is the representation of any mathematical sine (or cosine) function that is smooth periodic in nature. In this example I’ll use a sinusoid or sine wave function. Now suppose we twist this triangular plane while extruding and to make it even more complex increase or decrease the size of the plane while extruding. The code in OpenSCADįor that we use the same method as in the previous post about polyhedron: first we calculate the points of the vase and then we define the faces.īut first consider a regular triangular plane and extrude that in the height (z-direction). On the left in the front a twisted triangle (in blue), on the left in the back a twisted octagon and on the right a twisted regular polygon that consists if 36 edges or vertices. Three examples of twisted vases created with this code. In this post we first create one starting with a simple triangle and then other regular polygons. You’ve probably seen them on Printables or Thingiverse and they exist in many varieties. As long as we’re able to find the right function we can create the object with this method.Īs an example I’ll explain how to create a twisted or spiraled vase. Not very exciting but this method is very useful to create much more complex objects. Earlier I explained how to use polyhedron to create a regular cylinder in OpenSCAD.
0 Comments
Leave a Reply. |