← Ecky CAD / Ecky Language Reference

REFERENCE / 09

Primitive Signatures

Solid primitives create volume. Sketch primitives create profiles for extrude, revolve, or another operation that needs a cross-section. Dimensions below are in millimetres.

box

(box width depth height [:align '(x y z)]) → Solid.

X and Y are centered by default; Z starts at 0. A 60 × 30 × 4 box therefore spans X = −30…30, Y = −15…15, and Z = 0…4. Dimensions must be positive.

(model
  (part plate (box 60 30 4)))

:align takes three values, each min, center, or max. min places the lower bound of that axis at the origin; max places its upper bound there.

sphere

(sphere radius [:align '(x y z)]) → Solid.

The sphere is centered on all three axes by default. Radius is half the diameter: (sphere 10) has a 20 mm diameter.

cylinder

(cylinder radius height [:align '(x y z)]) → Solid.

The axis is Z. X and Y are centered; the base starts at Z = 0. The first argument is radius, not diameter. (cylinder 3 8) is 6 mm across and 8 mm tall.

The cross-section is circular on every backend. For a hexagonal prism, use (extrude (regular-polygon 6 radius) height). Round primitives do not accept a segment count; tessellation belongs to rendering.

cone

(cone radius1 radius2 height [:align '(x y z)]) → Solid.

radius1 is the bottom radius and radius2 the top radius. The axis is Z, with its base at 0 by default. Set one radius to zero for a pointed cone; keep both positive for a truncated cone.

circle

(circle radius) → Sketch.

A circular profile in XY, centered at the origin. It has no height until used by an operation such as (extrude (circle 8) 4).

rectangle

(rectangle width height) → Sketch.

A centered rectangle in XY. Its second dimension is along Y, not an extrusion height.

rounded-rect

(rounded-rect width height radius) → Sketch.

A centered rectangle with rounded corners. radius controls the corner arcs. Choose a radius no larger than half the shorter dimension.

rounded-polygon

(rounded-polygon points radius [segments]) → Sketch.

Round the corners of a polygon defined by 2D points. The radius must fit the neighboring edges. Start with a small radius if the rounding fails.

polygon

(polygon points) → Sketch.

The points are an ordered list of XY coordinates. The boundary closes from the last point to the first. Use at least three non-collinear points and avoid a self-intersecting outline.

(model
  (part wedge
    (extrude (polygon ((0 0) (30 0) (0 20))) 4)))

profile

(profile loop1 loop2 ...) → Sketch.

The explicit hole form is (profile :outer outer-loop :holes hole-loop-or-list). It accepts one outer loop and the enclosed holes. Use it when the hole is part of the cross-section, before extrusion.

(model
  (part washer
    (extrude (profile :outer (circle 12) :holes (circle 4)) 2)))

make-face

(make-face wire1 wire2 ...) → Sketch.

Build a face from wire-like loops. Use this when the boundary already exists as wires; use profile when explicitly combining an outer profile and holes.

text

(text string size [:font selector]) → Sketch.

size sets text size. :font accepts an installed font family or an absolute .ttf/.otf path. It belongs to text, not to the following extrusion. The requested font must exist on the machine doing the render.

(model
  (part label
    (extrude (text "OPEN" 12 :font "Arial") 2)))

svg

(svg path) → Sketch on the native renderer.

Import an SVG profile and use it in a geometry operation. The optional target-width, target-height, and fit-mode positional arguments belong to the FreeCAD interop form; they are not the native signature. Its fit modes are "contain", "cover", "stretch", and "fill".

import-stl

(import-stl path) → imported mesh geometry.

Read triangles from an STL file. Importing a mesh does not recover its original analytic surfaces. A later solidify operation can make an eligible closed mesh usable in the mesh-to-solid path; it does not reconstruct the original CAD design.

ring

(ring outer-radius inner-radius) → Sketch.

A centered circular profile with a circular hole. The inner radius must be smaller than the outer radius. (extrude (ring 12 4) 2) makes the same washer cross-section as the profile example above.