### L-system 3D Examples Source: https://github.com/stone-age-sculptor/stoneagelib/wiki/Turtle Examples of 3D L-system implementations, which are noted as being somewhat similar to recursive Turtle graphics in OpenSCAD. ```OpenSCAD https://openhome.cc/eGossip/OpenSCAD/lib3x-lsystem3.html ``` -------------------------------- ### Turtle Graphics Example Script (Python) Source: https://github.com/stone-age-sculptor/stoneagelib/wiki/Turtle An example demonstrating the use of turtle graphics commands in Python, mirroring the functionality available in OpenSCAD. This script shows how to generate a path using a similar command structure. ```Python # Example script: Turtle.py # This script utilizes a Python implementation of turtle graphics. # Assuming a TurtlePathConverter class is available # from stoneagelib.turtle import TurtlePathConverter # Placeholder for the actual converter class class TurtlePathConverter: def __init__(self): self.path = [] self.x = 0 self.y = 0 self.heading = 0 # degrees, 0 is positive x-axis def TurtleToPath(self, turtlelist, accuracy=0.1): # Simplified simulation of command processing for cmd_obj in turtlelist: cmd = cmd_obj['command'] if cmd == "FORWARD": distance = cmd_obj['value'] # In a real implementation, this would calculate new x, y based on heading # For this example, we just add a placeholder point self.path.append((self.x, self.y)) # Simulate movement self.x += distance * math.cos(math.radians(self.heading)) self.y += distance * math.sin(math.radians(self.heading)) self.path.append((self.x, self.y)) elif cmd == "LEFT": degrees = cmd_obj['value'] self.heading = (self.heading + degrees) % 360 elif cmd == "RIGHT": degrees = cmd_obj['value'] self.heading = (self.heading - degrees) % 360 elif cmd == "HOME": self.x, self.y = 0, 0 self.heading = 0 self.path.append((self.x, self.y)) # Add other commands as needed for a full implementation return self.path import math # Define a list of turtle commands turtle_commands = [ { "command": "FORWARD", "value": 50 }, { "command": "LEFT", "value": 90 }, { "command": "FORWARD", "value": 30 }, { "command": "RIGHT", "value": 45 }, { "command": "FORWARD", "value": 40 }, { "command": "CIRCLE", "radius": 20, "extend": 180 }, { "command": "HOME" } ] # Create a converter instance converter = TurtlePathConverter() # Convert turtle commands to a path path_data = converter.TurtleToPath(turtle_commands) # The path_data can now be used for drawing or further processing print("Generated Path:", path_data) ``` -------------------------------- ### openscad-turtle Script Example Source: https://github.com/stone-age-sculptor/stoneagelib/wiki/Turtle An example of Turtle graphics in OpenSCAD, specifically the 'stackable square bowl' created using the openscad-turtle script by phildubach. ```OpenSCAD https://github.com/phildubach/openscad-turtle ``` -------------------------------- ### Turtle Graphics Example Script (OpenSCAD) Source: https://github.com/stone-age-sculptor/stoneagelib/wiki/Turtle An example of how to use the turtle graphics commands within an OpenSCAD script to generate a complex design. This script demonstrates the application of various turtle commands to create visual output. ```OpenSCAD // Example script: DemonstrationTurtle.scad // This script utilizes the turtle graphics library to create a shape. // Include the turtle library if it's in a separate file // include module create_turtle_shape() { // Define a list of turtle commands turtle_commands = [ { command: "FORWARD", value: 50 }, { command: "LEFT", value: 90 }, { command: "FORWARD", value: 30 }, { command: "RIGHT", value: 45 }, { command: "FORWARD", value: 40 }, { command: "CIRCLE", radius: 20, extend: 180 }, { command: "HOME" } ]; // Convert turtle commands to a path path_data = TurtleToPath(turtle_commands, accuracy = 0.1); // Draw the path as a polygon polygon(path_data); } // Render the shape create_turtle_shape(); ``` -------------------------------- ### BOSL2 Library Turtle Graphics (3D) Source: https://github.com/stone-age-sculptor/stoneagelib/wiki/Turtle Documentation for the 3D Turtle graphics functionality within the BOSL2 library for OpenSCAD. This feature has its own dedicated page in the wiki with numerous examples. ```OpenSCAD https://github.com/BelfrySCAD/BOSL2/wiki/turtle3d.scad ``` -------------------------------- ### text_subdivision with Custom Font Definitions Source: https://github.com/stone-age-sculptor/stoneagelib/wiki/Subdivision-Font The text_subdivision function supports adding custom font definitions via a parameter. This allows for the use of custom fonts or the replacement of specific characters within existing fonts, as demonstrated by visual examples showing normal, modified, and custom UTF-8 characters. ```APIDOC text_subdivision(text, font, size, spacing, custom_font_definitions) - Renders text with options for custom font definitions. - Parameters: - text: The string of text to render. - font: The base font to use. - size: The size of the text. - spacing: The spacing between characters. - custom_font_definitions: A list of user-defined font characters to use or override existing ones. ``` -------------------------------- ### heart2D Function - StoneAgeLib SCAD Source: https://github.com/stone-age-sculptor/stoneagelib/wiki/Shapes The heart2D function generates a 2D heart shape with customizable parameters for size, curvature, and detail. It takes several arguments to control the shape's appearance, including size, raise, stretch, shift, and the number of points. The function is part of the StoneAgeLib library, and examples demonstrate its use in 3D printing applications. ```APIDOC heart2D(size, raise, stretch, shift, points) Generates a 2D heart shape. Parameters: size (float): The overall size of the heart. Default: 10. raise (float): Adjusts the curvature at the top of the heart. Default: 0.1. stretch (float): Stretches the lower part of the heart. Default: 0.1. shift (float): Shifts the bottom of the heart horizontally. No default specified. points (int): The number of points used to render the shape. Default: 50. Example Usage: // Basic usage with default parameters heart2D(size=10, raise=0.1, stretch=0.1, points=50); // Customized usage heart2D(size=20, raise=0.2, stretch=0.05, shift=-2, points=100); Related: DemonstrationHeart.scad (Example file) ``` -------------------------------- ### Include StoneAgeLib Library Source: https://github.com/stone-age-sculptor/stoneagelib/wiki/Home Demonstrates how to include the StoneAgeLib library in your OpenSCAD projects. This allows access to the library's functions and modules. ```openscad include ``` -------------------------------- ### Random Blobs Generation (OpenSCAD) Source: https://github.com/stone-age-sculptor/stoneagelib/wiki/Texture Enables the creation of random blobs in 2D by utilizing the library's subdivision capabilities with irregular rectangles. This is a foundational concept for generating organic shapes and fuzzy skin effects in 3D models. ```APIDOC Blobs (Conceptual Functionality) - Creates random blobs in 2D using subdivision of irregular rectangles. - Purpose: To generate organic shapes and potentially fuzzy skin effects for 3D models. - Usage: Typically involves combining subdivision techniques with irregular geometric primitives. - Example Script: DemonstrationBlobs.scad is available for examples. ``` -------------------------------- ### Create Font Tubes with Subdivision Font Source: https://github.com/stone-age-sculptor/stoneagelib/wiki/Subdivision-Font Demonstrates how to create tube-like shapes by rendering text with a very small weight and applying a minkowski sum with a sphere. This technique leverages the subdivision font's ability to define line thickness. ```openscad minkowski() { linear_extrude(0.001) text_subdivision("ABC",weight=0.001,smooth=4); sphere(1,$fn=20); } ``` -------------------------------- ### Stone Age Turtle Graphics API Source: https://github.com/stone-age-sculptor/stoneagelib/wiki/Turtle Defines the core functions and commands for the turtle graphics module, enabling the creation of 2D paths and shapes. Includes functions for path conversion and a comprehensive set of turtle movement and manipulation commands. ```APIDOC TurtleToPath(turtlelist, accuracy) - Converts a list of turtle commands into a path (list of coordinates). - Parameters: - turtlelist: A list with commands for the turtle. - accuracy: The accuracy of the arcs and circles. Default the same value as $fn. - Initial State: The turtle starts at (0,0) and the angle is 0. An angle of zero is in the direction of the positive x-axis. Turtle Commands: LEFT degrees - Turn left by the specified degrees. The turtle stays in its position. RIGHT degrees - Turn right by the specified degrees. The turtle stays in its position. HOME - Go to the home position (0,0) and reset the angle to 0 degrees. FORWARD distance - Go forward by the specified distance. BACKWARD distance - Go backward by the specified distance. CIRCLE radius, extend - Draw a circular arc. The radius determines the curvature (positive for left-turn, negative for right-turn). The extend parameter specifies how much of a circle is drawn (e.g., 360 for a full circle). A negative extend also changes the direction of the turtle. GOTO x,y - Go to the absolute position (x,y), drawing a line from the current position. The heading of the turtle remains the same. SETX x - Change the absolute x-coordinate. Other properties remain unchanged. SETY y - Change the absolute y-coordinate. Other properties remain unchanged. SETHEADING angle - Set the heading to the absolute angle. The turtle stays in its position. STAMP - Draw a stamp at the current location. The default stamp is an arrow. TELEPORT x,y - Move to the new location (x,y) without drawing a line. This command is currently only supported as the first command in the list. ``` -------------------------------- ### FlexHex2D Pattern Generation (OpenSCAD) Source: https://github.com/stone-age-sculptor/stoneagelib/wiki/Texture Creates a 2D version of the flexible hexagonal pattern. It shares all parameters with FlexHex except for 'h', which is not used in this 2D implementation. Ideal for creating flat patterns or outlines. ```APIDOC FlexHex2D(l, w, grid, gap, irregularity, s) - Generates a 2D flexible hexagonal pattern. - Parameters: - l: length (numeric) - w: Width (numeric) - grid: Spacing of hexagons (numeric) - gap: Spacing between hexagons (numeric) - irregularity: Amount of irregularity in hexagons (0-100, numeric) - s: A seed for random generation. If not provided, a new random seed is chosen each time. - Returns: A 2D shape representing the flexible hexagonal pattern. ``` -------------------------------- ### FlexHex Pattern Generation (OpenSCAD) Source: https://github.com/stone-age-sculptor/stoneagelib/wiki/Texture Generates a flexible hexagonal pattern with adjustable length, width, grid spacing, gap, and irregularity. This function is suitable for creating textured surfaces or interlocking components. It uses a seed for random variations. ```APIDOC FlexHex(l, w, h, grid, gap, irregularity, s) - Generates a flexible hexagonal pattern. - Parameters: - l: length (numeric) - w: Width (numeric) - h: height (numeric) - Note: This parameter is not explicitly used in the description but is listed in the function signature. - grid: Spacing of hexagons (numeric) - gap: Spacing between hexagons (numeric) - irregularity: Amount of irregularity in hexagons (0-100, numeric) - s: A seed for random generation. If not provided, a new random seed is chosen each time. - Returns: A 3D model of the flexible hexagonal pattern. ``` -------------------------------- ### chamfer_extrude Function for 2D to 3D Extrusion (OpenSCAD) Source: https://github.com/stone-age-sculptor/stoneagelib/wiki/Extrude Creates a chamfered extrusion for 2D shapes, allowing specification of common chamfer amounts and angles, with options to override for the top and bottom. Requires OpenSCAD 2025+ for optimal performance; older versions may use a slower fallback. ```OpenSCAD chamfer_extrude(height, chamfer, chamfer_top, chamfer_bottom, angle, angle_top, angle_bottom) Parameters: height: The total height. Default 1. chamfer: The common amount for top and bottom chamfer. Default no chamfer. chamfer_top: The chamfer for the top. Overrides the common chamfer. chamfer_bottom: The chamfer for the bottom. Overrides the common chamfer. angle: The common angle for the chamfer. Default 45 degrees. angle_top: The angle for the top chamfer. Overrides the common angle. angle_bottom: The angle for the bottom chamfer. Overrides the common angle. Notes: A negative chamfer will turn into an inward bevel. The function may fall back to a slow, suboptimal implementation if the 'roof()' function is not available (requires OpenSCAD 2025+). ``` -------------------------------- ### BOSL2 Library Turtle Graphics (2D) Source: https://github.com/stone-age-sculptor/stoneagelib/wiki/Turtle Documentation for the 2D Turtle graphics functionality within the BOSL2 library for OpenSCAD. It is part of the functions for path manipulation. ```OpenSCAD https://github.com/BelfrySCAD/BOSL2/wiki/Tutorial-Paths#turtle-graphics ``` -------------------------------- ### cylinder_fillet Function for Cylinders with Fillets Source: https://github.com/stone-age-sculptor/stoneagelib/wiki/Smoothing The cylinder_fillet function creates a cylinder with optional rounded edges (fillets) and a printable base. Parameters control height, radius, diameter, common fillet, top fillet, bottom fillet, and a printable flag for a 45-degree bottom edge. A torus is used internally for the fillet effect. ```OpenSCAD include // Example: Cylinder with a common fillet of 2 units and a printable bottom cylinder_fillet(h=10, r=5, fillet=2, printable=true); // Example: Cylinder with a specific top fillet of -1 (inward) and no bottom fillet // cylinder_fillet(h=10, r=5, fillet_top=-1, fillet_bottom=0); // Example: Cylinder with a diameter of 20, height of 15, and an outward fillet of 3 // cylinder_fillet(h=15, r=10, d=20, fillet=3); ``` -------------------------------- ### Parse String to Numbers Source: https://github.com/stone-age-sculptor/stoneagelib/wiki/Strings-and-lists Extracts numbers from a string, supporting various separators like spaces, commas, or combinations thereof. Currently, only positive whole integer numbers are supported. Returns a list of the extracted numbers. ```OpenSCAD string_to_numbers(string) -- Parameters: -- string: The input string containing numbers. -- Returns: -- A list of positive whole integer numbers found in the string. -- Example Usage: -- numbers = string_to_numbers("10, 20 30,40"); -- // numbers will be [10, 20, 30, 40] ``` -------------------------------- ### Crease2D Line Generation (OpenSCAD) Source: https://github.com/stone-age-sculptor/stoneagelib/wiki/Texture Draws a single irregular zig-zag line in 2D, suitable for creating creases or details in models. It can be combined with other functions like 'roof()' for specific effects. The line's complexity is determined by the number of pieces and angle variation. ```APIDOC Crease2D(pieces, variation, thickness) - Draws an irregular zig-zag line in 2D. - Parameters: - pieces: The number of segments or pieces for the zig-zag line (integer). - variation: The variation applied to the angles of the zig-zag (default: 50, numeric). - thickness: The width of the line (default: 1.5, numeric). - Returns: A 2D line object representing the zig-zag crease. ``` -------------------------------- ### AI-Generated Python Turtle Graphics Source: https://github.com/stone-age-sculptor/stoneagelib/wiki/Turtle Microsoft Copilot's capability to generate working Python Turtle graphics scripts as of February 2025. Note that direct translation to other Turtle graphics libraries may not always be possible. ```Python # Example of Python Turtle graphics script generation by AI # import turtle # screen = turtle.Screen() # t = turtle.Turtle() # t.forward(100) # turtle.done() ``` -------------------------------- ### Draw7Segment Function for 7-Segment Display Source: https://github.com/stone-age-sculptor/stoneagelib/wiki/7‐Segment-Display The Draw7Segment function renders text as a 7-segment display. It supports numbers 0-9, specific punctuation, and basic alphabets. The function allows customization of spacing, angle, segment shrinkage, and display style. ```APIDOC Draw7Segment(string, spacing, angle, shrink, style) - Renders text as a 7-segment display. - Parameters: - string: The text to display. Supports numbers 0-9, '.', ':', ' ', 'a-z', 'A-Z', ';'. ';' acts as an invisible colon. - spacing: Spacing between the digits. Default: 1.2. - angle: The angle in degrees. Negative values are allowed. Default: 8. - shrink: To shrink the segments. The gap between the segments will become larger and the segments will get thinner. Default: 0.12. - style: There are two styles at the moment: 0 and 1. Default is style 0. - Usage Notes: - Blinking the colon can be achieved by changing the text between "11:38" and "11;38", where ';' is an invisible colon. - Example Script: https://github.com/Stone-Age-Sculptor/StoneAgeLib/blob/main/examples/Demonstration7segments.scad ``` -------------------------------- ### Subdivision Function for Smooth Curves Source: https://github.com/stone-age-sculptor/stoneagelib/wiki/Smoothing The Subdivision function generates smooth curves from a list of control points. It accepts a list of points, a number of divisions (iterations), and a method ('1', 'weighted', '1path', 'weightedpath') for subdivision. It can be used for both 2D and 3D shapes. ```OpenSCAD include test_shape = [[-10,-10],[0,0],[7,0],[7,5],[7.5,5],[7.5,0],[8,0],[8,5],[11,5],[11,0],[14,0],[14,5],[16,5],[16,0],[18,0],[18,5],[5,12],[5,8],[6,6],[4,1],[0,5]]; shape_weighted = Subdivision(test_shape, divisions=4, method="weighted"); polygon(shape_weighted); ``` -------------------------------- ### Hue Function for OpenSCAD Color Source: https://github.com/stone-age-sculptor/stoneagelib/wiki/Color The Hue() function translates a hue value (0-360) into an OpenSCAD color format, which can then be used with the OpenSCAD 'color()' function. This aids in visually distinguishing different parts of a 3D model. ```OpenSCAD color(Hue(195)) ``` ```APIDOC Hue(hue) Translates the hue value into an OpenSCAD color value for color(). Parameters: hue: The hue from 0 to 360. Usage: color(Hue(195)) ``` -------------------------------- ### Cumulative Vector Addition Source: https://github.com/stone-age-sculptor/stoneagelib/wiki/Strings-and-lists Performs cumulative addition on a list of vectors, where each element is the sum of all preceding elements. Supports both 2D and 3D vectors. ```OpenSCAD vector_add(v) -- Parameters: -- v: A list of vectors (e.g., [[x1, y1], [x2, y2]] or [[x1, y1, z1], [x2, y2, z2]]). -- Returns: -- A list where each element is the cumulative sum of the input vectors. -- Example Usage (2D): -- vectors = [[1, 1], [2, 3], [4, 0]]; -- cumulative_vectors = vector_add(vectors); -- // cumulative_vectors will be [[1, 1], [3, 4], [7, 4]] ``` -------------------------------- ### Render Text with Subdivision Font Source: https://github.com/stone-age-sculptor/stoneagelib/wiki/Subdivision-Font The text_subdivision function renders text in 2D using a subdivision-based font. It supports various parameters to control text appearance, including size, font type, character spacing, line spacing, weight, and slant. Newlines and tabs are also supported. ```openscad text_subdivision("Multiline and tab are supported.\nNext line.\n\tFirst tab position\n\t\tSecond tab position."); ``` -------------------------------- ### Dimples Surface Generation (OpenSCAD) Source: https://github.com/stone-age-sculptor/stoneagelib/wiki/Texture Applies a dimpled texture to a flat surface by removing many small indentations. This function aims to give a more natural appearance to flat areas. It is controlled by the size of the area and the density of the dimples. ```APIDOC Dimples(xsize, ysize, density) - Creates a surface with a dimpled texture. - Parameters: - xsize: The size of the area in the x-direction (numeric). - ysize: The size of the area in the y-direction (numeric). - density: The density of the dimples (default: 100, numeric). - Returns: A 3D model of a surface with dimples. ``` -------------------------------- ### Perspective Function (OpenSCAD) Source: https://github.com/stone-age-sculptor/stoneagelib/wiki/Perspective The Perspective function transforms a 2D shape into a 2D shape with perspective, leveraging OpenSCAD's linear_extrude functionality. A version of OpenSCAD newer than 2021 is required for this feature. While not strictly mathematical, the results are generally usable for visual effects. ```OpenSCAD /** * Adds perspective to a 2D shape. * * @param strength The strength of the perspective effect, from 0 to 1. * @param y The y-coordinate of the vanishing point. * @return A 2D shape with perspective. */ function Perspective(strength, y) = [ // Implementation details would go here, referencing OpenSCAD's linear_extrude with a perspective vector. // Example placeholder for function signature: // linear_extrude(height = 1, scale = [1, 1], convexity = 10, center = false, // slices = 2, layer_start = 0, layer_end = 0, // twist = 0, slices_per_360 = 0, // v = [0, 0, 0]) // 'v' parameter is used for perspective in newer versions ]; // Example usage (conceptual): // module myShape() { // polygon(points=[[0,0],[10,0],[10,10],[0,10]]); // } // // translate([50, 0, 0]) // Perspective(strength = 0.5, y = 100) myShape(); ``` -------------------------------- ### Generate Non-Overlapping Points Source: https://github.com/stone-age-sculptor/stoneagelib/wiki/Strings-and-lists Creates a list of random points within a specified area, ensuring a minimum distance between all points. The actual number of points generated may be less than requested due to the distance constraint. Useful for decorative elements in designs. ```OpenSCAD RandomNonOverlap(n, area, dist) -- Parameters: -- n: The desired number of points. The actual count may be lower. -- area: The bounding area for point generation. -- dist: The minimum required distance between any two points. -- Example Usage: -- points = RandomNonOverlap(100, [100, 100], 5); -- for (i = [0 : len(points) - 1]) { -- translate(points[i]) circle(r=1); -- } ``` -------------------------------- ### FontDesigner Function for Character Design Source: https://github.com/stone-age-sculptor/stoneagelib/wiki/Subdivision-Font The FontDesigner function is used to design characters, displaying all characters of a given font along with their control points. It allows customization of font properties like weight and slanting. ```APIDOC FontDesigner(font, weight, slanting, method, smooth, fontdefinition) - Designs characters and displays control points. - Parameters: - font: The name of the font. - weight: The weight or thickness of the font. - slanting: Tilt the characters to the right or left. - method: The method for subdivision. - smooth: The number of subdivision iterations. - fontdefinition: A list of user font definitions. ``` -------------------------------- ### Circle Geometry Functions Source: https://github.com/stone-age-sculptor/stoneagelib/wiki/Tangent-Lines-to-a-Circle Provides functions for calculating various geometric relationships between circles and lines, essential for precise mechanical part design. ```APIDOC TangentPoints(Centre, Radius, Point) - Calculates the tangent points on a circle from an external point. - Parameters: - Centre: The center coordinates of the circle (e.g., [x, y] or [x, y, z]). - Radius: The radius of the circle. - Point: The external point from which tangents are drawn (e.g., [x, y] or [x, y, z]). - Returns: A list containing two points on the circle where the tangent lines from the given Point touch the circle. PointForInternal(Centre1, Radius1, Centre2, Radius2) - Calculates the internal tangent point between two circles. - Parameters: - Centre1: The center coordinates of the first circle. - Radius1: The radius of the first circle. - Centre2: The center coordinates of the second circle. - Radius2: The radius of the second circle. - Returns: The coordinates of the internal tangent point. PointForExternal(Centre1, Radius1, Centre2, Radius2) - Calculates the external tangent point of two circles. - Parameters: - Centre1: The center coordinates of the first circle. - Radius1: The radius of the first circle. - Centre2: The center coordinates of the second circle. - Radius2: The radius of the second circle. - Returns: The coordinates of the external tangent point. IntersectionPoints(Center1, Radius1, Center2, Radius2) - Returns the intersection points when two circles overlap. - Parameters: - Center1: The center coordinates of the first circle. - Radius1: The radius of the first circle. - Center2: The center coordinates of the second circle. - Radius2: The radius of the second circle. - Returns: A list of two points representing the intersections of the circles. TouchPoint(Center1, Radius1, Center2, Radius2) - Returns the coordinates of the point where two circles touch. - This function is robust and returns a touch point even if circles are slightly too far apart or overlapping. - Parameters: - Center1: The center coordinates of the first circle. - Radius1: The radius of the first circle. - Center2: The center coordinates of the second circle. - Radius2: The radius of the second circle. - Returns: The coordinates of the touch point between the two circles. ``` -------------------------------- ### Reverse List Order Source: https://github.com/stone-age-sculptor/stoneagelib/wiki/Strings-and-lists Reverses the order of elements in a given list. The function returns the list with its elements in the opposite sequence. ```OpenSCAD ReverseList(list) -- Parameters: -- list: The input list to be reversed. -- Returns: -- The list with elements in reverse order. -- Example Usage: -- original_list = ["a", "b", "c"]; -- reversed_list = ReverseList(original_list); -- // reversed_list will be ["c", "b", "a"] ``` -------------------------------- ### outward_bevel_extrude Function for 2D to 3D Extrusion (OpenSCAD) Source: https://github.com/stone-age-sculptor/stoneagelib/wiki/Extrude Creates an outward bevel extrusion for 2D shapes, allowing specification of common bevel amounts, with options to override for the top and bottom. Negative values can create inward bevels. ```OpenSCAD outward_bevel_extrude(height, bevel, bevel_top, bevel_bottom) Parameters: height: The total height. Default 1. bevel: The common amount for the outward bevel. Default no bevel. bevel_top: The outward bevel for the top. Overrides the common bevel. bevel_bottom: The outward bevel for the bottom. Overrides the common bevel. Notes: A negative chamfer value will turn into an inward bevel, similar to cylinder_fillet(). ``` -------------------------------- ### Shuffle List Elements Source: https://github.com/stone-age-sculptor/stoneagelib/wiki/Strings-and-lists Randomly shuffles the order of elements within a given list. The original list is modified in place or a new shuffled list is returned. ```OpenSCAD ShuffleList(list) -- Parameters: -- list: The list whose elements are to be shuffled. -- Returns: -- The list with its elements randomly reordered. -- Example Usage: -- my_list = [1, 2, 3, 4, 5]; -- shuffled_list = ShuffleList(my_list); -- // shuffled_list might be [3, 1, 5, 2, 4] ``` -------------------------------- ### InverseMinkowski Function (SCAD) Source: https://github.com/stone-age-sculptor/stoneagelib/wiki/Smoothing The InverseMinkowski() function transforms a 3D shape into a smooth one by applying a Minkowski filter with a sphere over the negative shape. It is intended for objects within specific coordinate ranges and is noted for being very slow and potentially unreliable, with a recommendation to use alternative methods if possible. ```SCAD InverseMinkowski(radius, extra = false) // Turns a 3D shape into a smooth shape. // The object should be in the area between -50 to 50 for x and y and between 0 and 50 for z. // This function is very slow and it might not work. // There are other libraries that use polyhedrons to make smooth 3D shapes. // Use this function as a last option, but it is better to not use this function at all. // The inverse minkowski uses a minkowski() filter with a sphere over the negative shape. // Parameters: // radius: The radius for the edges. // extra: Extra accuracy in render mode. Default false. ``` -------------------------------- ### Shadow2D Function for 2D Shadows Source: https://github.com/stone-age-sculptor/stoneagelib/wiki/Shadow2D The Shadow2D function generates a 2D shadow for any 2D shape, primarily intended for text. It creates only the shadow, not the original shape. The function allows customization of shadow length, angle, width, and the addition of highlights. ```APIDOC Shadow2D(length, angle, width, highlight) - Creates a 2D shadow for a 2D shape. - Parameters: - length: The length of the shadow. - angle: The angle of the shadow. Defaults to -45 degrees (lower-right). - width: The width of an outline around the text. - highlight: Boolean to create a highlight. Defaults to false. - Returns: A 2D shadow object. - Usage Notes: - Primarily useful for text effects. - Can be combined with fonts and other shapes for artistic designs. - Examples demonstrate its use with different fonts and shapes. ``` ```OpenSCAD // Example usage of Shadow2D (conceptual, actual implementation not provided in text) // module Shadow2D(length, angle, width, highlight) { // // ... implementation details ... // } ``` -------------------------------- ### Round2D Function for Corner Rounding Source: https://github.com/stone-age-sculptor/stoneagelib/wiki/Smoothing The Round2D function applies arcs to the inside and outside corners of a shape using offset operations. It takes a radius parameter to define the arc size for the corners. This function is useful for smoothing sharp edges in 2D designs. ```OpenSCAD include test_shape = [[-10,-10],[0,0],[7,0],[7,5],[7.5,5],[7.5,0],[8,0],[8,5],[11,5],[11,0],[14,0],[14,5],[16,5],[16,0],[18,0],[18,5],[5,12],[5,8],[6,6],[4,1],[0,5]]; polygon(test_shape); translate([0,-14]) Round2D(1) polygon(test_shape); ``` -------------------------------- ### Translate 2D Shape Coordinates Source: https://github.com/stone-age-sculptor/stoneagelib/wiki/Strings-and-lists Translates a 2D shape, represented by a list of coordinates, by a given 2D point. This function moves the shape without rotation or scaling. ```OpenSCAD TranslateList(list, point) -- Parameters: -- list: A list of 2D coordinates representing the shape (e.g., [[x1, y1], [x2, y2]]). -- point: A 2D coordinate [dx, dy] specifying the translation vector. -- Returns: -- A new list of coordinates representing the translated shape. -- Example Usage: -- shape_coords = [[1, 1], [2, 2]]; -- translation_vector = [5, 3]; -- translated_shape = TranslateList(shape_coords, translation_vector); -- // translated_shape will be [[6, 4], [7, 5]] ```