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.
| Space | Category | Tools |
|---|---|---|
| 2D | Points and centers | Point, incenter, circumcenter, orthocenter, centroid |
| 2D | Linear objects | Segment, vector, line, ray |
| 2D | Auxiliary lines | Perpendicular, parallel, tangent, normal, tangents from a point, angle bisector |
| 2D | Circles and arcs | Circle, arc, circumcircle, incircle |
| 2D | Conics | Ellipse, parabola, hyperbola |
| 2D | Curves | Bézier, spline |
| 2D | Polygons and regions | Regular polygon, sector, circular segment, inequality |
| 3D | Linear objects | Segment3, vector3, line3 |
| 3D | Space circles and curves | Circle3, arc3, ellipse3 |
| 3D | Planar figures and sections | Plane, polygon3, section |
| 3D | Polyhedra | Box, prism, pyramid, polyhedron, pyramid frustum |
| 3D | Cylinders, cones and frustums | Cylinder, cone, circular frustum |
| 3D | Spheres and spherical parts | Sphere, cap, hemisphere, zone, sector |
| 3D | Generated geometry | Extrude, revolve |
| 3D | Mathematical surfaces | Parametric 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.
| Tool | Pick order |
|---|---|
| Tangent / normal | Curve, point (projected onto the curve) |
| Tangents from a point | Circle, external point |
| Angle bisector | Point, vertex, point; then choose internal/external |
| Triangle circles / centers | Three triangle vertices |
| Parabola | Focus, directrix line, segment, or ray |
| Hyperbola | Focus 1, focus 2, point on the curve |
| Bézier / spline | Ordered control points; Enter or Finish completes the list (Bézier also completes at four points) |
| Regular polygon | Center, vertex; then set the number of sides |
| Sector / circular segment | Center, start radius point, end direction point (counterclockwise) |
| Space line / plane | Two distinct points / three non-collinear points |
| circle3 / arc3 | Three points; the middle arc point lies on the arc |
| ellipse3 | Center, major-axis endpoint, minor-axis measuring point; the third point defines the plane and its perpendicular distance defines the second radius |
| polygon3 / polyhedron | Ordered vertices / polygon faces; Enter, Finish, or pick the first object again to finish |
| Section | Solid, cutting plane |
| Circular frustum | Base center, base radius point, top center, top radius point |
| Pyramid frustum | Base polygon, top center, top radius point (relative to the base's first vertex) |
| Extrude | Profile, vector or segment defining the extrusion displacement |
| Revolve | Profile, axis line (full revolution) |
| Spherical pieces | Sphere, 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 surface | Two 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
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 4circumcircleandincirclereturn ordinary circles. The four triangle-center functions return points; all reject degenerate triangles.angle_bisectorusesVas the vertex.externalchooses the external line. A zero-length ray or an undefined bisector is invalid.tangentandnormalreturn lines at the carrier's native parameter, using the same parameter aspoint ... on ... at. A zero tangent is invalid.tangentsreturns 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 ist²/(4p).from/todefault 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.directrixreturns. Properties:.focus,.vertex,.axis,.directrix,.focalLength,.length. - A hyperbola is defined by the absolute focal-distance difference through
P.from/tobound 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 at1, never a drawn connector..leftand.rightare Paths with native parameteruand 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_polygonreturns a polygon with integersidesin[3,1000].splineis a uniform Catmull–Rom interpolating spline. Open ends duplicate the endpoint control;closeduses 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.sectorandcircular_segmentreturn Regions with exact.area, sampled boundary loops,.contains(P), and an.arcPath. 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.inequalitytakes a boolean expression in localx,yand clips it to its required rectangular domain. Undefined samples are excluded..areaand boundaries are numerical, like other Regions. Compose several conditions withintersection,union, ordifference. Domain expressions reference ordinary script objects even if they are namedxory.
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
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 pingpongellipse3 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:
| Carrier | Parameter |
|---|---|
| segment3 | fraction [0,1] |
| ray3 / line3 | distance / signed distance, as before |
| circle3 / ellipse3 | angle / eccentric angle [0,2pi) |
| arc3 | angle [from,to] |
| polygon3 boundary | edge index + fraction; loop edges concatenate with gaps between loops |
| curve3 | the declared parameter and its from/to domain |
| locus3 | the 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
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 32polyhedrontakes 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,.edgesare available. Face and edge lists can feed subsequent constructions.sectionintersects a solid with a plane. Polyhedral cuts produce apolygon3with 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 exactcircle3. 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.frustumis a circular frustum. Its measures are exact; displayed round boundaries are sampled..height,.radius1,.radius2supplement solid measures.pyramid_frustumtranslates/scales a simple polygon about its centroid to a top center outside its plane; positivescaledefines the top similarity.extrudeacceptspolygon3(including holes),circle3, orellipse3. Its direction must leave the profile plane. Polygon measures are exact; circular/elliptic profiles are sampled (default 96, clamped to[8,256]).revolveaccepts a bounded space Path or a simplepolygon3. 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_surfacebinds localu,vinside 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..surfaceAreais a triangle estimate. Point binding uses curves, not surface UV.equation3takes a scalar field and draws its zero set in a required box; writelhs-rhsto 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..surfaceAreais 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
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 32The 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.
