### Install GHC and cabal on Debian/Ubuntu Source: https://implicitcad.org/docs/install Use apt-get to install the necessary Haskell build tools. ```bash apt-get install ghc cabal-install ``` -------------------------------- ### Install GHC and cabal on Archlinux Source: https://implicitcad.org/docs/install Use pacman to install the necessary Haskell build tools. ```bash pacman -S ghc cabal-install ``` -------------------------------- ### Install latest ImplicitCAD release Source: https://implicitcad.org/docs/install Use cabal to update and install the latest version of ImplicitCAD. ```bash cabal update && cabal install implicit ``` -------------------------------- ### Output of variable reassignment example Source: https://implicitcad.org/docs/faq The console output resulting from the variable reassignment loop example. ```text 1.0 5.0 2.0 10.0 3.0 30.0 ``` -------------------------------- ### Build ImplicitCAD development version Source: https://implicitcad.org/docs/install Install dependencies, clone the repository, and build the project. ```bash cabal update && cabal install hashmap parallel parsec plugins JuicyPixels blaze-builder blaze-markup blaze-svg storable-endian unordered-containers vector-space ``` ```bash git clone https://github.com/colah/ImplicitCAD.git ``` ```bash cd ImplicitCAD/ ``` ```bash cabal configure && cabal install ``` -------------------------------- ### Install GHC and cabal on Red Hat/Fedora Source: https://implicitcad.org/docs/install Use yum to install the necessary Haskell build tools. ```bash yum install ghc cabal-install ``` -------------------------------- ### Install GHC and cabal on Mac OSX via Homebrew Source: https://implicitcad.org/docs/install Use Homebrew to install the necessary Haskell build tools. ```bash brew install ghc cabal-install ``` -------------------------------- ### Implicit union behavior Source: https://implicitcad.org/docs/faq Example showing that ImplicitCAD does not perform implicit unions, resulting in only the first sphere being rendered. ```text sphere(10); translate([20,0,0]) sphere(5); ``` -------------------------------- ### Run extopenscad to render STL and view with meshlab Source: https://implicitcad.org/docs/tutorial Command-line usage of the extopenscad compiler to convert a .escad file to STL, then open the result in meshlab. The output shows the rendering message. ```bash $ extopenscad test.escad test.stl Rendering 3D object to test.stl ... $ meshlab test.stl ``` -------------------------------- ### Variable reassignment in extopenscad Source: https://implicitcad.org/docs/faq Demonstrates the use of variables and loops in extopenscad, which supports proper variable computation unlike OpenSCAD. ```text a = 5; for (c = [1, 2, 3]) { echo(c); a = a*c; echo(a); } ``` -------------------------------- ### Create a regular hexagon with circle and $fn Source: https://implicitcad.org/docs/tutorial Uses the $fn parameter to create a regular polygon (hexagon) from the circle primitive. ```extopenscad circle(10, $fn=6); ``` -------------------------------- ### shell Source: https://implicitcad.org/docs/api Creates a shell of a given width around a shape. ```APIDOC ## shell ### Description Creates a shell of a given width around a shape. ### Syntax `shell(w)` ### Parameters - **w** (number) - Required - Width of the shell. ### Usage `shell(w) { ... }` ``` -------------------------------- ### Create a sphere with radius 10 Source: https://implicitcad.org/docs/tutorial Creates a 3D sphere with radius 10. ```extopenscad sphere(10); ``` -------------------------------- ### cube primitive Source: https://implicitcad.org/docs/api Creates a cube with specified dimensions, centering, and optional rounding. ```ImplicitCAD cube(size = [2,3,4], center = true, r = 0.5); ``` ```ImplicitCAD cube(4); ``` -------------------------------- ### sphere primitive Source: https://implicitcad.org/docs/api Creates a sphere using a radius argument. ```ImplicitCAD sphere(3); ``` ```ImplicitCAD sphere(r=5); ``` -------------------------------- ### Create a circle with radius 10 Source: https://implicitcad.org/docs/tutorial Creates a 2D circle with radius 10 (default units are millimeters). The $fn parameter can be used to create regular polygons. ```extopenscad circle(10); ``` -------------------------------- ### circle primitive Source: https://implicitcad.org/docs/api Creates a 2D circle or regular polygon. ```ImplicitCAD circle(r=10); // circle ``` ```ImplicitCAD circle(r=5, $fn=6); //hexagon ``` -------------------------------- ### pack transformation Source: https://implicitcad.org/docs/api Arranges objects within a 2D box. ```ImplicitCAD pack ([45,45], sep=2) { circle(10); circle(10); circle(10); circle(10); } ``` -------------------------------- ### cylinder primitive Source: https://implicitcad.org/docs/api Creates a cylinder or prism with specified radii, height, and optional centering. ```ImplicitCAD cylinder(r=10, h=30, center=true); ``` ```ImplicitCAD cylinder(r1=4, r2=6, h=10); ``` ```ImplicitCAD cylinder(r=5, h=10, $fn = 6); ``` -------------------------------- ### cube Source: https://implicitcad.org/docs/api Creates a cube or rectangular box. Supports specifying size as a vector or individual dimensions, with optional centering and rounding. ```APIDOC ## cube ### Description Creates a cube or rectangular box. ### Syntax `cube(size, center, r)` ### Parameters - **size** (vector or number) - Required - Cube size. - **center** (boolean) - Optional - Should center? (non-intervals). Default: False. - **r** (number) - Optional - Radius of rounding. Default: 0.0. ### Syntax 1 `cube(x, y, z, center)` ### Parameters - **x** (number or interval) - Required - x or x-interval. - **y** (number or interval) - Required - y or y-interval. - **z** (number or interval) - Required - z or z-interval. - **center** (boolean) - Optional - Should center? (non-intervals). Default: False. ### Examples - `cube(size = [2,3,4], center = true, r = 0.5);` n- `cube(4);` ``` -------------------------------- ### pack Source: https://implicitcad.org/docs/api Packs multiple 2D objects into a specified box size with a mandatory separation. ```APIDOC ## pack ### Description Packs multiple 2D objects into a specified box size. ### Syntax `pack(size, sep)` n ### Parameters - **size** (vector) - Required - Size of 2D box to pack objects within. - **sep** (number) - Required - Mandatory space between objects. ### Examples - `pack ([45,45], sep=2) { circle(10); circle(10); circle(10); circle(10); }` ``` -------------------------------- ### unit setting Source: https://implicitcad.org/docs/api Sets the working unit for the geometry. ```ImplicitCAD unit("inch") {..} ``` -------------------------------- ### polygon Source: https://implicitcad.org/docs/api Creates a polygon from a list of vertices. Supports optional paths and rounding. ```APIDOC ## polygon ### Description Creates a polygon from a list of vertices. ### Syntax `polygon(points, paths, r)` n ### Parameters - **points** (list of tuples) - Required - Vertices of the polygon. - **paths** (list) - Optional - Order to go through vertices; ignored for now. Default: []. - **r** (number) - Optional - Rounding of the polygon corners; ignored for now. Default: 0.0. ### Examples - `polygon ([(0,0), (0,10), (10,0)]);` ``` -------------------------------- ### polygon primitive Source: https://implicitcad.org/docs/api Creates a 2D polygon from a set of vertices. ```ImplicitCAD polygon ([(0,0), (0,10), (10,0)]); ``` -------------------------------- ### square primitive Source: https://implicitcad.org/docs/api Creates a 2D square or rectangle with specified bounds, size, centering, and optional rounding. ```ImplicitCAD square(x=[-2,2], y=[-1,5]); ``` ```ImplicitCAD square(size = [3,4], center = true, r = 0.5); ``` ```ImplicitCAD square(4); ``` -------------------------------- ### circle Source: https://implicitcad.org/docs/api Creates a 2D circle or regular polygon. The number of sides can be controlled with $fn. ```APIDOC ## circle ### Description Creates a 2D circle or regular polygon. ### Syntax `circle(r, $fn)` ### Parameters - **r** (number) - Required - Radius of the circle. - **$fn** (number) - Optional - If defined, makes a regular polygon with n sides instead of a circle. Default: -1.0. ### Examples - `circle(r=10); // circle` n- `circle(r=5, $fn=6); //hexagon` ``` -------------------------------- ### Linear extrude with scaling during extrusion Source: https://implicitcad.org/docs/tutorial Extrudes a circle while scaling it as a function of height h. ```extopenscad linear_extrude(20, scale(h) = 1 + cos(h)/10) circle(30); ``` -------------------------------- ### unit Source: https://implicitcad.org/docs/api Sets the unit of measurement for the design. ```APIDOC ## unit ### Description Sets the unit of measurement for the design. ### Syntax `unit(unit)` ### Parameters - **unit** (string) - Required - The unit you wish to work in. ### Examples - `unit("inch") {..}` ``` -------------------------------- ### Linear extrude with constant height Source: https://implicitcad.org/docs/tutorial Extrudes a 2D circle to a 3D object with a constant height of 20. ```extopenscad linear_extrude(height = 20) circle(30); ``` -------------------------------- ### linear_extrude Source: https://implicitcad.org/docs/api Extrudes a 2D shape linearly to create a 3D shape. Supports height, centering, twist, scale, translate, and rounding. ```APIDOC ## linear_extrude ### Description Extrudes a 2D shape linearly to create a 3D shape. ### Syntax `linear_extrude(height, center, twist, scale, translate, r)` n ### Parameters - **height** (number) - Optional - Height to extrude to. Default: 1.0. - **center** (boolean) - Optional - Center? (the z component). Default: False. - **twist** (number or function) - Optional - Twist as we extrude, either a total amount to twist or a function. Default: Undefined. - **scale** (number or function) - Optional - Scale according to this function as we extrude. Default: Undefined. - **translate** (number or function) - Optional - Translate according to this function as we extrude. Default: Undefined. - **r** (number) - Optional - Round the top? Default: 0.0. ### Examples - `linear_extrude(10) square(5);` ``` -------------------------------- ### Explicit union usage Source: https://implicitcad.org/docs/faq Correct way to combine multiple objects in ImplicitCAD using the union function. ```text union(){ sphere(10); translate([20,0,0]) sphere(5); } ``` -------------------------------- ### Create a rounded rectangle with square Source: https://implicitcad.org/docs/tutorial Creates a rectangle of size [10,20] with rounded corners of radius 3. ```extopenscad square([10,20], r=3); ``` -------------------------------- ### cylinder Source: https://implicitcad.org/docs/api Creates a cylinder or cone. Supports specifying radius, height, bottom/top radii, number of sides, and centering. ```APIDOC ## cylinder ### Description Creates a cylinder or cone. ### Syntax `cylinder(r, h, r1, r2, $fn, center)` n ### Parameters - **r** (number) - Optional - Radius of cylinder. Default: 1.0. - **h** (number) - Optional - Height of cylinder. Default: 1.0. - **r1** (number) - Optional - Bottom radius; overrides r. Default: 1.0. - **r2** (number) - Optional - Top radius; overrides r. Default: 1.0. - **$fn** (number) - Optional - Number of sides, for making prisms. Default: -1.0. - **center** (boolean) - Optional - Center cylinder with respect to z? Default: False. ### Examples - `cylinder(r=10, h=30, center=true);` n- `cylinder(r1=4, r2=6, h=10);` n- `cylinder(r=5, h=10, $fn = 6);` ``` -------------------------------- ### Difference with rounding Source: https://implicitcad.org/docs/tutorial Cuts away the second square from the first using difference, with rounding r=3. ```extopenscad difference(r=3) { square(20); translate([10,10]) square(20); } ``` -------------------------------- ### square Source: https://implicitcad.org/docs/api Creates a 2D square or rectangle. Supports specifying size as a vector or individual dimensions, with optional centering and rounding. ```APIDOC ## square ### Description Creates a 2D square or rectangle. ### Syntax `square(size, center, r)` n ### Parameters - **size** (vector or number) - Required - Square size. - **center** (boolean) - Optional - Should center? (non-intervals). Default: False. - **r** (number) - Optional - Radius of rounding. Default: 0.0. ### Syntax 1 `square(x, y, center)` n ### Parameters - **x** (number or interval) - Required - x or x-interval. - **y** (number or interval) - Required - y or y-interval. - **center** (boolean) - Optional - Should center? (non-intervals). Default: False. ### Examples - `square(x=[-2,2], y=[-1,5]);` n- `square(size = [3,4], center = true, r = 0.5);` n- `square(4);` ``` -------------------------------- ### sphere Source: https://implicitcad.org/docs/api Creates a sphere with a given radius. The radius can be specified as a positional argument or using the named parameter r. ```APIDOC ## sphere ### Description Creates a sphere with a given radius. ### Syntax `sphere(r)` ### Parameters - **r** (number) - Required - Radius of the sphere. ### Examples - `sphere(3);` - `sphere(r=5);` ``` -------------------------------- ### Union two squares with translation Source: https://implicitcad.org/docs/tutorial Combines two squares using union, with the second square translated by [10,10]. ```extopenscad union() { square(20); translate([10,10]) square(20); } ``` -------------------------------- ### translate transformation Source: https://implicitcad.org/docs/api Moves an object by a specified vector. ```ImplicitCAD translate ([2,3]) circle (4); ``` ```ImplicitCAD translate ([5,6,7]) sphere(5); ``` -------------------------------- ### Linear extrude with height function Source: https://implicitcad.org/docs/tutorial Extrudes a circle with a height that varies as a function of x and y. ```extopenscad linear_extrude(height(x,y) = 20 + (y^2-x^2)/60) circle(30); ``` -------------------------------- ### scale transformation Source: https://implicitcad.org/docs/api Resizes an object using a scalar or vector. ```ImplicitCAD scale(2) square(5); ``` ```ImplicitCAD scale([2,3]) square(5); ``` ```ImplicitCAD scale([2,3,4]) cube(5); ``` -------------------------------- ### linear_extrude transformation Source: https://implicitcad.org/docs/api Extrudes a 2D shape along the Z-axis. ```ImplicitCAD linear_extrude(10) square(5); ``` -------------------------------- ### rotate_extrude Source: https://implicitcad.org/docs/api Extrudes a 2D shape by rotating it around an axis. Supports angle, rounding, translation, and rotation. ```APIDOC ## rotate_extrude ### Description Extrudes a 2D shape by rotating it around an axis. ### Syntax `rotate_extrude(a, r, translate, rotate)` ### Parameters - **a** (number) - Optional - Angle to sweep. Default: 360.0. - **r** (number) - Optional - Default: 0.0. - **translate** (vector) - Optional - Default: [0.0,0.0]. - **rotate** (number) - Optional - Default: 0.0. ### Examples - `rotate_extrude() translate(20) circle(10);` ``` -------------------------------- ### Union with rounding (beveling) Source: https://implicitcad.org/docs/tutorial Union with r=3 rounds (bevels) the interface between the two squares. ```extopenscad union(r=3) { square(20); translate([10,10]) square(20); } ``` -------------------------------- ### rotate_extrude transformation Source: https://implicitcad.org/docs/api Sweeps a 2D shape around an axis. ```ImplicitCAD rotate_extrude() translate(20) circle(10); ``` -------------------------------- ### scale Source: https://implicitcad.org/docs/api Scales a shape by a scalar or vector. ```APIDOC ## scale ### Description Scales a shape by a scalar or vector. ### Syntax `scale(v)` n ### Parameters - **v** (vector or scalar) - Required - Vector or scalar to scale by. ### Examples - `scale(2) square(5);` n- `scale([2,3]) square(5);` n- `scale([2,3,4]) cube(5);` ``` -------------------------------- ### intersection Source: https://implicitcad.org/docs/api Computes the intersection of multiple shapes. Supports optional rounding of the intersection interface. ```APIDOC ## intersection ### Description Computes the intersection of multiple shapes. ### Syntax `intersection(r)` n ### Parameters - **r** (number) - Optional - Radius of rounding for the intersection interface. Default: 0.0. ### Usage `intersection() { ... }` ``` -------------------------------- ### difference Source: https://implicitcad.org/docs/api Subtracts one shape from another. Supports optional rounding of the difference interface. ```APIDOC ## difference ### Description Subtracts one shape from another. ### Syntax `difference(r)` n ### Parameters - **r** (number) - Optional - Radius of rounding for the difference interface. Default: 0.0. ### Usage `difference() { ... }` ``` -------------------------------- ### union Source: https://implicitcad.org/docs/api Combines multiple shapes into a single shape. Supports optional rounding of the union interface. ```APIDOC ## union ### Description Combines multiple shapes into a single shape. ### Syntax `union(r)` n ### Parameters - **r** (number) - Optional - Radius of rounding for the union interface. Default: 0.0. ### Usage `union() { ... }` ``` -------------------------------- ### translate Source: https://implicitcad.org/docs/api Translates a shape by a given vector or individual coordinates. ```APIDOC ## translate ### Description Translates a shape by a given vector or individual coordinates. ### Syntax `translate(v)` n ### Parameters - **v** (vector) - Required - Vector to translate by. ### Syntax 1 `translate(x, y, z)` n ### Parameters - **x** (number) - Required - x amount to translate. - **y** (number) - Required - y amount to translate. - **z** (number) - Optional - z amount to translate. Default: 0.0. ### Examples - `translate ([2,3]) circle (4);` n- `translate ([5,6,7]) sphere(5);` ``` -------------------------------- ### rotate Source: https://implicitcad.org/docs/api Rotates a shape by an angle or list of angles, optionally around a specified vector. ```APIDOC ## rotate ### Description Rotates a shape by an angle or list of angles. ### Syntax `rotate(a, v)` n ### Parameters - **a** (number or list) - Required - Value to rotate by; angle or list of angles. - **v** (vector) - Optional - Vector to rotate around if a is a single angle. Default: [0.0,0.0,1.0]. n ### Usage `rotate(a) { ... }` ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.