Skip to content

Additional Eidolang constructions ​

These commands are part of the current language in both the App and Viewer. They do not change the .eido manifest or persisted workspace format. Use space plane or space solid in separate figures. All constructions below are derived; move their defining points or animate a param to change them. Names such as e, sphere, and surface are reserved.

Toolbox ​

Expand a group in the left toolbox and choose a tool, then pick objects on the canvas or in the Objects list in the prompted order. The command palette activates the same tools. Picks are highlighted; wrong types are ignored. When the step asks for a point, a click where no point exists creates one, with the same snapping as the drawing tools: an existing point nearby is reused, a click on or near a curve makes a point bound to it, and anywhere else makes a free point (in 3D, docked to a nearby object or on the placement plane — z = 0 unless the status bar's place z says otherwise). New points appear right away but are written to the script only together with the construction. When the step asks for anything else, an empty click creates nothing. Backspace or Undo last pick removes the last choice, including a point it created; Escape or Cancel picks clears the unfinished construction without editing source. Creation validates geometry, selects the result and records one undo step, new points included. Measurements and projections remain expressions referencing the picked objects, so moving the inputs updates the result.

Tools share categories by geometry and purpose. Group tooltips show the category, and each group remembers its last-used tool. The rail and command palette use the same tool table; existing keyboard shortcuts remain available.

SpaceCategoryTools
2DPoints and centersPoint, incenter, circumcenter, orthocenter, centroid
2DLinear objectsSegment, vector, line, ray
2DAuxiliary linesPerpendicular, parallel, tangent, normal, tangents from a point, angle bisector
2DCircles and arcsCircle, arc, circumcircle, incircle
2DConicsEllipse, parabola, hyperbola
2DCurvesBézier, spline
2DPolygons and regionsRegular polygon, sector, circular segment, inequality
3DLinear objectsSegment3, vector3, line3
3DSpace circles and curvesCircle3, arc3, ellipse3
3DPlanar figures and sectionsPlane, polygon3, section
3DPolyhedraBox, prism, pyramid, polyhedron, pyramid frustum
3DCylinders, cones and frustumsCylinder, cone, circular frustum
3DSpheres and spherical partsSphere, cap, hemisphere, zone, sector
3DGenerated geometryExtrude, revolve
3DMathematical surfacesParametric surface, implicit surface

Pointer, the 3D point tool, and the 2D text box keep separate rail slots. Space line (L) takes two distinct existing points and creates line3; Plane takes three non-collinear existing points. Create or lift points with Point3 first when needed. The resulting line can be a revolution axis, and the plane can be a cutting plane for Section. Both retain references to their input points and use the validated picking flow described above.

ToolPick order
Tangent / normalCurve, point (projected onto the curve)
Tangents from a pointCircle, external point
Angle bisectorPoint, vertex, point; then choose internal/external
Triangle circles / centersThree triangle vertices
ParabolaFocus, directrix line, segment, or ray
HyperbolaFocus 1, focus 2, point on the curve
Bézier / splineOrdered control points; Enter or Finish completes the list (Bézier also completes at four points)
Regular polygonCenter, vertex; then set the number of sides
Sector / circular segmentCenter, start radius point, end direction point (counterclockwise)
Space line / planeTwo distinct points / three non-collinear points
circle3 / arc3Three points; the middle arc point lies on the arc
ellipse3Center, major-axis endpoint, minor-axis measuring point; the third point defines the plane and its perpendicular distance defines the second radius
polygon3 / polyhedronOrdered vertices / polygon faces; Enter, Finish, or pick the first object again to finish
SectionSolid, cutting plane
Circular frustumBase center, base radius point, top center, top radius point
Pyramid frustumBase polygon, top center, top radius point (relative to the base's first vertex)
ExtrudeProfile, vector or segment defining the extrusion displacement
RevolveProfile, axis line (full revolution)
Spherical piecesSphere, normal vector / segment / line / ray / plane; cap and sector then take a cutting-plane point, zone takes two; hemisphere needs no cut point
Inequality / equation3 / parametric surfaceTwo domain corners, then the mathematical expression

Variable-length lists require at least three points for a polygon or Bézier, two for a spline, and four faces for a polyhedron. Spline completion offers a closed/open option. Domain bounds use the picked points' x/y coordinates (and z for equation3); x/y correspond to u/v for a parametric surface.

Plane constructions ​

txt
circumcircle cc A B C
incircle ic A B C
angle_bisector bis A V B
angle_bisector ext A V B external
point I = incenter(A, B, C)
point O = circumcenter(A, B, C)
point H = orthocenter(A, B, C)
point G = centroid(A, B, C)

tangent tanLine path at 0.5
normal normalLine path at 0.5
tangents candidates circleName from P
let chosen = candidates.first

parabola par F directrix directrixLine from -10 to 10
hyperbola hyp F1 F2 through P from -3 to 3
bezier quadratic A B C
bezier cubic A B C D
regular_polygon hex O V sides 6
spline route A B C D
spline loop A B C D closed
sector wedge O radius 2 from 0 to 90deg
circular_segment cap O radius 2 from 0 to 90deg
inequality disk (x^2 + y^2 <= r^2) domain -4 4 -4 4
  • circumcircle and incircle return ordinary circles. The four triangle-center functions return points; all reject degenerate triangles.
  • angle_bisector uses V as the vertex. external chooses the external line. A zero-length ray or an undefined bisector is invalid.
  • tangent and normal return lines at the carrier's native parameter, using the same parameter as point ... on ... at. A zero tangent is invalid.
  • tangents returns a list of lines, also rendered together. There are two exterior tangents, one at a point on the circle, and no tangents for an interior point (empty list and warning). Select a line before using it as a carrier.
  • A parabola's native parameter is signed distance along the direction obtained by rotating its focus-facing axis counterclockwise 90°. Its vertex is halfway between the focus and its perpendicular foot on the directrix. With focal length p, the axial coordinate is t²/(4p). from/to default to -10 10. The directrix may be a line, segment, or ray; a segment or ray stands for the whole line through it, which is what .directrix returns. Properties: .focus, .vertex, .axis, .directrix, .focalLength, .length.
  • A hyperbola is defined by the absolute focal-distance difference through P. from/to bound the hyperbolic parameter (default -3 3) on each branch: x = ±a cosh(u), y = b sinh(u) in its local axes. The combined path uses part-index + fraction: [0,1) is the left branch, [1,2] the right branch. There is a jump at 1, never a drawn connector. .left and .right are Paths with native parameter u and include both endpoints. Prefer them for a smooth animation confined to one branch. Properties: .center, .f1, .f2, .a, .b, .vertex1, .vertex2, .asymptote1, .asymptote2, .length.
  • Bézier accepts three or four control points; native parameter is [0,1]. Properties: .degree, .controls, .length.
  • regular_polygon returns a polygon with integer sides in [3,1000].
  • spline is a uniform Catmull–Rom interpolating spline. Open ends duplicate the endpoint control; closed uses periodic controls. Native parameter is control interval index + fraction, [0,n-1] open or [0,n) closed. Consecutive duplicate controls are invalid. Properties: .controls, .length.
  • sector and circular_segment return Regions with exact .area, sampled boundary loops, .contains(P), and an .arc Path. They compose with existing region boolean operations. Angles follow the existing counterclockwise arc convention. The circular segment is the cap bounded by the arc and its chord, and can be larger than a semicircle.
  • inequality takes a boolean expression in local x,y and clips it to its required rectangular domain. Undefined samples are excluded. .area and boundaries are numerical, like other Regions. Compose several conditions with intersection, union, or difference. Domain expressions reference ordinary script objects even if they are named x or y.

All new plane Paths support .point(t), .project(P), .param(P), .tangent(t), point binding, intersections, similarity transforms, and animation. Numeric intersections and path lengths use fixed samples and are approximate.

Space curves and faces ​

txt
circle3 orbit O normal (0,0,1) radius 2
circle3 throughThree A B C
arc3 arc O normal (0,0,1) radius 2 from 0 to 90deg
arc3 throughArc A B C
ellipse3 ellipse O normal (0,0,1) radii 3 2 angle 30deg
ellipse3 oriented O normal (cross3(vec3(O,A),vec3(O,B))) axis (vec3(O,A)) radii 3 2
polygon3 face A B C D
polygon3 ring outerFace holes holeFace

point3 P on orbit at 30deg
point3 Q on helix at 0.5
let nearest = helix.project(A)
let t = helix.param(A)
let direction = helix.tangent(0.5)
animate Q duration 4s mode pingpong

ellipse3 accepts axis <vector> instead of angle to orient its first axis; the vector is projected into the supporting plane and must remain nonzero. Using both clauses is invalid.

Space Paths are segment3, ray3, line3, circle3, arc3, ellipse3, polygon3 boundaries, curve3, and locus3. They all provide point(t), project(P), param(P), tangent(t) (unit vector), and .length. A bound point with a literal at can be dragged, animated, and written back without losing comments or angle units. Open bounded carriers clamp at to their endpoints; circles and ellipses are periodic. Unbounded carriers require animation over. Sphere surface binding continues to use atAngles and two parameters.

Native parameters:

CarrierParameter
segment3fraction [0,1]
ray3 / line3distance / signed distance, as before
circle3 / ellipse3angle / eccentric angle [0,2pi)
arc3angle [from,to]
polygon3 boundaryedge index + fraction; loop edges concatenate with gaps between loops
curve3the declared parameter and its from/to domain
locus3the driver's value and range

The default planar basis projects world +x into the plane; near a normal parallel to +x it projects +y instead. Its second axis is normal × firstAxis. Three-point arcs start at A, pass through B, and end at C. curve3 retains its exact expression evaluator; locus3 interpolates sampled continuous pieces. Projection is numerical. Undefined parameter gaps remain invalid rather than being bridged. At a corner, polygon boundary tangents use the outgoing edge.

circle3 properties: .center, .normal, .radius, .area, .length. arc3/ellipse3 also expose .rx, .ry, .f1, .f2, and .angle (sweep). ellipse3.area is exact; arc .area refers to the supporting ellipse, not a sector.

A polygon3 must be simple, finite, and coplanar. It can be concave. holes combines an outer face with an inner face's loops; boundaries must be disjoint. Hole/island nesting uses even–odd fill. Properties: .area, .centroid, .normal, .count, .vertices, .perimeter, .length; method .contains(P) also checks that P is in the supporting plane. Triangulation respects holes.

Solids, sections, and generated surfaces ​

txt
polyhedron custom face1 face2 face3 face4
section cut custom by cuttingPlane
section ballCut ball by cuttingPlane
frustum round baseCenter topCenter radii 2 1
pyramid_frustum truncated baseFace top topCenter scale 0.5
extrude extrusion ring by (0,0,3)
extrude roundExtrusion orbit by (0,0,3) samples 96
revolve revolvedFace profileFace around axis samples 64
revolve revolvedCurve profileCurve around axis from 0 to 180deg samples 64

parametric_surface torus ((3+cos(v))*cos(u),(3+cos(v))*sin(u),sin(v)) domain 0 2pi 0 2pi samples 48
let surfacePoint = torus.point(0,0)
let surfaceNormal = torus.normal(0,0)
equation3 quadric (x^2+y^2+z^2-4) domain -3 3 -3 3 -3 3 samples 32
  • polyhedron takes at least four polygon faces. Shared vertices are matched geometrically. Every edge must belong to two faces; the boundary must be connected and consistently orientable. Input faces must define a simple, non-self-intersecting solid. Winding is corrected before volume integration. .volume, .surfaceArea, .centroid, .count, .vertices, .faces, .edges are available. Face and edge lists can feed subsequent constructions.
  • section intersects a solid with a plane. Polyhedral cuts produce a polygon3 with one or more loops, including holes. Coplanar faces are handled; cuts with no area (empty, vertex, or edge contact) return an empty list and warning. A sphere cut is an exact circle3. Cylinder, cone, and round-frustum cuts use sampled polygon boundaries; polyhedron/box/prism/pyramid cuts use their actual planar faces. Section boundary points can be bound and animated normally.
  • frustum is a circular frustum. Its measures are exact; displayed round boundaries are sampled. .height, .radius1, .radius2 supplement solid measures. pyramid_frustum translates/scales a simple polygon about its centroid to a top center outside its plane; positive scale defines the top similarity.
  • extrude accepts polygon3 (including holes), circle3, or ellipse3. Its direction must leave the profile plane. Polygon measures are exact; circular/elliptic profiles are sampled (default 96, clamped to [8,256]).
  • revolve accepts a bounded space Path or a simple polygon3. A Path produces an open surface; a polygon produces a closed solid. The axis must lie in the polygon's plane, and the generating region must stay on one side of the axis. Defaults: full turn, 64 samples; partial turns receive closing caps. Holes in generating polygons are rejected. Mesh measures are numerical. Revolution is limited to 30,000 generated vertices.
  • parametric_surface binds local u,v inside the coordinate triple. Domain bounds are ordinary scalar expressions. Samples default to 48 and clamp to [8,160] intervals per axis. Undefined cells stay open. .point(u,v) evaluates the expression exactly; .normal(u,v) uses numerical partial derivatives. .surfaceArea is a triangle estimate. Point binding uses curves, not surface UV.
  • equation3 takes a scalar field and draws its zero set in a required box; write lhs-rhs to express an equation. Marching tetrahedra share a deterministic cube subdivision. Samples default to 32 and clamp to [8,64] per axis. Undefined cells stay open; an empty result warns. .surfaceArea is a triangle estimate; it is a surface, not a volumetric solid. Mesh generation stops at 250,000 vertices.

Generated faces/surfaces render in WebGL and export to SVG. Similarities transform curves, faces, generated meshes, and their measurements. As with existing objects, changes flow through source dependencies, and geometry never depends on viewport. Region/surface sampling is charged to the evaluation budget; the Viewer may refuse high sample counts sooner than the editor.

Spherical solids ​

txt
sphere_cap cap ball normal (0,0,1) height 1 samples 32
hemisphere half ball normal (0,0,1) samples 32
sphere_zone band ball normal (0,0,1) from -1 to 1 samples 32
sphere_sector radial ball normal (0,0,1) height 1 samples 32

The source is a sphere; normal defines its positive axis. Cap height is in (0,2r]; hemisphere uses height r. A zone is the solid slice between two signed axial offsets, -r <= from < to <= r. A spherical sector joins the cap's spherical surface to the sphere center along radial segments. These solids reuse meridian revolution for sampled display, while .volume, total .surfaceArea, .centroid, .height, and spherical .curvedArea use exact formulas. A cap's total area includes its closing disk; a zone includes both disks; a sector includes its conical boundary. Samples default to 32 and clamp to [8,96]. Similarities preserve exact measures.